Trouble with PHPbb integration Trouble with PHPbb integration
 

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

Trouble with PHPbb integration

Started by XSTence, June 20, 2005, 06:09:58 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

XSTence

Hi all,

I'm having trouble getting the Coppermine <> phpbb integration to work. Basically, when I'm first logged onto the forum, then going to Coppermine, all is well. But, we are setting up a portal using the Subdreamer (SD) CMS. SD is integrated with the forum DB and this works without any issues whatsoever. Basically, users will come to the portal URL, log in and use the forum and Coppermine from the dropdown menu. Doing this results in the well-known "serialize..." error. But I can't seem to figure out why it's working, when logging first in to the forum.

When people log in to the portal (Subdreamer), they are automatically logged into the forum and vice-versa without any issues.

account: test
pass: test

domain: yourhobby.nl
Forum: phpbb V2.0.15 ( on database richard_phpbb3 ) http://www.yourhobby.nl/forumorgel/index.php
Coppermine 1.3.3 ( on database richard_portalgallery ) http://www.yourhobby.nl/portal/gallery/index.php
CMS: Subdreamer ( on database richard_organportal ) http://www.yourhobby.nl/portal/

Cookies: differently named for gallery and portal - have seen and tried all posts already on this.

So, I must be missing something, but what...

Any help much appreciated !

My best - Rick



Nibbler

Coppermine and phpbb should be in the same database, as stated in the docs.

XSTence

Yep - I know - but that didn't work either (was my original setup) - I can switch over quite easily  be re-running install and this results in the same behaviour.

I'd suspect there are somehow cookie-issues, even though they are all name differently - I do see the cookies being stored under the given names so on the surface it looks fine.


I've just resetted the database over to the phpbb3 DB the forum uses - as said - the behaviour is the same - I'm not logged in to Coppermine after logging in to Subdreamer and the forum.

Are there any specifics I can check or test or you need more info from me

Nibbler

I logged into your forum as test/test and was recognised by Coppermine. Seems OK to me.

XSTence

Maybe I did not explain it right:

This is how it is supposed to work:

Log on to the Subdreamer CMS http://www.yourhobby.nl/portal/ (which is as the portal integrated with the phpbb for user/group accounts). You then can use the forum without issues, but you can not use Coppermine (under the drop-down menu "Downloads - Photo Archive" since it does not recognize anyone being logged in. Very strange since the forum at that point has no issues and it shows you being logged in.

But - when I go straight to the link of the forum http://www.yourhobby.nl/forumorgel/index.php log on there, and go to the direct link of Coppermine - Coppermine does recognize the user.

Thanks a bunch for the replies - boy - that's quick  ;)

XSTence

#5
hi Nibbler - send you a PM with ftp-details just in case.

just so you know - deleted cookies - even threw the cookie jar out - no luck as of yet. Hope we can get it sorted out - because after looking and trying the Menalto gallery, Coppermine is the way to go for us - it's that simple.

One more (maybe) hint: when I am at the direct URL of Coppermine ( http://www.yourhobby.nl/portal/gallery/index.php ), logging in as said works via the forum, but when I'm logging off from  the Coppermine screen I'm rewarded with the "serialize..." error at the top of the screen (and am logged out then). I can't help but think there is some relation here, as this is the same prob. we get via our portal front end (serialize error). I understand this is a somewhat complex setup, so I have some patience. I'm hoping we can fix this before going live this Wednesday or we might postpone things since Coppermine is crucial to us. Thanks for all the help !

my best - Rick

Nibbler

The portal uses a different serialisation method to phpbb to avoid the previous security issue with unserialise(). I've now modified the bridge file to attempt to decode the cookie using both methods.

XSTence

Great stuff !!  ;D ;D

So why is it Coppermine is free, people in here can fix something within about an hour and the product is free to us...  ;D

I'm speechless - fixed and running beautifully.

A tremendous thanks for this unbelievable support ! ! !

for the record: Nibbler took a look at our files and discovered our CMS uses a different serialization method and changed the bridge file.

My very best - Rick

psychosematic

Would you be able to post a fix for this Nibbler? As am I havving the same issues.

TIA!
-psychosematic

Nibbler

Add this function into the bridge file

function unserialize_array($str) 

   $array = array(); 
   $list = explode('|', $str); 
   for($i=0; $i<count($list); $i++) 
   { 
       $row = explode('=', $list[$i], 2); 
       if(count($row) == 2) 
       { 
           $array[$row[0]] = $row[1]; 
       } 
   } 
   return $array; 
}


find:

$sessiondata = unserialize($HTTP_COOKIE_VARS[PHPBB_COOKIE_PREFIX . '_data']);

change to


// First try phpbb unserialisation method
$sessiondata = @unserialize($HTTP_COOKIE_VARS[PHPBB_COOKIE_PREFIX . '_data']);

// Then try portal unserialisation method
if (!is_array($sessiondata)) $sessiondata = unserialize_array($HTTP_COOKIE_VARS[PHPBB_COOKIE_PREFIX . '_data']);

psychosematic

Quote from: Nibbler on September 22, 2005, 09:03:31 AM
Add this function into the bridge file

function unserialize_array($str) 

   $array = array(); 
   $list = explode('|', $str); 
   for($i=0; $i<count($list); $i++) 
   { 
       $row = explode('=', $list[$i], 2); 
       if(count($row) == 2) 
       { 
           $array[$row[0]] = $row[1]; 
       } 
   } 
   return $array; 
}


find:

$sessiondata = unserialize($HTTP_COOKIE_VARS[PHPBB_COOKIE_PREFIX . '_data']);

change to


// First try phpbb unserialisation method
$sessiondata = @unserialize($HTTP_COOKIE_VARS[PHPBB_COOKIE_PREFIX . '_data']);

// Then try portal unserialisation method
if (!is_array($sessiondata)) $sessiondata = unserialize_array($HTTP_COOKIE_VARS[PHPBB_COOKIE_PREFIX . '_data']);


Thank you for your response Nibbler! It works! ;) Thank you again!