vBulletin & admin group vBulletin & admin group
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

vBulletin & admin group

Started by FixB, February 08, 2006, 12:36:20 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

FixB

I tried (successfully) to integrate Coppermine & vBulletin.
But it seems that only the vBulletin administrator has the administro rights in coppermine.
Is it possible to create a vbulletin user-group and assign to it the administrator rights for coppermine ?

Thanks for your help !

Nibbler

You can do that by modifying the list of groups that have admin status in the bridge file

$this->admingroups = array(6);

FixB

Thanks for your (pretty quick!) answer !

I'm afraid I'm not really aware of the way arrays are dealt in php.
Can you confirm that if the vBulletin group to which I want to give admin rights is the number 40, I should replace the line with :

$this->admingroups = array(6,40);

(why the "6" btw ??)

And here is another question (last one, I promise !!) : after the bridging, it seems that the only coppermine groups available are : admin/registered/guests/banned
I would like to have another group wich users (who are also vBulletin users) whould not have the admin rights, but would have different rights than the other registered, Is there a way to do this ??

Thanks again for your help !

Nibbler

6 is the normal admin group, your code looks fine to me.

Check the manual for how to import forum groups.

http://coppermine-gallery.net/demo/cpg14x/docs/index.htm#bridge_manager_specific_start

FixB

Thanks : I got the vBulletin groups now, and it seems that the group I chose is now 'special' (as if I look in the sql database, it has got the flag 'has_admin_access' at 1), but still the users from this group can't access to the admin functionnalities :(

Where can I find information on how coppermine determines if someone has admin rights or no ??

FixB

I think I got the answer : in the file udb_bas.inc.php, I modified the test for admin, si that it checks all the groups of the user, not only the first one. In my case, it did the trick ! Hope it helps any others with this pb ?


if ($this->use_post_based_groups){
//$USER_DATA['has_admin_access'] = (in_array($USER_DATA['groups'][0] - 100,$this->admingroups)) ? 1 : 0;

//MOD FXB: Parcours de TOUT les groupes de l'utilisateur
$USER_DATA['has_admin_access']=0;
for($iGroupe=0;$iGroupe<sizeof($USER_DATA['groups']);$iGroupe++) // tant que $i est inferieur au nombre d'éléments du tableau...
{
if (in_array($USER_DATA['groups'][$iGroupe] - 100,$this->admingroups)) {
$USER_DATA['has_admin_access']=1;
}
}
// FIN MOD FXB
} else {
$USER_DATA['has_admin_access'] = ($USER_DATA['groups'][0] == 1) ? 1 : 0;
}

Nibbler

That's fine, I was about to post something similar.

FixB

Thank you !
Maybe this thread should be tagged as solved, everything seems to work just fine. Do you see anywhere else where this modification would be necessary ?
And maybe this could be integrated in future versions as I don't think there are any side effects to be expected (maybe very very very little performance drawback ?).

Thanks again for your help !