CPG and phpBB troubles - not staying logged in CPG and phpBB troubles - not staying logged in
 

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

CPG and phpBB troubles - not staying logged in

Started by deimos, June 07, 2005, 02:46:09 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

deimos

I am starting a new forum and gallery. I set up each one independently and they work fine, then I followed the instructions to bridge them and it didnt work so well. When I log in at the forum, I dont stay logged in at the gallery, therefore I do not have access to the gallery unless I go back and comment the UDB_INTEGRATION line. Can someone tell me whats wrong? Both cpg and phpbb are using the same database and the cookies have different names. And I tried setting the cookie domain as blank and as pugmeetup.dyndns.org and they both give me the same result. I even deleted the forum and gallery and completely started each one over from scratch and I had the same problem. Im using CPG 1.3.3. and phpBB-php5 2.0.15.4

I set up a test account
username = username
password = password

These are both a brand new setup, so I dont have links going to eachother yet, but here are the links to the forum and gallery.
http://pugmeetup.dyndns.org/forum
http://pugmeetup.dyndns.org/gallery

init.inc.php

I uncommented this line
define('UDB_INTEGRATION', 'phpbb');


phpbb.inc.php

// database configuration
define('PHPBB_DB_NAME', 'pugmeetup'); // The name of the database used by the board
define('PHPBB_BD_HOST', 'localhost'); // The name of the database server
define('PHPBB_DB_USERNAME', 'root'); // 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', 'phpbb2mysql'); // 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


cpg_redir.php

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


deimos


Joachim Müller


Nibbler


deimos

it should be up now, I just restarted the server a while ago.

Nibbler

Have you enabled long arrays in your php.ini ?


Nibbler

Are you sure the database prefix is correct, and you are bridging to the right forum. Everything looks fine to me, if you can pm me an ftp login I can take a closer look.

deimos

they are both in the same database called pugmeetup, and the phpbb tables have a prefix of phpbb_ and the cpg tables have a prefix of cpg133_ and I followed all the directions to bridge them. Is there anything else I'm supposed to do? And yes, Im bridging to the right forum, there is nothing else on the server right now except the forum and the gallery.

kegobeer

Nibbler,

The phpbb cookie information has a domain of .pugmeetup.dyndns.org, and the Coppermine cookie has a host of purmeetup.dyndns.org.  Could this be the root of the problem?
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

deimos

#10
ok guys, I figured out the problem. It doesnt work with phpbb-php5. I only had php 5.0.4 installed on my system, so I had to use phpbb-php5. I removed php 5 and installed 4.11, then installed the older phpbb and it works now. So just so you guys know, the bridging doesnt work with phpbb-php5 yet.

Update: Since the regular phpbb wont install on php 5, and phpbb-php5 wont work with the bridge to cpg, I removed php 5, installed php 4.11, installed the original phpbb, setup the bridge, then removed php 4.11, installed php 5.0.4 again, and now everything works..So I can have php 5 with the original phpbb and the bridge to cpg. :)

kegobeer

Uh, what?  Are you saying phpBB doesn't work with PHP 5+?  You certainly confused the crap out of me.  ???
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

deimos

lol sorry. the original phpbb wont install on php 5 yet, but there is a mod of the phpbb called phpbb-php5. That is what I was using since I had php 5 on my server. http://phpbb-php5mod.sourceforge.net/ And I guess this mod didnt like the integration with coppermine too much. :-\\

kegobeer

Good info to know.  You might want to post on the phpBB forums so those people know of the issues with the phpBB-php5 mod.  Our bridge file is written to work with the standard phpBB installation, so your problems are to be expected.  Knowing that from the beginning would've helped greatly.

Marking as solved.
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

deimos

 ::) I said in my very first post exactly what I was using:

QuoteIm using CPG 1.3.3. and phpBB-php5 2.0.15.4

But anyway, thank you for trying to help.

kegobeer

Ah, and so you did.  Boy, is my face red!  I'll just shut up now.  :-X
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

Nibbler

You needn't have done all that, I just installed phpbb-php5 to test and the fix is simple, just look in the bridge file for:

    // 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'";
    }


and change to

    // If autologin was not selected, we need to use the sessions table
    if (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 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'";
    }


Hope that helps anyone else using the mod.