Bridged with phpBB: group admin possible Bridged with phpBB: group admin possible
 

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

Main Menu

Bridged with phpBB: group admin possible

Started by Lusch, April 18, 2007, 12:16:58 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Lusch

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.

Nibbler

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

$this->admingroups = array(2);

If you want group 123 to also be given admin rights then you can change the code to

$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.

Lusch

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

Lusch

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)

                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)
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.

Lusch

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:
$USER_DATA['has_admin_access'] = (in_array($USER_DATA['groups'][0] - 100,$this->admingroups)) ? 1 : 0;
into

$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...