Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Bridged with phpBB: group admin possible  (Read 7286 times)

0 Members and 1 Guest are viewing this topic.

Lusch

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Bridged with phpBB: group admin possible
« on: April 18, 2007, 12:16:58 am »

I bridged a new coppermine install with phpBB 2.0.22 just now. I don't really need support, everything works.

I'm just curious if it is possible to configure the bridge in a way so that a user group has admin rights in Coppermine, in stead of only the users which are marked as admins in phpBB?

The reason I'm asking is that I'd like to make several users admin of Coppermine, but not of phpBB.

I noticed some fields in the `bridge` table of coppermine regarding group tables and stuff. Is it possible to configure something there? I can't find anything about this in the docs.
« Last Edit: April 18, 2007, 09:17:34 am by GauGau »
Logged

Nibbler

  • Guest
Re: Bridged with phpBB: group admin possible
« Reply #1 on: April 18, 2007, 12:26:33 am »

This is a fairly common question, please remember to search before you post.

If you look at the bridge file (for example bridge/phpbb2018.inc.php for you) you can see this code

Code: [Select]
$this->admingroups = array(2);
If you want group 123 to also be given admin rights then you can change the code to

Code: [Select]
$this->admingroups = array(2, 123);
Please be aware that setting up permissions like this is not recommended. Only give Coppermine admin rights to people you trust absolutely.
Logged

Lusch

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Bridged with phpBB: group admin possible
« Reply #2 on: April 18, 2007, 12:39:36 am »

My appologies. Didn't find it using the search.
Logged

Lusch

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Bridged with phpBB: group admin possible
« Reply #3 on: April 18, 2007, 01:18:21 pm »

Something doesn't add up to me...:

In order to gave a user admin access, the first group-ID minus 100 has to be in the `admingroups` array:

udb_base.inc.php (line 86)
Code: [Select]
                if ($this->use_post_based_groups){
                        $USER_DATA['has_admin_access'] = (in_array($USER_DATA['groups'][0] - 100,$this->admingroups)) ? 1 : 0;

but, this will never be the case for a user which doesn't have the admin status in phpBB, because of:

phpbb2018.inc.php (line 157)
Code: [Select]
if ($this->userlevel == 1 || in_array($row[$this->field['usertbl_group_id']] , $this->admingroups)) array_unshift($data, 102);
if ($this->userlevel == 0 || $this->userlevel == 2) array_unshift($data, 2);

As you can see, the first element in the `data` array will be 2 if the user doesn't have the admin status in phpBB, since 2 minus 100 is -98.

Am I missing something? Thanks.
Logged

Lusch

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Bridged with phpBB: group admin possible
« Reply #4 on: April 18, 2007, 03:34:06 pm »

I made some changes to make it work for my situation. I'm curious if you think this could lead to (security) problems...

udb_base.inc.php around line 87 changed this:
Code: [Select]
$USER_DATA['has_admin_access'] = (in_array($USER_DATA['groups'][0] - 100,$this->admingroups)) ? 1 : 0;into
Code: [Select]
$USER_DATA['has_admin_access'] = 0;

foreach($USER_DATA['groups'] as $user_group)
if(in_array(($user_group-100),$this->admingroups))
$USER_DATA['has_admin_access'] = 1;

udb_base.inc.php: commented out the lines where users are added to predefined groups (2, 102) around lines 158 and 357. And of course added the group-id's which I want to have admin rights to the admingroup array at the top.

The idea is that a logged-in user which is member of any group which I have defined as a admingroup has admin rights in Coppermine. Another plus is that only the phpBB groups are shown in the userlist.

The groups in phpBB which I want to be admin, are closed groups... I determine which people are in those groups. So no problem in that area.

Let me know what you think...
Logged
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 19 queries.