admin user not recognized after update admin user not recognized after update
 

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

admin user not recognized after update

Started by egfg, April 04, 2014, 04:36:22 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

egfg

I updated Coppermine from 1.5.20 to 1.5.28
Coppermine is bridged with phpBB3.

When I ran the update.php, it asked me for my username/password. It never did that before?
It did not recognize my normal admin user id/password. However, I used my "pre-bridged" admin user id/password and it DID accept that.
update.php then applied the database changes; however, it still doesn't recognize my admin id as Admin. It does allow me to logon as a regular User, but not in Admin mode? Also, the "pre-bridged" admin user id is NOT allowed to logon, so I have no admin id!

Is there a setting I can fix in the database with phpAdmin?

Or any other suggestions?

egfg

Update: Looking through posts I made in the past, I found a reply from Andre:

QuoteIn your MySQL database, go to the config table, find bridge_enable and set it to '0'.

I did so, now I can logon as a standalone admin, but once I enable bridging, my admin user does not get admin priveledges in Coppermine - although it DOES have them in phpBB3?

gmc

Quote from: egfg on April 04, 2014, 04:36:22 AM
When I ran the update.php, it asked me for my username/password. It never did that before?
update.php had security added to require native admin id/pwd to enable to run... A workaround is in doc in case you no longer remember the native admin credentials.

Quote
In your MySQL database, go to the config table, find bridge_enable and set it to '0'.
You can also go to bridgemgr.php.. It will prompt for native cpg admin credentials and will disable the bridge.

Quote
I did so, now I can logon as a standalone admin, but once I enable bridging, my admin user does not get admin priveledges in Coppermine - although it DOES have them in phpBB3?
Are you using cpg groups or those from phpbb3? (guessing phpbb3...)
Turn on debug for all users, http://documentation.coppermine-gallery.net/en/errors.htm#errors_debug_mode_config give instructions from config - followed by manually via phpMyAdmin.
Once logged in, 'show' debug data (option at bottom of every page when on)
See what is specified under "User Data" - specifically the list of groups assigned, "has_admin_access", and "group_name".
Post results here...

Quote
Also, the "pre-bridged" admin user id is NOT allowed to logon...
once bridged, the native cpg admin is only usable for special tasks like update.PHP and unbridging.

Let us know what you find...
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

egfg

QuoteAre you using cpg groups or those from phpbb3? (guessing phpbb3...)

Use bridge app custom groups?:        no

Quote...give instructions from config - followed by manually via phpMyAdmin.

I was a little confused by this statement? I enable debug via config. Never needed to use phpMyAdmin.

QuoteOnce logged in, 'show' debug data (option at bottom of every page when on)
See what is specified under "User Data" - specifically the list of groups assigned, "has_admin_access", and "group_name".
Post results here...

Here is *some* of the display I saw after logging on with my *admin* id from phpBB3.

USER DATA:
------------------
Array
(
     [groups] => Array
        (
           
  • => 2
            )

       
        [has_admin_access] => 0
        [access_level] => 3
     
        [group_name] => Registered
        [can_create_public_albums] => 0

        [can_see_all_albums] => 0
        [group_id] => 2
        [allowed_albums] => Array
            (
            )

    )

gmc

Quote from: egfg on April 04, 2014, 10:41:47 PM
I was a little confused by this statement? I enable debug via config. Never needed to use phpMyAdmin.
Since you were having issues logging in as admin, I provided an alternate means that doesn't require admin - via phpMyAdmin. Sorry to confuse...

Quote
Here is *some* of the display I saw after logging on with my *admin* id from phpBB3.
That's all we needed to see.
Shows you are in a single group only (groups array would have more entries if in multiple) - named Registered... and don't have admin access. The question of course is why...

My bridged gallery uses the forums groups... I'll see if I can run a test without.
Maybe one of the other devs using bridging can comment...
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

egfg

Here's something interesting?! I created a new User called AdminHelper. It only belongs to the Administrator's group in phpBB3. This is what I see when I bridge over to Coppermine:

