phpBB2 2.0.11 with cpg132 integration problem...Notice: unserialize(): Error at. phpBB2 2.0.11 with cpg132 integration problem...Notice: unserialize(): Error at.
 

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]

Main Menu

phpBB2 2.0.11 with cpg132 integration problem...Notice: unserialize(): Error at.

Started by ludedude, January 23, 2005, 09:22:41 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ludedude

PHP Version 4.3.10
cpg version 132, fresh install
phpbb2 version 2.0.11
http://www.atvans.net/forum/index.php
http://www.atvans.net/cpg132/index.php

test account: ronald   testit

debug info

USER:
------------------
Array
(
   [ID] => ccb7b856b85db1e6bcb5b12e929828f6
   [am] => 1
)

==========================
USER DATA:
------------------
Array
(
   [user_id] => 1
   [user_group] => 1
   [user_active] => YES
   [user_name] => ludedude
   [user_password] => ********
   [user_lastvisit] => 2005-01-30 16:28:45
   [user_regdate] => 2005-01-30 16:13:06
   [user_group_list] =>
   [user_email] =>
   [user_website] =>
   [user_location] =>
   [user_interests] =>
   [user_occupation] =>
   [user_actkey] =>
   [disk_max] => 0
   [disk_min] => 0
   [can_rate_pictures] => 1
   [can_send_ecards] => 1
   [ufc_max] => 3
   [ufc_min] => 3
   [custom_user_upload] => 0
   [num_file_upload] => 5
   [num_URI_upload] => 3
   [can_post_comments] => 1
   [can_upload_pictures] => 1
   [can_create_albums] => 1
   [has_admin_access] => 1
   [pub_upl_need_approval] => 0
   [priv_upl_need_approval] => 0
   [group_name] => Administrators
   [upload_form_config] => 3
   [group_quota] => 0
   [can_see_all_albums] => 1
   [group_id] => 1
   [groups] => Array
       (
           [1] => 1
       )

)

==========================
Queries:
------------------
Array
(
   [0] => SELECT extension, mime, content FROM cpg132_filetypes;
   [1] => SELECT * FROM cpg132_users WHERE user_id='1'AND user_active = 'YES' AND user_password != '' AND BINARY MD5(user_password) = '2af44799798b55e006f45a9527f03168'
   [2] => SELECT MAX(group_quota) as disk_max, MIN(group_quota) as disk_min, MAX(can_rate_pictures) as can_rate_pictures, MAX(can_send_ecards) as can_send_ecards, MAX(upload_form_config) as ufc_max, MIN(upload_form_config) as ufc_min, MAX(custom_user_upload) as custom_user_upload, MAX(num_file_upload) as num_file_upload, MAX(num_URI_upload) as num_URI_upload, MAX(can_post_comments) as can_post_comments, MAX(can_upload_pictures) as can_upload_pictures, MAX(can_create_albums) as can_create_albums, MAX(has_admin_access) as has_admin_access, MIN(pub_upl_need_approval) as pub_upl_need_approval, MIN( priv_upl_need_approval) as  priv_upl_need_approval FROM cpg132_usergroups WHERE group_id in (1)
   [3] => SELECT group_name FROM  cpg132_usergroups WHERE group_id= 1
   [4] => DELETE FROM cpg132_banned WHERE expiry < 1107120723
   [5] => SELECT * FROM cpg132_banned WHERE ip_addr='141.119.184.10' OR ip_addr='141.119.184.10' OR user_id=1
   [6] => SELECT cid, name, description, thumb FROM cpg132_categories WHERE parent = ''  ORDER BY pos
   [7] => SELECT aid FROM cpg132_albums as a WHERE category>=10000
   [8] => SELECT count(*) FROM cpg132_pictures as p, cpg132_albums as a WHERE p.aid = a.aid AND category >= 10000
   [9] => SELECT cid, name, description, thumb FROM cpg132_categories WHERE parent = '1'  ORDER BY pos
   [10] => SELECT aid FROM cpg132_albums as a WHERE category = '0'
   [11] => SELECT count(*) FROM cpg132_albums as a WHERE 1
   [12] => SELECT count(*) FROM cpg132_pictures as p LEFT JOIN cpg132_albums as a ON a.aid=p.aid WHERE 1
   [13] => SELECT count(*) FROM cpg132_comments as c LEFT JOIN cpg132_pictures as p ON c.pid=p.pid LEFT JOIN cpg132_albums as a ON a.aid=p.aid WHERE 1
   [14] => SELECT count(*) FROM cpg132_categories WHERE 1
   [15] => SELECT sum(hits) FROM cpg132_pictures as p LEFT JOIN cpg132_albums as a ON p.aid=a.aid WHERE 1
   [16] => SELECT count(*) FROM cpg132_albums as a WHERE category = '0'
   [17] => SELECT COUNT(*) from cpg132_pictures WHERE approved = 'YES'
   [18] => SELECT pid, filepath, filename, url_prefix, filesize, pwidth, pheight, ctime, aid, aid FROM cpg132_pictures WHERE approved = 'YES'  ORDER BY RAND() LIMIT 8
   [19] => SELECT COUNT(*) from cpg132_pictures WHERE approved = 'YES'
   [20] => SELECT pid, filepath, filename, url_prefix, filesize, pwidth, pheight, ctime, aid,title, caption, owner_id, owner_name, aid FROM cpg132_pictures WHERE approved = 'YES'  ORDER BY pid DESC  LIMIT 0 ,8
)

