Version 2.0.18 uses different session management then version 2.0.17. The module stopped working when I upgraded to 2.0.18.

Comments

arkepp’s picture

Assigned: Unassigned » arkepp
Priority: Critical » Normal

I will have to look into it next week (hopefully, or over the holidays), I didn't see the change right away.

brdwor’s picture

I confirm that the current cvs version of the module does not work completely with 2.0.18. When a user logs into drupal, that user shows up as logged in to phpbb2, but when you go to the forum it does not login the user from the cookie.

arkepp’s picture

Hopefully I can release a new version for Xmas. The diff below appears to work on phpBB 2.0.18 (uses the new session key system), but I need to test it for a few more days and clean up some old junk in the code. (Don't mind the version, it'll be version 0.4.0, and I'm going to include some profile stuff also).

2c2
< // $Id: phpbb.module,v 0.3.0 2005/09/16 01:57:00 arkepp Exp $
---
> // $Id: phpbb.module,v 1.2 2005/12/04 17:32:12 arkepp Exp $
94c94
<
---
>
118d117
< $session_key = uniqid(mt_rand(), true);
120,121c119,120
< _phpbb_insert_db_session($phpbb_dbc, $prefix, 0, $session_key);
< _phpbb_set_cookies($phpbb_cookie_name, $session_key);
---
> _phpbb_insert_db_session($phpbb_dbc, $prefix);
> _phpbb_set_cookies($phpbb_cookie_name);
273c272
< function _phpbb_insert_db_session(&$phpbb_dbc, $prefix, $admin_access, $session_key) {
---
> function _phpbb_insert_db_session(&$phpbb_dbc, $prefix, $admin_access = 0) {
285,294d283
<
< // Check whether this is 2.0.18 or newer
< //$phpbb_query = "show tables like '%sessions_keys'";
< //$result = mysql_query($phpbb_query, $phpbb_dbc) or die('Query failed: ' . mysql_error() . " \n" . $phpbb_query . "\n");
< //if( mysql_num_rows > 0) {
< $phpbb_query = "INSERT INTO " . $prefix . "sessions_keys(`key_id`,`user_id`,`last_ip`,`last_login`) "
< . "VALUES('" . md5($session_key) . "'," . $user->uid . ",'" . _phpbb_encoded_client_ip() . "'," . time() . ")";
< $result = mysql_query($phpbb_query, $phpbb_dbc) or die('Query failed: ' . mysql_error() . " \n" . $phpbb_query . "\n");
< //}
<
304,305c293
< function _phpbb_set_cookies($phpbb_cookie_name, $session_key) {
< //Check for version!
---
> function _phpbb_set_cookies($phpbb_cookie_name) {
310c298
< $sessiondata['autologinid'] = $session_key;
---
> $sessiondata['autologinid'] = $user->pass;

arkepp’s picture

Status: Active » Fixed

Should be okay in latest version (which requires Drupal 4.6.x and phpBB 2.0.18).

Anonymous’s picture

Status: Fixed » Closed (fixed)