Advanced search  

News:

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

Pages: [1]   Go Down

Author Topic: phpBB 2.0.18 New session handling  (Read 7700 times)

0 Members and 1 Guest are viewing this topic.

Joe Belmaati

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 65
    • http://www.belmaati.com
phpBB 2.0.18 New session handling
« on: October 31, 2005, 06:50:11 am »

Hello,
is there ahack that will adapt the bridge-file/integration with phpBB to accommodate the newly imposed changes to phpBBs session handling? Right now I can't log in as an administrator, nor can anyone else log in - even though they are logged in to phpBB.
Sincerely,
Joe Belmaati
« Last Edit: November 01, 2005, 05:38:03 pm by Nibbler »
Logged

Joe Belmaati

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 65
    • http://www.belmaati.com
Re: phpBB 2.0.18 New session handling
« Reply #1 on: October 31, 2005, 09:39:20 am »

A temporary fix is to de-select auto login for phpBB. However, a permanent fix would be desirable. I will try to mess with this myself.
Sincerely,
Joe
Logged

Joe Belmaati

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 65
    • http://www.belmaati.com
Re: phpBB 2.0.18 New session handling
« Reply #2 on: October 31, 2005, 09:59:57 am »

Hello again,
here's a temporary hack that will work regardless of user settings. The idea is to use the sessiosn table regardless of user cookie settings.

OPEN

bridge/phpbb.inc.php

FIND

Code: [Select]
    if ($cookie_uid && !$cookie_pass && isset($HTTP_COOKIE_VARS[PHPBB_COOKIE_PREFIX . '_sid'])) {
REPLACE WITH

Code: [Select]
//     if ($cookie_uid && !$cookie_pass && isset($HTTP_COOKIE_VARS[PHPBB_COOKIE_PREFIX . '_sid'])) {
FIND

Code: [Select]
        $sql = "SELECT user_id, username as user_name, user_level " . "FROM " . $UDB_DB_NAME_PREFIX . PHPBB_TABLE_PREFIX . PHPBB_SESSION_TABLE . " " . "INNER JOIN " . $UDB_DB_NAME_PREFIX . PHPBB_TABLE_PREFIX . PHPBB_USER_TABLE . " ON session_user_id = user_id " . "WHERE session_id='$session_id' AND session_user_id ='$cookie_uid' AND user_active='1'";
    }

REPLACE WITH

Code: [Select]
        $sql = "SELECT user_id, username as user_name, user_level " . "FROM " . $UDB_DB_NAME_PREFIX . PHPBB_TABLE_PREFIX . PHPBB_SESSION_TABLE . " " . "INNER JOIN " . $UDB_DB_NAME_PREFIX . PHPBB_TABLE_PREFIX . PHPBB_USER_TABLE . " ON session_user_id = user_id " . "WHERE session_id='$session_id' AND session_user_id ='$cookie_uid' AND user_active='1'";
//     }

FIND

Code: [Select]
else {
        $sql = "SELECT user_id, username as user_name, user_level " . "FROM " . $UDB_DB_NAME_PREFIX . PHPBB_TABLE_PREFIX . PHPBB_USER_TABLE . " " . "WHERE user_id='$cookie_uid' AND user_password='$cookie_pass' AND user_active='1'";
    }

REPLACE WITH

Code: [Select]
/* else {
        $sql = "SELECT user_id, username as user_name, user_level " . "FROM " . $UDB_DB_NAME_PREFIX . PHPBB_TABLE_PREFIX . PHPBB_USER_TABLE . " " . "WHERE user_id='$cookie_uid' AND user_password='$cookie_pass' AND user_active='1'";
    }*/
Logged

laubert

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 42
Re: phpBB 2.0.18 New session handling
« Reply #3 on: November 01, 2005, 09:58:07 am »

Thank you dor theses ideas.

A temporary fix is to de-select auto login for phpBB.
It doesn't work for me  :(  : "invalid session" when I disconnect.


What do CPG bridges coders think about the new phpbb.inc.php, posted by Joe ?
Logged

Joe Belmaati

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 65
    • http://www.belmaati.com
Re: phpBB 2.0.18 New session handling
« Reply #4 on: November 01, 2005, 10:05:43 am »

Thanks for the reply, laubert
as stated in my post the fix is temporary and works on my site. I don't get the session error when logging out. My problem was that logging into phpbb did not log me into coppermine. With the hack I posted it now works. Not really sure why you would get the session error, as using the session table as per my hack would equate to handling a user that doesn't allow cookies.
Logged

littleking

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
Re: phpBB 2.0.18 New session handling
« Reply #5 on: November 01, 2005, 02:49:45 pm »

WORKS GREAT!  but... if it hit logon in cpg i get:

Notice: Undefined index: huntforums_sid in /home/httpd/vhosts/huntohio.net/httpdocs/gallery/bridge/phpbb.inc.php on line 103


line 103 =         $session_id = addslashes($HTTP_COOKIE_VARS[PHPBB_COOKIE_PREFIX . '_sid']);
Logged

jaybrain

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: phpBB 2.0.18 New session handling
« Reply #6 on: November 01, 2005, 04:28:51 pm »

I just updated to 2.0.18 today, and I'm using the most recent version on cpg.  Cleared cookies, and still doesn't show me as logged in with cpg when using firefox, but logs me in with IE.  I get invalid session when I log out with IE.
Logged

Nibbler

  • Guest
Re: phpBB 2.0.18 New session handling
« Reply #7 on: November 01, 2005, 05:38:46 pm »

Logged
Pages: [1]   Go Up
 

Page created in 0.015 seconds with 15 queries.