==========================
GET :
------------------
Array
(
)

==========================
POST :
------------------
Array
(
)

==========================
VERSION INFO :
------------------
PHP version: 4.3.10 - OK
------------------
mySQL version: 4.0.22-standard
------------------
Coppermine version: 1.3.2
==========================
Module: gd
------------------
GD Support enabled
GD Version bundled (2.0.28 compatible)
GIF Read Support enabled
GIF Create Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled
XBM Support enabled
==========================
Module: mysql
------------------
Active Persistent Links 0
Active Links 1
Client API version 3.23.49
MYSQL_MODULE_TYPE builtin
MYSQL_SOCKET /var/tmp/mysql.sock
MYSQL_INCLUDE no value
MYSQL_LIBS no value
==========================
Module: zlib
------------------
ZLib Support enabled
Compiled Version 1.1.4
Linked Version 1.1.4
==========================
Server restrictions (safe mode)?
------------------
Directive | Local Value | Master Value
safe_mode | Off | Off
safe_mode_exec_dir | no value | no value
safe_mode_gid | Off | Off
safe_mode_include_dir | no value | no value
safe_mode_exec_dir | no value | no value
sql.safe_mode | Off | Off
disable_functions | no value | no value
file_uploads | On | On
include_path | .:/usr/lib/php:/usr/local/lib/php | .:/usr/lib/php:/usr/local/lib/php
open_basedir | /home/atvans1/:/usr/lib/php:/usr/local/lib/php:/tmp | no value
==========================
email
------------------
Directive | Local Value | Master Value
sendmail_from | no value | no value
sendmail_path | /usr/sbin/sendmail -t -i | /usr/sbin/sendmail -t -i
SMTP | localhost | localhost
smtp_port | 25 | 25
==========================
Size and Time
------------------
Directive | Local Value | Master Value
max_execution_time | 30 | 30
max_input_time | -1 | -1
upload_max_filesize | 2M | 2M
post_max_size | 55M | 55M
==========================
Page generated in 0.056 seconds - 21 queries in 0.005 seconds - Album set :


If I set:
define('PHPBB_COOKIE_PREFIX', 'atvans_'); // The prefix used for board cookies like so atvans_ (notice the underscore) I get no errors, bit no log in to cpg either, redirected there, but no log in

if I remove the underscore I get this error, plus no login, redirected, but not logged in

Notice: unserialize(): Error at offset 0 of 21 bytes in /home/atvans1/public_html/copper132/bridge/phpbb.inc.php on line 90

login on it's on works fine.....

phpbbs Script path: /forum/
Cookie domain: atvans.net
Cookie name: atvans
Cookie path: /

redirect file:
<?php
if (!$_SERVER['HTTP_HOST']) {
  
$cpg_host=$HTTP_SERVER_VARS['HTTP_HOST'];
} else {
  
$cpg_host=$_SERVER['HTTP_HOST'];
}
$cpg_path='/cpg132';
header("Location: http://".$cpg_host.$cpg_path);
exit;
?>


phpbb.inc.php (line 90 is noted)

// database configuration
define('PHPBB_DB_NAME', 'atvans1_forum'); // The name of the database used by the board
define('PHPBB_BD_HOST', 'localhost'); // The name of the database server
define('PHPBB_DB_USERNAME', '*****'); // The username to use to connect to the database
define('PHPBB_DB_PASSWORD', '*****'); // The password to use to connect to the database

