coppermine-gallery.com/forum

Support => cpg1.3.x Support => Older/other versions => cpg1.3 (BBS) Integration / Bridging => Topic started by: MDNorway on November 29, 2005, 06:28:12 PM

Title: Coppermine 1.3.5--> SMF Bridge. Making all mods into admins
Post by: MDNorway on November 29, 2005, 06:28:12 PM
Hello,

First of all thanks for a great product! My users love it. :)

Sadly a few users are trying to ruin the fun, and we need to get a higher number of guys able to delete offensive photos.

I have 2 groups that I want to be able to manage all parts of coppermine.

1.) The global Administrators.   This is SMF group ID 2

2.) A Mod group I made.  This is SMF group ID 14

I have searched and read the forum about others who have modified the "Bridge" file, but i am unsure what to do on my SMF implementation.  (I found answeres for PHPBB.)

I am sorry if this is a silly question, but if anyone could help me I would really appreciate it.

Best

Matt
Title: Re: Coppermine 1.3.5--> SMF Bridge. Making all mods into admins
Post by: Nibbler on November 29, 2005, 06:35:15 PM
Try changing this line

$USER_DATA['has_admin_access'] = $user_info['is_admin'];

to

$USER_DATA['has_admin_access'] = $user_info['is_admin'] || in_array(14,$user_info['groups']);
Title: Re: Coppermine 1.3.5--> SMF Bridge. Making all mods into admins
Post by: MDNorway on November 29, 2005, 07:21:20 PM
Quote from: Nibbler on November 29, 2005, 06:35:15 PM
Try changing this line

$USER_DATA['has_admin_access'] = $user_info['is_admin'];

to

$USER_DATA['has_admin_access'] = $user_info['is_admin'] || in_array(14,$user_info['groups']);

Thanks. It didn't seem to work.  Do I need to run the admin tools upgrade?  Is there an easy way for me to be sure I got thr right group number? is it supposed to have two | | lines?
Title: Re: Coppermine 1.3.5--> SMF Bridge. Making all mods into admins
Post by: Nibbler on November 29, 2005, 07:30:57 PM
Try further down the file,

define('USER_IS_ADMIN', $user_info['is_admin']);

to

define('USER_IS_ADMIN', $user_info['is_admin'] || in_array(14,$user_info['groups']));

The code change is all that is required. If you want to check the groups then enable debug mode, that will tell you what group you are in.
Title: Re: Coppermine 1.3.5--> SMF Bridge. Making all mods into admins
Post by: MDNorway on November 29, 2005, 07:40:34 PM
Quote from: Nibbler on November 29, 2005, 07:30:57 PM
Try further down the file,

define('USER_IS_ADMIN', $user_info['is_admin']);

to

define('USER_IS_ADMIN', $user_info['is_admin'] || in_array(14,$user_info['groups']));

The code change is all that is required. If you want to check the groups then enable debug mode, that will tell you what group you are in.

That worked ! ;D  Nibbler thank you so much for taking the time to help me, I'm sorry if they were silly questions.

Finally, should I wish to add gloal mods, would I change the code to be

define('USER_IS_ADMIN', $user_info['is_admin'] || in_array(2,14,$user_info['groups']));


Or is it only possible to have one variable?

Thanks

Matt
EDIT:  I did the above, and it seems to work!
Title: Re: Coppermine 1.3.5--> SMF Bridge. Making all mods into admins
Post by: Nibbler on November 29, 2005, 07:45:21 PM
Easiest way is just to keep extending it

define('USER_IS_ADMIN', $user_info['is_admin'] || in_array(14,$user_info['groups']) || in_array(2,$user_info['groups']));
Title: Re: Coppermine 1.3.5--> SMF Bridge. Making all mods into admins
Post by: MDNorway on November 29, 2005, 07:51:41 PM
Quote from: Nibbler on November 29, 2005, 07:45:21 PM
Easiest way is just to keep extending it

define('USER_IS_ADMIN', $user_info['is_admin'] || in_array(14,$user_info['groups']) || in_array(2,$user_info['groups']));

Brilliant! All tested and working.

Fantastic support, much appreciated.

Best

Matt