forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 bridging => Topic started by: Caith on February 05, 2012, 07:43:02 am

Title: CPG 1.5.18 and phpBB 3.0.10 - bridging user groups - IDs don't match?
Post by: Caith on February 05, 2012, 07:43:02 am
I'm working using a private server behind my own router and firewall, so public access to the server is not available.  The CPG was formerly v1.3.x and upgraded to v1.4.x before upgrading to v1.5.x.  File version checking has been performed, and checking the database updates shows none were missed or failed.

I've read several other posts here in the bridging forum, and have edited my gallery/bridge/phpbb3.inc.php bridge file to define the administrators' and guests' groups.  When activating the bridge, the phpBB usernames are correctly associated with their CPG galleries, but CPG doesn't recognize my account as an Administrator, while phpBB does.  Looking into the database with phpMyAdmin, I browsed the phpbb3_groups table to obtain the Group_ID values used to patch the bridge include file.  But after activating the bridging, the Group_ID values I see in the cpg_groups table don't seem to match those from the phpBB forum.  Is this normal behavior? 

Also, when attempting to Login using bridged mode, CPG correctly routes me to the phpBB login page. But after the login, I'm returned to the phpBB forum page, and NOT in a logged in state.  I've read another post regarding the "Allow Guests to view thumbnails" configuration setting, and attempted it both ways, but logging in and linking to the photo gallery still fails to function properly.  I've cleared cookies, but this doesn't help. 
Title: Re: CPG 1.5.18 and phpBB 3.0.10 - bridging user groups - IDs don't match?
Post by: Caith on February 05, 2012, 01:34:33 pm
Now that I've had a bit of sleep, I can include documentation of the GROUP_ID values in both tables.  Hopefully this helps better explain my first question, above.  ;)
Code: [Select]
mysql> select group_id, group_name
    -> from phpbb3_groups
    -> where group_name IS NOT NULL;
+----------+---------------------------------+
| group_id | group_name                      |
+----------+---------------------------------+
|    11749 | GUESTS                          |
|    11750 | REGISTERED                      |
|    11751 | REGISTERED_COPPA                |
|    11752 | GLOBAL_MODERATORS               |
|    11753 | ADMINISTRATORS                  |
|    11754 | BOTS                            |
|    11755 | NEWLY_REGISTERED                |
+----------+---------------------------------+
7 rows in set (0.00 sec)

mysql> select group_id, group_name
    -> from cpg132_usergroups
    -> where group_name IS NOT NULL;
+----------+---------------------------------+
| group_id | group_name                      |
+----------+---------------------------------+
|    11849 | GUESTS                          |
|    11850 | REGISTERED                      |
|    11851 | REGISTERED_COPPA                |
|    11852 | GLOBAL_MODERATORS               |
|    11853 | ADMINISTRATORS                  |
|    11854 | BOTS                            |
|    11855 | NEWLY_REGISTERED                |
+----------+---------------------------------+
7 rows in set (0.00 sec)

Title: Re: CPG 1.5.18 and phpBB 3.0.10 - bridging user groups - IDs don't match?
Post by: Caith on February 05, 2012, 01:43:20 pm
Finally, here are the two lines I edited in the phpbb3.inc.php include file for bridging:

Code: [Select]
            // Group ids
            $this->admingroups = 11753;
            $this->guestgroup  = 11749;
Title: Re: CPG 1.5.18 and phpBB 3.0.10 - bridging user groups - IDs don't match?
Post by: Caith on February 05, 2012, 01:56:48 pm
I think I have resolved my issue, thankfully.  These applications have been setup on a Linux server, running the XAMPP (formerly LAMP) suite of software.  When I originally created the phpBB3 installation, I defined the cookies using the literal IP address of the server rather than a DNS host name.  After changing phpBB3 cookie configuration from the IP address value to the DNS host name, and clearing all cookies from my browser, the bridge now appears to be working correctly.  8)

