vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   ibProArcade Archive (https://vborg.vbsupport.ru/forumdisplay.php?f=174)
-   -   Secondary Group Permissions Issue (https://vborg.vbsupport.ru/showthread.php?t=128351)

MrZeropage 01-13-2007 07:55 AM

Hmmm, as I see it does merge the permissions for the categories, fine.
When about the other settings like "posts per day to play" ect. which setting does it take finally if you have set it different in primary and secondary usergroup(s) ?

Could anybody please test this out with more than 2 secondary groups, different settings per group ect and give feedback here ? THANKS

wastemytime 01-13-2007 10:31 AM

Quote:

Originally Posted by MGSteve (Post 1157680)
I can't believe it doesn't treat permissions in the same way that vBulletin does. Sadly, I've only just found out it doesn't work as it should after I've set everything else up, spending 3 hours in the process.

Likewise, I'll gladly donate $25 IF you get this to work correctly with vBulletin's permission system, frankly I'm amazed you haven't done so already, given the pledges on this thread.

Not to mention, I'd have thought the majority of people installing this system will want to tie it into the subscription system & thus the usergroups.

Erm, I think I've done it anyway! It didn't appear to be very hard to do - so I'm thinking I've missed something! But it appears to work on my setup anyway....

Delete this out of the mod_arcade.php file...

Code:

        $DB->query("SELECT m.id, m.name, m.posts, m.arcade_ban, m.times_played, m.is_arcade_mod AS is_mod,
                              m.fav_games AS favs, m.user_sort, m.user_order, m.user_g_pp, m.membergroupids,
                    m.user_s_pp, m.def_g_cat, m.game_skin, m.arcade_mod_privs, m.arcade_pmactive, g.g_access_cp AS is_admin,
                    g.arcade_access, g.p_require, g.max_play, g.ppd_require, g.ibpa_cats AS allowed_categories
                    FROM ibf_members AS m
                    LEFT JOIN ibf_groups AS g
                    ON (m.mgroup = g.g_id) 
                    WHERE id=".$ibforums->member['id']." LIMIT 0, 1");
        $this->user = $DB->fetch_row();

// use ON (m.membergroupids = g.g_id) in above Query for secondary Usergroup

and replace with
Code:

        // Mod by MGSteve to support vBulletin Secondary Groups.

        // We don't limit the number of rows returned now, so we'll get one row for each usergroup they're
        // part of. So, we save the first row as we did before, but we then go through & merge all the usergroup category
        // permissions and save this in the allowed_categories field of the $this->user array.
       
        $DB->query("SELECT m.id, m.name, m.posts, m.arcade_ban, m.times_played, m.is_arcade_mod AS is_mod,
                              m.fav_games AS favs, m.user_sort, m.user_order, m.user_g_pp, m.membergroupids,
                    m.user_s_pp, m.def_g_cat, m.game_skin, m.arcade_mod_privs, m.arcade_pmactive, g.g_access_cp AS is_admin,
                    g.arcade_access, g.p_require, g.max_play, g.ppd_require, g.ibpa_cats AS allowed_categories
                    FROM ibf_members AS m, ibf_groups AS g
                    WHERE
                    (m.mgroup = g.g_id OR m.membergroupids = g.g_id)
                    AND
                    id={$ibforums->member['id']}");
       
        // Ok, how many rows have we got?
        $nRowMax = $DB->get_num_rows();
        $this->user = $DB->fetch_row();
       
        if ($nRowMax > 1)
        {
          // No point doing this if we've only returned one row!!
          for ($nRowCnt = 0;$nRowCnt < $nRowMax;$nRowCnt++)
          {
            if ($nRowCnt == 0)
              // We've already got the first row!
              $Row = $this->user;
            else
              $Row = $DB->fetch_row();

            $Cats[] = $Row['allowed_categories'];
          }
         
          // Ok, now collapse the array down into a Comma Seperated String (as stored in the DB)
          $Cats = implode(',',$Cats);
          // And save this back over the allowed_categories field in the first row.
          $this->user['allowed_categories'] = $Cats;
          unset($Cats);
          unset($Row);
          unset($nRowCnt);
          unset($nRowMax);
        }


Hi, which Setup do you use, my secondary Usergroups (subscribers) have still no permissions to play.

Oh, i am sorry, it works with Categories...thanky you!

MGSteve 01-13-2007 11:27 AM

Quote:

Originally Posted by MrZeropage (Post 1157830)
Hmmm, as I see it does merge the permissions for the categories, fine.
When about the other settings like "posts per day to play" ect. which setting does it take finally if you have set it different in primary and secondary usergroup(s) ?

Could anybody please test this out with more than 2 secondary groups, different settings per group ect and give feedback here ? THANKS

Ah, I hadn't used posts per day etc.. so I don't know about those. Still, those aren't usergroup dependent, are they?

noppid 01-13-2007 02:45 PM

We had a similar problem with the vBPicGallery Photo Gallery for vBulletin.

All it takes is a simple function to loop through the permissions and set each for the highest allowed settings.

Easily solved.

MrZeropage 01-13-2007 11:07 PM

Quote:

Originally Posted by MGSteve (Post 1157943)
Ah, I hadn't used posts per day etc.. so I don't know about those. Still, those aren't usergroup dependent, are they?

There are several settings per Usergroup:
- can view/play arcade or not
- post count requirement
- post per day
- max. plays per day
- can create tournament
- category permissions

the last one is solved, but what about the others?

MrZeropage 01-14-2007 10:58 AM

Ok, I now extended this and v2.5.9+ will fully support primary and secondary usergroup permissions for all those settings :)

MortysTW 02-03-2007 06:11 PM

Alright, I got a group permissions that seems to fall into what you wanted tested.

Okay. I have various usergroups with various arcade permissions. I'll describe 2 to keep it simple.

When you have made 500 posts on the site you are promoted, as a SECONDARY group, with 50 game plays per day. Mind you this is a SECONDARY group.

If you become a PREMIUM MEMBER you get unlimited game plays and when you go PREMIUM your PRIMARY usergroup is PREMIUM and you still keep the 500+ Usergroup as your SECONDARY.

Problem is, seems like the restriction set on the SECONDARY is overriding the permissions of the PRIMARY "Premium" usergroup.

This is for game plays per day. Any ideas how to solve this?


All times are GMT. The time now is 12:59 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01058 seconds
  • Memory Usage 1,748KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete