Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Coppermine 1.3.5--> SMF Bridge. Making all mods into admins  (Read 7660 times)

0 Members and 1 Guest are viewing this topic.

MDNorway

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Coppermine 1.3.5--> SMF Bridge. Making all mods into admins
« 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
« Last Edit: November 29, 2005, 07:54:18 pm by Nibbler »
Logged

Nibbler

  • Guest
Re: Coppermine 1.3.5--> SMF Bridge. Making all mods into admins
« Reply #1 on: November 29, 2005, 06:35:15 pm »

Try changing this line

Code: [Select]
$USER_DATA['has_admin_access'] = $user_info['is_admin'];
to

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

MDNorway

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: Coppermine 1.3.5--> SMF Bridge. Making all mods into admins
« Reply #2 on: November 29, 2005, 07:21:20 pm »

Try changing this line

Code: [Select]
$USER_DATA['has_admin_access'] = $user_info['is_admin'];
to

Code: [Select]
$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?
« Last Edit: November 30, 2005, 09:19:02 am by GauGau »
Logged

Nibbler

  • Guest
Re: Coppermine 1.3.5--> SMF Bridge. Making all mods into admins
« Reply #3 on: November 29, 2005, 07:30:57 pm »

Try further down the file,

Code: [Select]
define('USER_IS_ADMIN', $user_info['is_admin']);
to

Code: [Select]
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.
Logged

MDNorway

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: Coppermine 1.3.5--> SMF Bridge. Making all mods into admins
« Reply #4 on: November 29, 2005, 07:40:34 pm »

Try further down the file,

Code: [Select]
define('USER_IS_ADMIN', $user_info['is_admin']);
to

Code: [Select]
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
Code: [Select]
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!
Logged

Nibbler

  • Guest
Re: Coppermine 1.3.5--> SMF Bridge. Making all mods into admins
« Reply #5 on: November 29, 2005, 07:45:21 pm »

Easiest way is just to keep extending it

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

MDNorway

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: Coppermine 1.3.5--> SMF Bridge. Making all mods into admins
« Reply #6 on: November 29, 2005, 07:51:41 pm »

Easiest way is just to keep extending it

Code: [Select]
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
Logged
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 15 queries.