// The web path to your phpBB directory
// If your URL to your board is for example 'http://yoursite_name.com/phpBB2/',
// you'll have to set the below var to '/phpBB2/'.
define('PHPBB_WEB_PATH', '/forum/');
// Logout Flag
// the value of this boolean constant depends on your phpBB version:
// If your version of phpBB is 2.0.4 or lower - change the value to FALSE;
// if your version of phpBB is 2.0.5 or newer - leave it as TRUE
define('PHPBB_LOGOUT_GET', TRUE);
// ------------------------------------------------------------------------- //
// You can keep the default values below if your instalation is standard
// ------------------------------------------------------------------------- //
// The prefix for the phpBB cookies
define('PHPBB_COOKIE_PREFIX', 'atvans_'); // The prefix used for board cookies

// Prefix and names for the database tables
define('PHPBB_TABLE_PREFIX', 'phpbb_'); // The prefix used for the DB tables
define('PHPBB_USER_TABLE', 'users'); // The members table
define('PHPBB_SESSION_TABLE', 'sessions'); // The session table
define('PHPBB_GROUP_TABLE', 'groups'); // The groups table
define('PHPBB_UGROUP_TABLE', 'user_group'); // The group/user table

// ------------------------------------------------------------------------- //
// Nothing to edit below this line
// ------------------------------------------------------------------------- //
// Group definitions
define('PHPBB_ADMIN_GROUP', 1);
define('PHPBB_MEMBERS_GROUP', 2);
define('PHPBB_GUEST_GROUP', 3);
define('PHPBB_BANNED_GROUP', 4);
// Authenticate a user using cookies
function udb_authenticate()
{
   global $HTTP_COOKIE_VARS, $USER_DATA, $UDB_DB_LINK_ID, $UDB_DB_NAME_PREFIX, $CONFIG;
   // For error checking
   $CONFIG['TABLE_USERS'] = '**ERROR**';

   $default_group = array('group_id' => PHPBB_GUEST_GROUP,
       'group_name' => 'Unknown',
       'has_admin_access' => 0,
       'can_send_ecards' => 0,
       'can_rate_pictures' => 0,
       'can_post_comments' => 0,
       'can_upload_pictures' => 0,
       'can_create_albums' => 0,
       'pub_upl_need_approval' => 1,
       'priv_upl_need_approval' => 1,
       'upload_form_config' => 0,
       'custom_user_upload' => 0,
       'num_file_upload' => 0,
       'num_URI_upload' => 0,
       'has_admin_access' => 0,
       'can_see_all_albums' => 0,
       'groups' => array (PHPBB_GUEST_GROUP)
       );
   // Retrieve cookie stored login information
   if (!isset($HTTP_COOKIE_VARS[PHPBB_COOKIE_PREFIX . '_data'])) {
       $cookie_uid = 0;
       $cookie_pass = '*';
   } else {
line 90 ---------        $sessiondata = unserialize($HTTP_COOKIE_VARS[PHPBB_COOKIE_PREFIX . '_data']); --------



Hope this is all the info anyone needs to help me out.Thanks in advance.

http://www.p-o-ps.com  http://www.atvans.net

ludedude

// database configuration
define('PHPBB_DB_NAME', 'atvans1_forum'); // The name of the database used by the board
define('PHPBB_BD_HOST', 'localhost'); // The name of the database server
define('PHPBB_DB_USERNAME', 'atvans1'); // The username to use to connect to the database
define('PHPBB_DB_PASSWORD', 'password'); // The password to use to connect to the database

// The web path to your phpBB directory
// If your URL to your board is for example 'http://yoursite_name.com/phpBB2/',
// you'll have to set the below var to '/phpBB2/'.
define('PHPBB_WEB_PATH', 'http://www.atvans.net/forum/');
// Logout Flag
// the value of this boolean constant depends on your phpBB version:
// If your version of phpBB is 2.0.4 or lower - change the value to FALSE;
// if your version of phpBB is 2.0.5 or newer - leave it as TRUE
define('PHPBB_LOGOUT_GET', TRUE);
// ------------------------------------------------------------------------- //
// You can keep the default values below if your instalation is standard
// ------------------------------------------------------------------------- //
// The prefix for the phpBB cookies
define('PHPBB_COOKIE_PREFIX', 'atvans'); // The prefix used for board cookies

// Prefix and names for the database tables
define('PHPBB_TABLE_PREFIX', 'phpbb_'); // The prefix used for the DB tables
define('PHPBB_USER_TABLE', 'users'); // The members table
define('PHPBB_SESSION_TABLE', 'sessions'); // The session table
define('PHPBB_GROUP_TABLE', 'groups'); // The groups table
define('PHPBB_UGROUP_TABLE', 'user_group'); // The group/user table


phpbb2 script path  /forum/
cookie domain    atvans.net
cookie name   atvans
cookie path    /

coppermine cookie     cpg131
path                          /



<?php
if (!$_SERVER['HTTP_HOST']) {
  
$cpg_host=$HTTP_SERVER_VARS['HTTP_HOST'];
} else {
  
$cpg_host=$_SERVER['HTTP_HOST'];
}
$cpg_path='/coppermine';
header("Location: http://".$cpg_host.$cpg_path);
exit;
?>


http://www.atvans.net/coppermine/index.php
http://www.atvans.net/forum/index.php

Please help...I'm pulling my hair out on this.....I had it working months ago...had to turn it off due to members not liking what eas being posted....no they want it back and I can't get the integration working naymore  >:(
http://www.p-o-ps.com  http://www.atvans.net

Nibbler

Use an actual path for 'PHPBB_WEB_PATH' and post a test user account.

ludedude

define('PHPBB_WEB_PATH', 'http://www.atvans.net/forum/');

Isn't that right?

account: ronald
pass: testit
http://www.p-o-ps.com  http://www.atvans.net

Joachim Müller

that's a url - a path is something else. In your case, it should bedefine('PHPBB_WEB_PATH', '/forum/');. Make sure you understand the concept: a URL (or, more correctly URI) is a Uniform Resource Locator - the stuff you see in the address bar in your browser. A path can be relative or absolute, and is something that is used within the filesystem on your webserver.

Joachim

ludedude

still get this:

Notice: unserialize(): Error at offset 0 of 21 bytes in /home/atvans1/public_html/coppermine/bridge/phpbb.inc.php on line 83

line 83 is:

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

It redirects me to coppermine on login..but does not log me in, and has that error at the top of the screen :-\\
http://www.p-o-ps.com  http://www.atvans.net

Joachim Müller

Did you update your phpbb version and PHP (together with the zend optimizer) as suggested to avoid the security vulnerability? It appears you haven't - you seem to still be running phpbb 2.0.10! Upgrade asap, this is really serious!
Reference:
http://forum.coppermine-gallery.net/index.php?topic=12838.0
http://forum.coppermine-gallery.net/index.php?topic=12869.0
http://forum.coppermine-gallery.net/index.php?topic=12954.0

Joachim

ludedude

upgraded to 2.0.11 just had to do a lot of modding to get it to update with all my mods.....version changed now ;)

now about the login errors ????
http://www.p-o-ps.com  http://www.atvans.net

Joachim Müller

can't test - your gallery is currently offline.

Joachim

ludedude

#9
sorry...online now
http://www.p-o-ps.com  http://www.atvans.net

ludedude

http://www.p-o-ps.com  http://www.atvans.net


ludedude

hmm.....so what are you trying to point out?
In repsonse to the points in the link you posted:

I haven't waited long enough for a response? Sorry, there were initial responses, so....
It's a mod that has been around for a long time...I wouldn't have thought my issue has an unknown solution
I've looked for a solution...but to the best of my knowledge I've checked everything that has been mentioned
Didn't think my posting was rude or impolite...again, it was responded to initially
This does not require new coding

I've had this integration working before, it's nothing new, I'm just missing something, or something has changed with my phpbb upgrades, or...I dunno, was hoping a fresh set of eyes could help.

I even tried a new coppermine install, same thing.....so dopes that narrow it down to my phpbb??

Thanks in advance for any help ;)




http://www.p-o-ps.com  http://www.atvans.net

ludedude

post/title re-written, first post should contain all the needed info, I hope, for someone to help me out.
http://www.p-o-ps.com  http://www.atvans.net

ludedude

http://www.p-o-ps.com  http://www.atvans.net

jason

had the same issue when i installed as standalone (seperate sql database) and attempted to integrate into phpbb.  you need to remove the install lock file and run the install.php file again, this time use your phpbb database and whatever table prefix you want (like cpg_) for the cpg related tables.

this step is not in the installation docs and is a missing step if you follow it to a "T".
jason

garconcn

i have the same problem here:http://www.garconcn.com/gallery/index.php

Quote// database configuration
define('PHPBB_DB_NAME', 'garconcn_phpbb1'); // The name of the database used by the board
define('PHPBB_BD_HOST', 'localhost'); // The name of the database server
define('PHPBB_DB_USERNAME', 'garconcn_phpbb1'); // The username to use to connect to the database
define('PHPBB_DB_PASSWORD', 'hidden'); // The password to use to connect to the database

// The web path to your phpBB directory
// If your URL to your board is for example 'http://yoursite_name.com/phpBB2/',
// you'll have to set the below var to '/phpBB2/'.
define('PHPBB_WEB_PATH', '/bbs/');
// Logout Flag
// the value of this boolean constant depends on your phpBB version:
// If your version of phpBB is 2.0.4 or lower - change the value to FALSE;
// if your version of phpBB is 2.0.5 or newer - leave it as TRUE
define('PHPBB_LOGOUT_GET', TRUE);

Joachim Müller

you disabled bridging, so I can't take a look. It's helpfull to post a test user account (non-admin) when requesting help on bridging issues.

Joachim

MetalHellsAngel

I Seem to be having the same problem which is strange because it never happend before. However I did notice that the problem did not occure until after I ugraded to phpbb 2.0.14 It appears to be an error with phpbb.inc.php and the way it handles session managment, though I have no idea on how to fix it I'm just guessing.  The error is reported as happening on line 90 of phpbb.inc.php

http://thefileserver.myftp.org/Ftp/gallery/index.php

Test Account: Testing
Test Account Pass: Test

// Authenticate a user using cookies
function udb_authenticate()
{
   global $HTTP_COOKIE_VARS, $USER_DATA, $UDB_DB_LINK_ID, $UDB_DB_NAME_PREFIX, $CONFIG;
   // For error checking
   $CONFIG['TABLE_USERS'] = '**ERROR**';

   $default_group = array('group_id' => PHPBB_GUEST_GROUP,
       'group_name' => 'Unknown',
       'has_admin_access' => 0,
       'can_send_ecards' => 0,
       'can_rate_pictures' => 0,
       'can_post_comments' => 0,
       'can_upload_pictures' => 0,
       'can_create_albums' => 0,
       'pub_upl_need_approval' => 1,
       'priv_upl_need_approval' => 1,
       'upload_form_config' => 0,
       'custom_user_upload' => 0,
       'num_file_upload' => 0,
       'num_URI_upload' => 0,
       'has_admin_access' => 0,
       'can_see_all_albums' => 0,
       'groups' => array (PHPBB_GUEST_GROUP)
       );
   // Retrieve cookie stored login information
   if (!isset($HTTP_COOKIE_VARS[PHPBB_COOKIE_PREFIX . '_data'])) {
       $cookie_uid = 0;
       $cookie_pass = '*';
   } else {
       $sessiondata = unserialize($HTTP_COOKIE_VARS[PHPBB_COOKIE_PREFIX . '_data']);
       if (is_array($sessiondata)) {
           $cookie_uid = (isset($sessiondata['userid'])) ? intval($sessiondata['userid']) : 0;
           $cookie_pass = (isset($sessiondata['autologinid'])) ? addslashes($sessiondata['autologinid']) : '*';
       } else {
           $cookie_uid = 0;
           $cookie_pass = '*';
       }
   }
   // If autologin was not selected, we need to use the sessions table
   if ($cookie_uid && !$cookie_pass && isset($HTTP_COOKIE_VARS[PHPBB_COOKIE_PREFIX . '_sid'])) {
       $session_id = addslashes($HTTP_COOKIE_VARS[PHPBB_COOKIE_PREFIX . '_sid']);

       $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'";
   } 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'";
   }
   $result = db_query($sql, $UDB_DB_LINK_ID);

   if (mysql_num_rows($result)) {
       $USER_DATA = mysql_fetch_array($result);
       mysql_free_result($result);

       $USER_DATA['groups'] = array();

       if($USER_DATA['user_id'] == "-1") {
           define('USER_ID', 0);
       } else {
           define('USER_ID', (int)$USER_DATA['user_id']);
       }

       define('USER_NAME', $USER_DATA['user_name']);

jeronimo

Exactly the same problem by my side using cpg1.3.3 standalone with phpbb 2.0.14 integration (bridge)
I have recently created a test user User: test Pass: test @ http://www.phomix.com/photoism for the support team in order to check for themselves

I do login via phpbb2 and it redirects me properly to the coppermine gallery which shows that I am logged in, but as soon as a navigate somewhere trough the site I get the error
Notice: unserialize(): Error at offset 0 of 92 bytes in /path/to/coppermine/bridge/phpbb.inc.php on line 92 and I am no longer identified as logged user.

~Cheers~
Jeronimo