phpbb bridging not working, fresh install phpbb bridging not working, fresh install
 

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

phpbb bridging not working, fresh install

Started by Casper, May 02, 2005, 11:26:12 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Casper

I had problems adding a phpbb bridge, using phpbb 2.0.11 and the current dev checkout.

It caused database error.  So I installed the latest 2.0.14 version of phpbb, and on another up to date 1.4 cpg install, had exactly the same problem.

The db error is as follows;

QuoteWhile executing query "SELECT user_id as user_id FROM `clive_cpg`.phpbb_users WHERE group_id in (1)" on 0

mySQL error: Unknown column 'group_id' in 'where clause'

On checking, I found there is no such thing as 'group_id' in the phpbb users table, the nearest thing is 'user_level'.  I tried various changes to the phpbb.inc.php, all without success, as it's a bit above me.
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

Nibbler

Caused by this code in init.inc.php

// Retrieve Array of Admin Users (used for hiding admin usernames on thumbnails)
$results = cpg_db_query("SELECT {$cpg_udb->field['user_id']} as user_id FROM $cpg_udb->usertable WHERE {$cpg_udb->field['usertbl_group_id']} in (" . implode(',',$CONFIG['ADMIN_GROUPS']).')');
$CONFIG['ADMIN_USERS']=array();
while ($row = mysql_fetch_array($results)) {
    $CONFIG['ADMIN_USERS'][] = $row['user_id'];
} // while
mysql_free_result($results);



You can't assume that all forums have such a simple user-group relationship, in fact most do not. I propose we cut this feature, and schedule it for 1.5 where it can be properly implemented. (unless someone has the time to find and test a solution for all 13 bbs).

Nibbler

Taking that silence as agreement, feature removed.

Casper

Just did an update, but still get the same error as originally posted;

QuoteWhile executing query "SELECT user_id as user_id FROM `clive_cpg`.phpbb_users WHERE group_id in (1)" on 0

mySQL error: Unknown column 'group_id' in 'where clause'
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here


Casper

Version 1.92 does not give an error, but admin is seen as a regular user, and gets the admin menus as a registered user, not admin, so cannot admin the gallery.
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

Nibbler

Unrelated issue. Marking this as fixed. Will commit fixed up phpbb bridge for this new issue shortly.

donnoman

That was an approved 1.4 feature.

Quote from: GauGau on October 26, 2004, 08:55:32 AM

It should not have been removed without discussion.


donnoman

Sorry Nibbler, I missed this section as I do not use phpbb bridging so I never read this thread.

However you nixed a feature that I like for the sake of a single bridge that isn't working, I don't think thats a valid reason.

Fix either the bridging or the feature, I don't think nixing it is an acceptable solution.

Nibbler

The code you added breaks many of the bridges in order to add a trivial feature. I only commented out the code, it is still there if you can fix the bug.

donnoman

I don't understand where casper was having a problem with the original code.


// Retrieve Array of Admin Groups (used for hiding admin usernames on thumbnails)
$results = cpg_db_query("SELECT group_id FROM {$CONFIG['TABLE_USERGROUPS']} WHERE has_admin_access ");
$CONFIG['ADMIN_GROUPS']=array();
while ($row = mysql_fetch_array($results)) {
   $CONFIG['ADMIN_GROUPS'][]= $row['group_id'];
} // while
mysql_free_result($results);

// Retrieve Array of Admin Users (used for hiding admin usernames on thumbnails)
$results = cpg_db_query("SELECT {$cpg_udb->field['user_id']} as user_id FROM $cpg_udb->usertable WHERE {$cpg_udb->field['usertbl_group_id']} in (" . implode(',',$CONFIG['ADMIN_GROUPS']).')');
$CONFIG['ADMIN_USERS']=array();
while ($row = mysql_fetch_array($results)) {
   $CONFIG['ADMIN_USERS'][] = $row['user_id'];
} // while
mysql_free_result($results);

Quote from: Casper on May 07, 2005, 04:02:36 PM
Just did an update, but still get the same error as originally posted;

QuoteWhile executing query "SELECT user_id as user_id FROM `clive_cpg`.phpbb_users WHERE group_id in (1)" on 0

mySQL error: Unknown column 'group_id' in 'where clause'

Which means theres an admin group with id of 1 set as administrators, but no users in the group... so how can any bridged user ADMIN his coppermine install?

He then reports:

Quote from: Casper on May 08, 2005, 12:35:49 PM
Version 1.92 does not give an error, but admin is seen as a regular user, and gets the admin menus as a registered user, not admin, so cannot admin the gallery.

So this leads me to believe that if you correct the admin issue with the bridge, the original code for the admin uploader feature will work as designed.

donnoman

#12
Nibbler what was the "unrelated" issue?

Casper can you re-enable all the oringinal admin uploader code and see if it works properly now that you have the admin problem fixed.

Casper

The admin problem is not fixed yet, so going back at the moment will just return me to the opening point of this thread.

I'm waiting for Nibblers fix to the phpbb.inc.php file.

It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

Nibbler

It's how the tables are setup in the database of the forum.

Your query assumes the user table stores the group of the user. Coppermine does this, so the query works.

PHPBB and others use a usergroups table, so you have to join the 2 tables on user_id to get the groups for a specified user.

I don't think there is an easy fix here.

I already searched the whole code to check the impact of commenting out yours. The unrelated issue is unrelated, and the fix is not yet in cvs.

donnoman

Ahh sorry Casper, I didn't realise that.

Perhaps Nibbler can test the uploader code when he's finished with the admin fix.

donnoman

Nibbler, the group code is synced to coppermine, and thats how users can establish that they are the gallery admin period. Thats how coppermine works.

It's immaterial how the forum stores the information, the bridge HAS to give it to coppermine in that form, it has nothing to do with the uploader code.

The uploader code is just looking for the same thing that the rest of coppermine looks for to see if a user is "GALLERY_ADMIN".

Fix the admin problem, uploader code should work.

Nibbler

Commited fix, update phpbb bridge and udb_core. Ignore updated picmgmt.inc.php.

Don't try to tell me how coppermine works.

donnoman