Coppermine 1.3.5--> SMF Bridge. Making all mods into admins Coppermine 1.3.5--> SMF Bridge. Making all mods into admins
 

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

Coppermine 1.3.5--> SMF Bridge. Making all mods into admins

Started by MDNorway, November 29, 2005, 06:28:12 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

MDNorway

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

Nibbler

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']);

MDNorway

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?

Nibbler

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.

MDNorway

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!

Nibbler

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']));

MDNorway

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