Advanced search  

News:

cpg1.5.44 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter recently discovered vulnerabilities. It is important that all users who run version cpg1.5.42 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: admin user not recognized after update  (Read 5370 times)

0 Members and 1 Guest are viewing this topic.

egfg

  • Coppermine newbie
  • Offline Offline
  • Posts: 15
admin user not recognized after update
« on: April 04, 2014, 04:36:22 AM »

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?
Logged

egfg

  • Coppermine newbie
  • Offline Offline
  • Posts: 15
Re: admin user not recognized after update
« Reply #1 on: April 04, 2014, 05:14:29 AM »

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

Quote
In 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?
Logged

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 623
    • GMC Design Photo Gallery
Re: admin user not recognized after update
« Reply #2 on: April 04, 2014, 12:48:56 PM »

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...
Logged
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

egfg

  • Coppermine newbie
  • Offline Offline
  • Posts: 15
Re: admin user not recognized after update
« Reply #3 on: April 04, 2014, 10:41:47 PM »

Quote
Are 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.

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

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

)
Logged

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 623
    • GMC Design Photo Gallery
Re: admin user not recognized after update
« Reply #4 on: April 04, 2014, 11:19:07 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...
Logged
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

egfg

  • Coppermine newbie
  • Offline Offline
  • Posts: 15
Re: admin user not recognized after update
« Reply #5 on: April 05, 2014, 12:03:37 AM »

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:

Code: [Select]
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
        (
        )

)
Logged

egfg

  • Coppermine newbie
  • Offline Offline
  • Posts: 15
Re: admin user not recognized after update
« Reply #6 on: April 05, 2014, 12:09:54 AM »

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:
Code: [Select]
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
        (
        )

)

Logged

egfg

  • Coppermine newbie
  • Offline Offline
  • Posts: 15
Re: admin user not recognized after update
« Reply #7 on: April 05, 2014, 12:16:05 AM »

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

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

egfg

  • Coppermine newbie
  • Offline Offline
  • Posts: 15
Re: admin user not recognized after update
« Reply #8 on: April 05, 2014, 02:12:36 AM »

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
Code: [Select]
$this->admingroups = array(16);
Well, sure enough in cpg1.5.28/cpg15x/bridge/phpbb3.inc.php it has
Code: [Select]
$this->admingroups = array(5);, when I changed it to
Code: [Select]
$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?
Logged

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 623
    • GMC Design Photo Gallery
Re: admin user not recognized after update
« Reply #9 on: April 05, 2014, 04:17:11 AM »

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?


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

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15247
Re: admin user not recognized after update
« Reply #10 on: April 22, 2014, 11:10:17 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.
Logged

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 623
    • GMC Design Photo Gallery
Re: admin user not recognized after update
« Reply #11 on: April 22, 2014, 01:22:16 PM »

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

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15247
Re: admin user not recognized after update
« Reply #12 on: July 01, 2014, 01:02:58 PM »

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

egfg

  • Coppermine newbie
  • Offline Offline
  • Posts: 15
Re: admin user not recognized after update
« Reply #13 on: July 18, 2014, 02:52:42 AM »

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

Page created in 0.085 seconds with 20 queries.