Which corollary of Murphy's Law is this?  "It works better when you plug it in."  ::)
Title: Re: CPG 1.5.18 and phpBB 3.0.10 - bridging user groups - IDs don't match?
Post by: Caith on February 05, 2012, 04:40:54 pm
So, I unbridged the gallery from the forum, enabled debug information, and re-bridged them.  The debug information showed the Group_ID values from the phpBB3_users table are NOT what the bridge is using to identify users' groups in the gallery.  I changed the bridge array values to use the Group_ID from the cpg132_usergroups table, and now the debug info shows me as a member of the ADMINISTRATORS group, but doesn't display the "Enter Admin Mode" prompt to turn on the Admin Menu and functions. :(

Here's the array information from Debug Info.  What else could I be doing wrong?
Code: [Select]
USER:
------------------
Array
(
    [ID] => 6252f54bfa2cf3e21aa301e5ed079cd1
    [am] => 1
    [liv] => Array
        (
            [0] => 16
            [1] => 13
            [2] => 12
            [3] => 6215
            [4] => 4979
        )

)

==========================
USER DATA:
------------------
Array
(
    [user_id] => 4757
    [user_name] => Caith
    [groups] => Array
        (
            [0] => 11853
            [1] => 11848
            [2] => 1365
            [3] => 6554
            [4] => 11850
            [6] => 11852
        )

    [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] => 11853
    [allowed_albums] => Array
        (
        )

)
Title: Re: CPG 1.5.18 and phpBB 3.0.10 - bridging user groups - IDs don't match?
Post by: Caith on February 05, 2012, 06:54:47 pm
Finally, here are the two lines I edited in the phpbb3.inc.php include file for bridging:
Code: [Select]
            // Group ids
            $this->admingroups = 11753;
            $this->guestgroup  = 11749;
I noticed from the debug information that an argument was of the wrong type, so I revised one of these two lines in the bridge file to
Code: [Select]
            // Group ids
            $this->admingroups = array(11753);
            $this->guestgroup  = 11749;
and now the argument warning is gone, but after logging out and back in, I still can't get access to Admin Mode. :(
Title: Re: CPG 1.5.18 and phpBB 3.0.10 - bridging user groups - IDs don't match?
Post by: Caith on February 05, 2012, 09:22:04 pm
I realized after posting that I copied the original phpBB3 group_ID values into my last post. :(  Here are the correct, current values:
Code: [Select]
            // Group ids
            $this->admingroups = array(11853);
            $this->guestgroup  = 11849;

I used SQL commands to update some of the column values for the ADMINISTRATORS group_id, but still don't see the option to enter the Admin menu.  Can someone please tell me which column I should set, and to which value I should set it?  Thank you.
Code: [Select]
mysql> [b]select *[/b]
    -> [b]from cpg132_usergroups[/b]
    -> [b]where group_name='ADMINISTRATORS';[/b]
+----------+----------------+-------------+------------------+-------------------+-----------------+-------------------+---------------------+-------------------+-----------------------+------------------------+--------------+
| group_id | group_name     | group_quota | has_admin_access | can_rate_pictures | can_send_ecards | can_post_comments | can_upload_pictures | can_create_albums | pub_upl_need_approval | priv_upl_need_approval | access_level |
+----------+----------------+-------------+------------------+-------------------+-----------------+-------------------+---------------------+-------------------+-----------------------+------------------------+--------------+
|    11853 | ADMINISTRATORS |           0 |                3 |                 1 |               0 |                 1 |                   1 |                 1 |                     0 |                      0 |            3 |
+----------+----------------+-------------+------------------+-------------------+-----------------+-------------------+---------------------+-------------------+-----------------------+------------------------+--------------+
1 row in set (0.00 sec)
Title: Re: CPG 1.5.18 and phpBB 3.0.10 - bridging user groups - IDs don't match?
Post by: Caith on February 06, 2012, 12:25:53 am
Final post (at least until I do this upgrade with the live Production gallery and forum in several more weeks)  ;)

Reading the friendly manual at this link (http://documentation.coppermine-gallery.net/en/bridging.htm#integrating_individual_bridge_issues_start) indicated I should use the GROUP_ID values from the phpBB3 forum table, and NOT from the cpg_usergroups table.  Believe it or not, using those GROUP_ID values finally recognizes my administrator group membership.  8)  I'd guess the cookie naming issue I resolved earlier today is what caused most of the trouble, and I simply hadn't been back into edit the bridge file phpbb3.inc.php since resolving the cookies issue.

So after all this learning experience, I'm going to mark this one "solved" again.  Thanks for letting me work it out.  Just documenting it helps with the frustration, sometimes.  8)
Title: Re: CPG 1.5.18 and phpBB 3.0.10 - bridging user groups - IDs don't match?
Post by: lurkalot on February 06, 2012, 12:41:23 am
Thanks for coming back and giving us your findings.  Believe me if I could have helped I would have, but this is way over my head.

I'm sure others will find this information useful.  ;)