coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 bridging => Topic started by: Andrei on July 25, 2006, 10:10:43 AM

Title: Bridging Coppermine with Mambo
Post by: Andrei on July 25, 2006, 10:10:43 AM
Hey,
I tried to bridge Coppermine and Mambo, both previously installed on my server, by using the Mambo server wizard in Coppermine. Bridging did not show any errors, and after that, by clicking on LOGIN or REGISTER in Coppermine, people get sent to the correct pages in Mambo.
However, after you log on in mambo, you don't get logged on in Coppermine! Is there something I don't understand about the way this should work?

Coppermine install: http://www.habitatcluj.ro/foto/
Forum install: http://www.habitatcluj.ro/   (in root directory)
Coppermine version: cpg1.4.8
Forum version: mambo 4.5.4
Test user account: <removed>

BridgeManager settings:
Forum URL:  http://www.habitatcluj.ro
Relative path to your BBS's config file:  ../
Use post-based groups?:  1
Title: Re: Bridging Coppermine with Mambo
Post by: SLC on July 28, 2006, 07:15:03 PM
I did an install yesterday and I'm having the same exact problem.  I tried messing around with the mambo.inc.php file and I think the problem is somehow it's not getting the correct session id from the session cookie and therefore when it goes to the sessions table in mambo to look for the user it comes back empty.  I've done quite a bit of coding in mambo so that how I figured that out, but I'm not quite sure how to correct this issue.
Title: Re: Bridging Coppermine with Mambo
Post by: Joachim Müller on July 28, 2006, 07:29:41 PM
When requesting bridge support - mandatory! (http://forum.coppermine-gallery.net/index.php?topic=24032.0)
Title: Re: Bridging Coppermine with Mambo
Post by: SLC on July 28, 2006, 08:19:03 PM
I have the following issue when trying to bridge coppermine and Mambo:
Log in to mambo successfully, but right afterwords when I go to the compermine page I lose all user credintials.

Site info removed.
Title: Re: Bridging Coppermine with Mambo
Post by: SLC on July 30, 2006, 07:12:30 PM
At this point I'm guessing no one in the Coppermine community knows the answer to this problem.  If so, I'd just like to know that so that I can continue searching for a photo gallery software on coppermine's level that will integrate with mambo.

Thanks.
Title: Re: Bridging Coppermine with Mambo
Post by: Nibbler on July 30, 2006, 07:24:08 PM
There might be a problem with the bridge file, I'll check it tonight.
Title: Re: Bridging Coppermine with Mambo
Post by: Nibbler on July 30, 2006, 10:56:41 PM
OK, there was an issue with the file. I think the mambo code has changed since the bridge for it was created but luckily there is an easy fix.

bridge/mambo.inc.php, locate


$sessioncookie = $_COOKIE['sessioncookie'];


and change to


$sessionCookieName = md5( 'site'.$this->boardurl);
$sessioncookie = $_COOKIE[$sessionCookieName];



Just like that!
Title: Re: Bridging Coppermine with Mambo
Post by: SLC on July 31, 2006, 01:42:59 AM
I made the change, but it still loses the user's credentials. 

In the mambo.inc.php file there's a line that queries mambo's session table to get the userid using the $sessioncookie variable.  I monitored the sessions table in my database, then echo'd the md5'd output of the $sessioncookie variable after making the change above and it does not match the session_id in the session table for the username I logged into mambo under, therefore when the query executes it comes back empty.  This happend with the original file and also with the file once I made the suggested changes.  Any other ideas on what to do?

Thanks.
Title: Re: Bridging Coppermine with Mambo
Post by: SLC on July 31, 2006, 01:51:07 AM
Actually, after implementing the change the sessioncookie comes back blank.  Before the change it came back with something although after md5'ing the id it didn't match what was in the table.
Title: Re: Bridging Coppermine with Mambo
Post by: Nibbler on July 31, 2006, 01:52:06 AM
Make sure you have the exact same url entered in both the bridge manager and mambo.
Title: Re: Bridging Coppermine with Mambo
Post by: SLC on July 31, 2006, 02:30:49 AM
It took a while but I figured it out.

It should be:
$sessioncookie = $_COOKIE['sessioncookie'];
$sessioncookie = $sessioncookie. $_SERVER['SERVER_ADDR'];

I found this out by observing how mambo sets the session_id in the mambo.php file.

Hope this helps everyone who come accross this issue.

SLC
Title: Re: Bridging Coppermine with Mambo
Post by: Nibbler on July 31, 2006, 02:43:17 AM
Are you using mambo 4.5.4 ?
Title: Re: Bridging Coppermine with Mambo
Post by: Andrei on August 05, 2006, 03:29:03 PM
Thank you, Nibbler!

I modified the code with the one you provided and everything works as expected.
I log on on the main page, and when I go to the gallery, I am also logged on and can work as admin.

Thanks again.
(I will modify my original post now, to remove the personal / site info)