USER DATA:
------------------
Array
(
    [user_id] => 277
    [user_name] => AdminHelper
    [groups] => Array
        (
            [0] => 116
        )

    [disk_max] => 0
    [disk_min] => 0
    [can_rate_pictures] => 0
    [can_send_ecards] => 0
    [can_post_comments] => 0
    [can_upload_pictures] => 0
    [can_create_albums] => 0
    [has_admin_access] => 0
    [access_level] => 3
    [pub_upl_need_approval] => 1
    [priv_upl_need_approval] => 1
    [group_name] => ADMINISTRATORS
    [can_create_public_albums] => 0
    [group_quota] => 0
    [can_see_all_albums] => 0
    [group_id] => 116
    [allowed_albums] => Array
        (
        )

)

egfg

Hmm... I can't edit my prior post. So...I forgot to mention that I tried using "Custom Groups" for the last post.
Here is what I see when I bridge using standard groups:
USER DATA:
------------------
Array
(
    [user_id] => 277
    [user_name] => AdminHelper
    [groups] => Array
        (
            [0] => 2
        )

    [disk_max] => 0
    [disk_min] => 0
    [can_rate_pictures] => 0
    [can_send_ecards] => 0
    [can_post_comments] => 0
    [can_upload_pictures] => 0
    [can_create_albums] => 0
    [has_admin_access] => 0
    [access_level] => 3
    [pub_upl_need_approval] => 1
    [priv_upl_need_approval] => 1
    [group_name] => Registered
    [can_create_public_albums] => 0
    [group_quota] => 0
    [can_see_all_albums] => 0
    [group_id] => 2
    [allowed_albums] => Array
        (
        )

)


egfg

QuoteShows you are in a single group only (groups array would have more entries if in multiple) - named Registered... and don't have admin access.

Actually, that's not true. That id belongs to several groups, which is why I tried creating the AdminHelper id which ONLY belongs to the ADMINISTRATORS group.

egfg

I found the problem. It is the same thing that gave me trouble during the last update. I followed my prior postings and saw this one:
http://forum.coppermine-gallery.net/index.php/topic,74721.msg359739.html#msg359739

which talked about $this->admingroups = array(16);

Well, sure enough in cpg1.5.28/cpg15x/bridge/phpbb3.inc.php it has $this->admingroups = array(5);, when I changed it to $this->admingroups = array(16); everything works as it should!

Now, the question is: Should this be corrected in the cpg source files or is this something unique to my system?

gmc

Ahh... I had forgotten about that... I bridge with SMF - and have only done one phpbb3 upgrade for someone else... and I did run into that when upgrading phpbb2 to phpbb3.

Unfortunately, the group number is different in every phpbb3 setup... from our doc, looks like it became an issue with phpbb2 to phpbb3 upgrade.
http://documentation.coppermine-gallery.net/en/bridging.htm#integrating_individual_bridge_issues_start

I would think as an enhancement - this should perhaps be carried in the bridge database if using phpbb3 - rather than hardcoded in phpbb3.inc.php and having to be reset after each upgrade...

Anyone see a reason why that wouldn't work?


Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

Αndré

Quote from: gmc on April 05, 2014, 04:17:11 AM
I would think as an enhancement - this should perhaps be carried in the bridge database if using phpbb3 - rather than hardcoded in phpbb3.inc.php and having to be reset after each upgrade...
Good idea. Instead of removing the hard-coded value we should add some simple code that checks for an "admin_ids" row in the bridge table and overwrite the hard-coded value with that value. Should be possible to add that feature in cpg1.5.x (back-end code directly in cpg1.5.x, GUI in the hidden features plugin). We need to make sure to remove that row while unbridging (or reset it while bridging), as it will cause trouble when bridging to another software.

Please reply to this thread so I can highlight it in my inbox.

gmc

Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

Αndré

I just added some code in SVN revision 8716 which checks for the row admingroups_phpbb3 when bridged to phpBB3.

@Greg: I re-considered your suggestion and I'm sure the admin and guest group IDs will be stored in the database's bridge table in cpg1.6.x. I'll start a new thread in the dev board with more details.

@egfg: feel free to add the above mentioned row with a value of '16' to your Coppermine bridge table in the database to recognize you as admin immediately without any code modification after the next upgrade.

egfg

Thank you!  :) I just did the upgrade to Coppermine 1.5.30

Just for documentation purposes:
1. Used PhpMyAdmin to add 'admingroups_phpbb3' with a value of '16' to my Coppermine bridge table.
2. Uploaded all the cpg 1.5.30 files via FTP.
3. ran "update.php"

and all is well! Everything works as it should!