forum.coppermine-gallery.net

Support => Older/other versions => cpg1.2 Standalone Support => Topic started by: antoined on October 31, 2003, 01:37:42 pm

Title: CPG 1.2/PhpBB2
Post by: antoined on October 31, 2003, 01:37:42 pm
Hello,
I installed the new Coppermine 1.2 , and it is running correctly. And I integrated it with phpBB2 which is working properly.
Now when i run the integration by uncomment // define('UDB_INTEGRATION', 'phpbb'); to
define('UDB_INTEGRATION', 'phpbb'); ---- the users are recognized but when I click on any link, i have:

""You don't have permission to access this page.""

If i go back and comment define('UDB_INTEGRATION', 'phpbb'); to
// define('UDB_INTEGRATION', 'phpbb');  ---- it works!!!

Any hint please?

Thanks
Antoine
Title: CPG 1.2/PhpBB2
Post by: Titooy on October 31, 2003, 09:02:33 pm
Quote from: "README.html"
Once you have completed the installation, login using the admin account of your board. Go to the gallery, enter admin mode and click on the "Groups" button. This will synchronize Coppermine groups with those of your board. The permission you will see for each group will be completely messy, so take some time to set them properly.


I presume that's the reason of your problem...
Title: CPG 1.2/PhpBB2
Post by: antoined on October 31, 2003, 11:06:21 pm
Quote from: "Titooy"
Quote from: "README.html"
Once you have completed the installation, login using the admin account of your board. Go to the gallery, enter admin mode and click on the "Groups" button. This will synchronize Coppermine groups with those of your board. The permission you will see for each group will be completely messy, so take some time to set them properly.


I presume that's the reason of your problem...


I have the four default Groups, most are set to yes.  Do i have a new group related to the board phpBB2??
 :oops:
Thank you
Title: CPG 1.2/PhpBB2
Post by: Joachim Müller on November 01, 2003, 11:24:39 am
if the integration between cpg and phpbb works correctly, then you should have the same groups in coppermine groups settings as in phpbb. If you don't have a group that exists in phpbb, than your integration doesn't work. Try logging out, delete all cookies and login again (in phpbb).

GauGau
Title: CPG 1.2/PhpBB2
Post by: antoined on November 01, 2003, 07:03:34 pm
Quote from: "gaugau"
if the integration between cpg and phpbb works correctly, then you should have the same groups in coppermine groups settings as in phpbb. If you don't have a group that exists in phpbb, than your integration doesn't work. Try logging out, delete all cookies and login again (in phpbb).

GauGau


Thanks for your reply,
separetely from phpbb, cpg is working good.
seperately from cpg, php is working good.

I have no Groups in phpbb, and i have the four default in cpg: Admin, registered, Anonymos and banned.

Now when I run the integration , i have the error that I don't have the permission to do this...

What could be the problem?
Thanks
Antoine
Title: CPG 1.2/PhpBB2
Post by: Joachim Müller on November 02, 2003, 08:34:18 am
hard to say without looking into this. Please post links and a test account.

GauGau
Title: CPG 1.2/PhpBB2
Post by: antoined on November 02, 2003, 11:42:08 pm
Quote from: "gaugau"
hard to say without looking into this. Please post links and a test account.

GauGau


Take a look please:
BOTH ARE DRAFT COPIES (TEST) feel free to test it
http://akkar.com/phpBB2/login.php
admin.  username is akkar and the p. is the same.
Thank you again gaugau
Antoine
Title: CPG 1.2/PhpBB2
Post by: Joachim Müller on November 03, 2003, 07:46:20 am
login is not persistent: if I click around on your gallery I'm not recognized anymore, although I've set up my browser to accept all cookies.
My guess is that you did some strange things with the cookie settings: what's the name of your phpBB cookie, what's the name of your coppermine cookie?
(if you can't stay logged in to coppermine to check this in your config, use phpMyAdmin, table cpg11d_config)

GauGau
Title: CPG 1.2/PhpBB2
Post by: antoined on November 03, 2003, 07:37:48 pm
Quote from: "gaugau"
login is not persistent: if I click around on your gallery I'm not recognized anymore, although I've set up my browser to accept all cookies.
My guess is that you did some strange things with the cookie settings: what's the name of your phpBB cookie, what's the name of your coppermine cookie?
(if you can't stay logged in to coppermine to check this in your config, use phpMyAdmin, table cpg11d_config)

GauGau


Thanks again,
the cookie names of both is phpbb2mysql, when cookie domain name is blank in phpbb.

is it right?
Thank you
Antoine
Title: CPG 1.2/PhpBB2
Post by: Joachim Müller on November 03, 2003, 09:48:46 pm
change the cookie name of coppermine to something else (default name is ok) and delete all cookies from your domain on your hard disk.

GauGau
Title: CPG 1.2/PhpBB2
Post by: antoined on November 04, 2003, 08:37:57 pm
Quote from: "gaugau"
change the cookie name of coppermine to something else (default name is ok) and delete all cookies from your domain on your hard disk.

GauGau


Hello again,
I tried different cookie names for coppermine (the default included) but it is not working:
sometimes it recognizes me and sometimes no.
Sorry for bothering you again:)
Antoine
Title: CPG 1.2/PhpBB2
Post by: Titooy on November 04, 2003, 09:56:22 pm
I tried to integrate phpBB 2.0.6 and CPG 1.2RC2 and I have exactly the same problem :?
Title: CPG 1.2/PhpBB2
Post by: Joachim Müller on November 04, 2003, 11:47:15 pm
I'm no phpBB-expert (but who is in fact?), but I'm tempted to claim this is a phpBB problem: if I log in to phpBB with the pw you provided, go to the gallery, click around a while (I'm not allowed to do much since I'm not recognized) and return to the phpBB page, even phpBB doesn't recognize me (I was logged out again, although I never clicked on "logout" anywhere.
Try this: test the persistence of the cookie by commenting out the integration stuff in the bridge file, delete all your cookies from the hard drive, log into phpBB, click around in phpBB for a while, go to coppermine (which should be standalone at that moment), return to phpBB (not clicking "back" but going there again by entering the url and check if you're recognized from phpBB again.
Please report here what your results were.

GauGau
Title: CPG 1.2/PhpBB2
Post by: Titooy on November 05, 2003, 12:16:40 pm
No problem with phpBB alone...
When both are "bridged", I connect to phpBB, then I go to Coppermine and I see the user menu but when I click on any item I got an "Error. You don't have permission to access this page." and I'm logged out from Coppermine. But if I click on Login, I'm dispatched to phpBB where I'm still logged in...
Title: CPG 1.2/PhpBB2
Post by: antoined on November 05, 2003, 06:39:51 pm
Quote from: "gaugau"
I'm no phpBB-expert (but who is in fact?), but I'm tempted to claim this is a phpBB problem: if I log in to phpBB with the pw you provided, go to the gallery, click around a while (I'm not allowed to do much since I'm not recognized) and return to the phpBB page, even phpBB doesn't recognize me (I was logged out again, although I never clicked on "logout" anywhere.
Try this: test the persistence of the cookie by commenting out the integration stuff in the bridge file, delete all your cookies from the hard drive, log into phpBB, click around in phpBB for a while, go to coppermine (which should be standalone at that moment), return to phpBB (not clicking "back" but going there again by entering the url and check if you're recognized from phpBB again.
Please report here what your results were.

GauGau



I tested the following:
First, I deleted all cookies on my hard disk.
I uncommented the the integration in /include folder file int.inc, I logged into phpBB and I clicked around for a while.
After that, I went to cpg (not hitting the back bottom) and I clicked around, after this I came back to phpBB where I were still recognized.
I repeated this operation and I also logged into cpg (which is standalone when runs alone) and then i went to phpBB where I were still recognized.

you said: "test the persistence of the cookie by commenting out the integration stuff in the bridge file" how to so in the bridge file?

Thanks
Antoine

ps: I am not expert neither in phpBB nor in coppermine, what if I send you a PM with the FTP access account, so you can examine the problem?
Let me know
Title: CPG 1.2/PhpBB2
Post by: Joachim Müller on November 05, 2003, 11:00:39 pm
Antoine,

I'm afraid your ftp access data won't solve this problem. I told you crap: you were right in disabling the integration in init.inc.php - the bridge file doesn't have to be touched.

I'm rather running out of ideas...

GauGau
Title: CPG 1.2/PhpBB2
Post by: Titooy on November 07, 2003, 02:50:37 pm
Did someone successfully integrate CPG 1.2 with phpBB or another BBS ?
Title: CPG 1.2/PhpBB2
Post by: Joachim Müller on November 07, 2003, 03:35:50 pm
I was successfull with cpg and yabbse.

GauGau
Title: CPG 1.2/PhpBB2
Post by: DaMysterious on November 07, 2003, 04:34:21 pm
Quote from: "antoined"

I tested the following:
First, I deleted all cookies on my hard disk.
I uncommented the the integration in /include folder file int.inc, I logged into phpBB and I clicked around for a while.
After that, I went to cpg (not hitting the back bottom) and I clicked around, after this I came back to phpBB where I were still recognized.
I repeated this operation and I also logged into cpg (which is standalone when runs alone) and then i went to phpBB where I were still recognized.

you said: "test the persistence of the cookie by commenting out the integration stuff in the bridge file" how to so in the bridge file?

Thanks
Antoine

ps: I am not expert neither in phpBB nor in coppermine, what if I send you a PM with the FTP access account, so you can examine the problem?
Let me know


Maybe I could help out?

phpBB cookiesetup:
Code: [Select]

Cookie domain    www.akkar.com
Cookie name      phpbb2mysql
Cookie path         /
Cookie secure    off
Session length    3600


CPG cookiesetup:
Code: [Select]

Cookie name      cpg11d
Cookie path         /


Bridgefile phpbb.inc.php
Code: [Select]

// In this example http://yoursite_name.com/phpBB2/
define('PHPBB_WEB_PATH','http://www.akkar.com/');


define('PHPBB_COOKIE_PREFIX','phpbb2mysql');// The prefix used for board cookies


// Group definitions
define('PHPBB_ADMIN_GROUP', 1);
define('PHPBB_MEMBERS_GROUP', 2);
define('PHPBB_GUEST_GROUP', 3);
define('PHPBB_BANNED_GROUP', 4);



Above works for me.
Title: CPG 1.2/PhpBB2
Post by: antoined on November 07, 2003, 09:01:17 pm
Still not working!!!!
Your integration is with CPG 1.2.0???

Antoine
Title: CPG 1.2/PhpBB2
Post by: DaMysterious on November 07, 2003, 09:16:58 pm
Quote from: "antoined"
Still not working!!!!
Your integration is with CPG 1.2.0???

Antoine


Yes and it works perfect.

Did you have enabled bridgesupport in init.inc.php?

If not try in init.inc.php

Code: [Select]

define('COPPERMINE_VERSION', '1.2.0 - RC2');
// User database integration
// Uncomment the applicable line if you want to use it
define('UDB_INTEGRATION', 'phpbb');
// define('UDB_INTEGRATION', 'invisionboard');
// define('UDB_INTEGRATION', 'vbulletin');
// define('UDB_INTEGRATION', 'yabbse');
if (!defined('IN_COPPERMINE')) die('Not in Coppermine...');
// Start output buffering
ob_start();
// Report all errors except E_NOTICE
// This is the default value set in php.ini
// error_reporting (E_ALL ^ E_NOTICE);
error_reporting(E_ALL);


Did you change the directory structure after installing? Is there a dircectory /coppermine/bridge and in there at last phpbb.inc.php? After upgrade from 1.1 to 1.2 I doe remember some errors here to.


My phpbb.inc.php
Code: [Select]

<?php
// ------------------------------------------------------------------------- //
//  Coppermine Photo Gallery                                                 //
// ------------------------------------------------------------------------- //
//  Copyright &#40;C&#41; 2002,2003  Grégory DEMAR <gdemar@wanadoo.fr>               //
//  http&#58;//www.chezgreg.net/coppermine/                                      //
// ------------------------------------------------------------------------- //
//  Based on PHPhotoalbum by Henning Støverud <henning@stoverud.com>         //
//  http&#58;//www.stoverud.com/PHPhotoalbum/                                    //
// ------------------------------------------------------------------------- //
//  This program is free software; you can redistribute it and/or modify     //
//  it under the terms of the GNU General Public License as published by     //
//  the Free Software Foundation; either version 2 of the License, or        //
//  &#40;at your option&#41; any later version.                                      //
// ------------------------------------------------------------------------- //
//
//  phpBB2 Integration for Coppermine
//
// ------------------------------------------------------------------------- //

// ------------------------------------------------------------------------- //
//  Modify the values below according to your Board installation
// ------------------------------------------------------------------------- //

// database configuration
define&#40;'PHPBB_DB_NAME','phpbb'&#41;;        // The name of the database used by the board
define&#40;'PHPBB_BD_HOST','localhost'&#41;;// The name of the database server
define&#40;'PHPBB_DB_USERNAME','root'&#41;;        // The username to use to connect to the database
define&#40;'PHPBB_DB_PASSWORD',''&#41;;                // The password to use to connect to the database

// The web path to your phpBB directory
// In this example http&#58;//yoursite_name.com/phpBB2/
define&#40;'PHPBB_WEB_PATH','http&#58;//your.url.here/'&#41;;

// ------------------------------------------------------------------------- //
//  You can keep the default values below if your instalation is standard
// ------------------------------------------------------------------------- //

// The prefix for the phpBB cookies
define&#40;'PHPBB_COOKIE_PREFIX','phpbb2mysql'&#41;;// The prefix used for board cookies

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

// ------------------------------------------------------------------------- //
//  Nothing to edit below this line
// ------------------------------------------------------------------------- //

// Group definitions
define&#40;'PHPBB_ADMIN_GROUP', 1&#41;;
define&#40;'PHPBB_MEMBERS_GROUP', 2&#41;;
define&#40;'PHPBB_GUEST_GROUP', 3&#41;;
define&#40;'PHPBB_BANNED_GROUP', 4&#41;;

// Authenticate a user using cookies
function udb_authenticate&#40;&#41;
&#123;
        
global $HTTP_COOKIE_VARS$USER_DATA$UDB_DB_LINK_ID$UDB_DB_NAME_PREFIX$CONFIG;
        
        
// For error checking
        
$CONFIG['TABLE_USERS'&#93; = '**ERROR**';

        
$default_group = array&#40;
                
'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,
        &
#41;;
        
        // Retrieve cookie stored login information
        
if &#40;!isset&#40;$HTTP_COOKIE_VARS[PHPBB_COOKIE_PREFIX.'_data'&#93;&#41;&#41; &#123;
                
$cookie_uid  0;
                
$cookie_pass '*';
        &
#125; else &#123;
                
$sessiondata unserialize&#40;$HTTP_COOKIE_VARS[PHPBB_COOKIE_PREFIX . '_data'&#93;&#41;;
                
if &#40;is_array&#40;$sessiondata&#41;&#41; &#123;
                        
$cookie_uid  = &#40; isset&#40;$sessiondata['userid'&#93;&#41; &#41; ? intval&#40;$sessiondata['userid'&#93;&#41; &#58; 0;
                        
$cookie_pass = &#40; isset&#40;$sessiondata['autologinid'&#93;&#41; &#41; ? addslashes&#40;$sessiondata['autologinid'&#93;&#41; &#58; '*';
                
&#125; else &#123;
                        
$cookie_uid  0;
                        
$cookie_pass '*';
                &
#125;
        
&#125;
        
        // If autologin was not selected, we need to use the sessions table
        
if&#40;$cookie_uid && !$cookie_pass && isset&#40;$HTTP_COOKIE_VARS[PHPBB_COOKIE_PREFIX.'_sid'&#93;&#41;&#41;&#123;

                
$session_id addslashes&#40;$HTTP_COOKIE_VARS[PHPBB_COOKIE_PREFIX.'_sid'&#93;&#41;;

                
$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'";

        &
#125; else &#123;

                
$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'";

        &
#125;
        
$result db_query&#40;$sql, $UDB_DB_LINK_ID&#41;;
        
        
if &#40;mysql_num_rows&#40;$result&#41;&#41;&#123;
                
$USER_DATA mysql_fetch_array&#40;$result&#41;;
                
mysql_free_result&#40;$result&#41;;
        
            
define&#40;'USER_ID', &#40;int&#41;$USER_DATA['user_id'&#93;&#41;;
            
define&#40;'USER_NAME', $USER_DATA['user_name'&#93;&#41;;

                // Define the basic groups
                
if&#40;$USER_DATA['user_level'&#93;==1&#41;&#123;
                        
$user_group_set PHPBB_ADMIN_GROUP.','.PHPBB_MEMBERS_GROUP.',';
                &
#125; else &#123;
                        
$user_group_set PHPBB_MEMBERS_GROUP.',';
                &
#125;
                
                // Retrieve the groups the user is a member of
                
$sql =  "SELECT &#40;ug.group_id + 5&#41; as group_id ".
                                
"FROM ".$UDB_DB_NAME_PREFIX.PHPBB_TABLE_PREFIX.PHPBB_UGROUP_TABLE." as ug ".
                                
"LEFT JOIN ".$UDB_DB_NAME_PREFIX.PHPBB_TABLE_PREFIX.PHPBB_GROUP_TABLE." as g ON ug.group_id = g.group_id ".
                                
"WHERE user_id = ".USER_ID." AND user_pending = 0 AND group_single_user = 0";
                
$result db_query&#40;$sql&#41;;
                
while&#40;$row = mysql_fetch_array&#40;$result&#41;&#41;&#123;
                        
$user_group_set .= $row['group_id'&#93;.',';
                
&#125;
                
mysql_free_result&#40;$result&#41;;
                
                
$user_group_set '&#40;'.substr&#40;$user_group_set, 0, -1&#41;.'&#41;';

                // Default group data
                
$USER_DATA['group_quota'&#93; = 1;
                
$USER_DATA['can_rate_pictures'&#93; = 0;
                
$USER_DATA['can_send_ecards'&#93; = 0;
                
$USER_DATA['can_post_comments'&#93; = 0;
                
$USER_DATA['can_upload_pictures'&#93; = 0;
                
$USER_DATA['can_create_albums'&#93; = 0;
                
$USER_DATA['pub_upl_need_approval'&#93; = 1;
                
$USER_DATA['priv_upl_need_approval'&#93; = 1;
                
                
$sql "SELECT  group_quota as gq, ".
                           
"                can_rate_pictures as crp, ".
                           
"                can_send_ecards as cse, ".
                           
"                can_post_comments as cpc, ".
                           
"                can_upload_pictures as cup, ".
                           
"                can_create_albums as cca, ".
                           
"                pub_upl_need_approval as puna, ".
                           
"                priv_upl_need_approval as pruna ".
                           
"FROM &#123;$CONFIG['TABLE_USERGROUPS'&#93;&#125; ".
                           
"WHERE group_id IN ".$user_group_set;
                
$result db_query&#40;$sql&#41;;

                // Merge permissions for groups the user is a member of
                
while&#40;$row = mysql_fetch_array&#40;$result&#41;&#41;&#123;
                        
$USER_DATA['can_rate_pictures'&#93; += $row['crp'&#93;;
                        
$USER_DATA['can_send_ecards'&#93; += $row['cse'&#93;;
                        
$USER_DATA['can_post_comments'&#93; += $row['cpc'&#93;;
                        
$USER_DATA['can_upload_pictures'&#93; += $row['cup'&#93;;
                        
$USER_DATA['can_create_albums'&#93; += $row['cca'&#93;;
                        
$USER_DATA['pub_upl_need_approval'&#93; *= $row['puna'&#93;;
                        
$USER_DATA['priv_upl_need_approval'&#93; *= $row['pruna'&#93;;
                        
                        
$quota $USER_DATA['group_quota'&#93;;
                        
if&#40;&#40;$quota && $row['gq'&#93; > $quota&#41; || !$row['gq'&#93;&#41; $USER_DATA['group_quota'&#93; = $row['gq'&#93;;
                
&#125;
                
mysql_free_result&#40;$result&#41;;

            
define&#40;'USER_GROUP', ''&#41;;
                
define&#40;'USER_GROUP_SET', $user_group_set&#41;;
            
define&#40;'USER_IS_ADMIN', &#40;$USER_DATA['user_level'&#93; == 1&#41;&#41;;
            
define&#40;'USER_CAN_SEND_ECARDS', &#40;int&#41;$USER_DATA['can_send_ecards'&#93;&#41;;
            
define&#40;'USER_CAN_RATE_PICTURES', &#40;int&#41;$USER_DATA['can_rate_pictures'&#93;&#41;;
            
define&#40;'USER_CAN_POST_COMMENTS', &#40;int&#41;$USER_DATA['can_post_comments'&#93;&#41;;
            
define&#40;'USER_CAN_UPLOAD_PICTURES', &#40;int&#41;$USER_DATA['can_upload_pictures'&#93;&#41;;
            
define&#40;'USER_CAN_CREATE_ALBUMS', &#40;int&#41;$USER_DATA['can_create_albums'&#93;&#41;;
        
&#125; else &#123;
            
$result db_query&#40;"SELECT * FROM &#123;$CONFIG['TABLE_USERGROUPS'&#93;&#125; WHERE group_id = ".PHPBB_GUEST_GROUP&#41;;
                
if &#40;!mysql_num_rows&#40;$result&#41;&#41; &#123;
                        
$USER_DATA $default_group;
                &
#125; else &#123;
                        
$USER_DATA mysql_fetch_array&#40;$result&#41;;
                
&#125;
            
define&#40;'USER_ID', 0&#41;;
            
define&#40;'USER_NAME', 'Anonymous'&#41;;
                
define&#40;'USER_GROUP_SET', '&#40;'.PHPBB_GUEST_GROUP.'&#41;'&#41;;
            
define&#40;'USER_IS_ADMIN', 0&#41;;
            
define&#40;'USER_CAN_SEND_ECARDS', &#40;int&#41;$USER_DATA['can_send_ecards'&#93;&#41;;
            
define&#40;'USER_CAN_RATE_PICTURES', &#40;int&#41;$USER_DATA['can_rate_pictures'&#93;&#41;;
            
define&#40;'USER_CAN_POST_COMMENTS', &#40;int&#41;$USER_DATA['can_post_comments'&#93;&#41;;
            
define&#40;'USER_CAN_UPLOAD_PICTURES', &#40;int&#41;$USER_DATA['can_upload_pictures'&#93;&#41;;
            
define&#40;'USER_CAN_CREATE_ALBUMS', 0&#41;;
                
mysql_free_result&#40;$result&#41;;
        
&#125;
&#125;

// Retrieve the name of a user
function udb_get_user_name&#40;$uid&#41;
&#123;
        
global $UDB_DB_LINK_ID$UDB_DB_NAME_PREFIX$CONFIG;

        
$sql "SELECT username as user_name ".
                   
"FROM ".$UDB_DB_NAME_PREFIX.PHPBB_TABLE_PREFIX.PHPBB_USER_TABLE." ".
                   
"WHERE user_id = '$uid'";

        
$result db_query&#40;$sql, $UDB_DB_LINK_ID&#41;;

        
if &#40;mysql_num_rows&#40;$result&#41;&#41; &#123;
            
$row mysql_fetch_array&#40;$result&#41;;
                
mysql_free_result&#40;$result&#41;;
                
return $row['user_name'&#93;;
        
&#125; else &#123;
                
return '';
        &
#125;
&#125;

// Redirect
function udb_redirect&#40;$target&#41;
&#123;
        
header&#40;'Location&#58; '.PHPBB_WEB_PATH.$target&#41;;
        
exit;
&
#125;

// Register
function udb_register_page&#40;&#41;
&#123;
        
$target 'profile.php?mode=register';
        
udb_redirect&#40;$target&#41;;
&#125;

// Login
function udb_login_page&#40;&#41;
&#123;
        
global $CONFIG;

        
$target 'login.php';
        
udb_redirect&#40;$target&#41;;
&#125;

// Logout
function udb_logout_page&#40;&#41;
&#123;
        
global $CONFIG;

        
$target 'login.php?logout=true';
        
udb_redirect&#40;$target&#41;;
&#125;

// Edit users
function udb_edit_users&#40;&#41;
&#123;
        
$target 'admin/index.php';
        
udb_redirect&#40;$target&#41;;
&#125;

// Get user information
function udb_get_user_infos&#40;$uid&#41;
&#123;
        
global $UDB_DB_NAME_PREFIX$UDB_DB_LINK_ID;
        global 
$lang_register_php;

        
$sql "SELECT username as user_name, user_email, user_regdate, ".
                   
"user_from as user_location, user_interests, user_website, user_occ as user_occupation ".
                   
"FROM ".$UDB_DB_NAME_PREFIX.PHPBB_TABLE_PREFIX.PHPBB_USER_TABLE." ".
                   
"WHERE user_id = '$uid'";
        
$result db_query&#40;$sql, $UDB_DB_LINK_ID&#41;;
        
if&#40;!mysql_num_rows&#40;$result&#41;&#41; cpg_die&#40;ERROR, $lang_register_php['err_unk_user'&#93;, __FILE__, __LINE__&#41;;
        
        
$user_data mysql_fetch_array&#40;$result&#41;;
        
$user_data['group_name'&#93; = '';
        
mysql_free_result&#40;$result&#41;;

        
return $user_data;
&
#125;

// Edit user profile
function udb_edit_profile&#40;$uid&#41;
&#123;
        
$target 'profile.php?mode=editprofile';
        
udb_redirect&#40;$target&#41;;
&#125;

// Query used to list users
function udb_list_users_query&#40;&$user_count&#41;
&#123;
        
global $CONFIG$FORBIDDEN_SET;
        
        
$sql =  "SELECT &#40;category - ".FIRST_USER_CAT."&#41; as user_id,".
                        
"                '???' as user_name,".
                        
"                COUNT&#40;DISTINCT a.aid&#41; as alb_count,".
                        
"                COUNT&#40;DISTINCT pid&#41; as pic_count,".
                        
"                MAX&#40;pid&#41; as thumb_pid ".
                        
"FROM &#123;$CONFIG['TABLE_ALBUMS'&#93;&#125; AS a ".
                        
"INNER JOIN &#123;$CONFIG['TABLE_PICTURES'&#93;&#125; AS p ON p.aid = a.aid ".
                        
"WHERE approved = 'YES' AND category > ".FIRST_USER_CAT." ".
                        
"$FORBIDDEN_SET ".
                        
"GROUP BY category ".
                        
"ORDER BY category ";
        
$result db_query&#40;$sql&#41;;
        
        
$user_count mysql_num_rows&#40;$result&#41;;
        
        
return $result;
&
#125;

function udb_list_users_retrieve_data&#40;$result, $lower_limit, $count&#41;
&#123;
        
global $CONFIG$UDB_DB_NAME_PREFIX$UDB_DB_LINK_ID;
        
        
mysql_data_seek&#40;$result, $lower_limit&#41;;

        
$rowset = array&#40;&#41;;
        
$i=0;
        
$user_id_set='';
        
        while &
#40;&#40;$row = mysql_fetch_array&#40;$result&#41;&#41; && &#40;$i++ < $count&#41;&#41;&#123;
                
$user_id_set .= $row['user_id'&#93;.',';
                
$rowset[&#93; = $row;
        
&#125;
        
mysql_free_result&#40;$result&#41;;

        
$user_id_set '&#40;'.substr&#40;$user_id_set, 0, -1&#41;.'&#41;';
        
$sql "SELECT user_id, username as user_name ".
                   
"FROM ".$UDB_DB_NAME_PREFIX.PHPBB_TABLE_PREFIX.PHPBB_USER_TABLE." ".
                   
"WHERE user_id IN $user_id_set";
        
$result db_query&#40;$sql, $UDB_DB_LINK_ID&#41;;
        
while &#40;$row = mysql_fetch_array&#40;$result&#41;&#41;&#123;
                
$name[$row['user_id'&#93;&#93; = $row['user_name'&#93;;
        
&#125;
        
for&#40;$i=0; $i<count&#40;$rowset&#41;; $i++&#41;&#123;
                
$rowset[$i&#93;['user_name'&#93; = empty&#40;$name[$rowset[$i&#93;['user_id'&#93;&#93;&#41; ? '???' &#58; $name[$rowset[$i&#93;['user_id'&#93;&#93;;
        
&#125;
        
        
return $rowset;
&
#125;

// Group table synchronisation
function udb_synchronize_groups&#40;&#41;
&#123;
        
global $CONFIG$UDB_DB_NAME_PREFIX$UDB_DB_LINK_ID;

        
$PHPBB_groups = array&#40;
                
PHPBB_ADMIN_GROUP => 'Admin',
                
PHPBB_MEMBERS_GROUP => 'Members',
                
PHPBB_GUEST_GROUP => 'Guests',
                
PHPBB_BANNED_GROUP => 'Banned',
        &
#41;;
        
        
$sql =  "SELECT &#40;ug.group_id + 5&#41; as group_id, group_name ".
                        
"FROM ".$UDB_DB_NAME_PREFIX.PHPBB_TABLE_PREFIX.PHPBB_UGROUP_TABLE." as ug ".
                        
"LEFT JOIN ".$UDB_DB_NAME_PREFIX.PHPBB_TABLE_PREFIX.PHPBB_GROUP_TABLE." as g ON ug.group_id = g.group_id ".
                        
"WHERE user_pending=0 AND group_single_user=0";
        
$result db_query&#40;$sql, $UDB_DB_LINK_ID&#41;;
        
while &#40;$row = mysql_fetch_array&#40;$result&#41;&#41;&#123;
                
$PHPBB_groups[$row['group_id'&#93;&#93; = $row['group_name'&#93;;
        
&#125;
        
mysql_free_result&#40;$result&#41;;
        
        
$result=db_query&#40;"SELECT group_id, group_name FROM &#123;$CONFIG['TABLE_USERGROUPS'&#93;&#125; WHERE 1"&#41;;
        
while &#40;$row = mysql_fetch_array&#40;$result&#41;&#41;&#123;
                
$cpg_groups[$row['group_id'&#93;&#93; = $row['group_name'&#93;;
        
&#125;
        
mysql_free_result&#40;$result&#41;;
        
        // Scan Coppermine groups that need to be deleted
        
foreach&#40;$cpg_groups as $c_group_id => $c_group_name&#41;&#123;
                
if &#40;&#40;!isset&#40;$PHPBB_groups[$c_group_id&#93;&#41;&#41;&#41; &#123;
                           
db_query&#40;"DELETE FROM &#123;$CONFIG['TABLE_USERGROUPS'&#93;&#125; WHERE group_id = '".$c_group_id."' LIMIT 1"&#41;;
                        
unset&#40;$cpg_groups[$c_group_id&#93;&#41;;
                
&#125;
        
&#125;
        
        // Scan phpBB groups that need to be created inside Coppermine table
        
foreach&#40;$PHPBB_groups as $i_group_id => $i_group_name&#41;&#123;
                
if &#40;&#40;!isset&#40;$cpg_groups[$i_group_id&#93;&#41;&#41;&#41; &#123;
                        
db_query&#40;"INSERT INTO &#123;$CONFIG['TABLE_USERGROUPS'&#93;&#125; &#40;group_id, group_name&#41; VALUES &#40;'$i_group_id', '".addslashes&#40;$i_group_name&#41;."'&#41;"&#41;;
                        
$cpg_groups[$i_group_id&#93; = $i_group_name;
                
&#125;
        
&#125;
        
        // Update Group names
        
foreach&#40;$PHPBB_groups as $i_group_id => $i_group_name&#41;&#123;
                
if &#40;$cpg_groups[$i_group_id&#93; != $i_group_name&#41; &#123;
                        
db_query&#40;"UPDATE &#123;$CONFIG['TABLE_USERGROUPS'&#93;&#125; SET group_name = '".addslashes&#40;$i_group_name&#41;."' WHERE group_id = '$i_group_id' LIMIT 1"&#41;;
                
&#125;
        
&#125;
&#125;

// Retrieve the album list used in gallery admin mode
function udb_get_admin_album_list&#40;&#41;
&#123;
        
global $CONFIG$UDB_DB_NAME_PREFIX$UDB_DB_LINK_ID$FORBIDDEN_SET;

        if &
#40;UDB_CAN_JOIN_TABLES&#41; &#123;
                
$sql "SELECT aid, CONCAT&#40;'&#40;', username, '&#41; ', title&#41; AS title ".
                           
"FROM &#123;$CONFIG['TABLE_ALBUMS'&#93;&#125; AS a ".
                           
"INNER JOIN ".$UDB_DB_NAME_PREFIX.PHPBB_TABLE_PREFIX.PHPBB_USER_TABLE." AS u ON category = &#40;".FIRST_USER_CAT." + user_id&#41; ".
                           
"ORDER BY title";
                return 
$sql;
        &
#125; else &#123;
                
$sql "SELECT aid, IF&#40;category > ".FIRST_USER_CAT.", CONCAT&#40;'* ', title&#41;, CONCAT&#40;' ', title&#41;&#41; AS title ".
                           
"FROM &#123;$CONFIG['TABLE_ALBUMS'&#93;&#125; ".
                           
"ORDER BY title";
                return 
$sql;
        &
#125;
&#125;

// ------------------------------------------------------------------------- //

// Define wheter we can join tables or not in SQL queries &#40;same host & same db or user&#41;
define&#40;'UDB_CAN_JOIN_TABLES', &#40;PHPBB_BD_HOST == $CONFIG['dbserver'&#93; && &#40;PHPBB_DB_NAME == $CONFIG['dbname'&#93; || PHPBB_DB_USERNAME == $CONFIG['dbuser'&#93;&#41;&#41;&#41;;
//define&#40;'UDB_CAN_JOIN_TABLES', false&#41;;

// Connect to phpBB database if necessary
$UDB_DB_LINK_ID 0;
$UDB_DB_NAME_PREFIX PHPBB_DB_NAME '`'.PHPBB_DB_NAME.'`.' &#58; '';
if &#40;!UDB_CAN_JOIN_TABLES&#41; &#123;
        
$UDB_DB_LINK_ID = @mysql_connect&#40;PHPBB_BD_HOST, PHPBB_DB_USERNAME, PHPBB_DB_PASSWORD&#41;;
        
if &#40;!$UDB_DB_LINK_ID&#41; die&#40;"<b>Coppermine critical error</b>&#58;<br />Unable to connect to phpBB Board database !<br /><br />MySQL said&#58; <b>".mysql_error&#40;&#41;."</b>"&#41;;
&#125;
?>

Title: CPG 1.2/PhpBB2
Post by: Titooy on November 08, 2003, 03:05:52 pm
OK I found out my error. I've set up the same cookie name for CPG and phpBB. Now that I've 2 different cookie names, everything works just fine.
Title: Login prob use with phpbb2
Post by: reomac on November 19, 2003, 10:43:53 am
uadmin/sers canot loging atomaticly after they login the phpbb2, if refresh once it may appears those options as if u have login. but if you click any link or refresh again they disapear. if you go back to the phpbb, your log in is still on. I did all the in the manaul for plug the cpg to phpbb, but there is some cookie problem i think.

anyone can help?
thanks in advance
Title: CPG 1.2/PhpBB2
Post by: Joachim Müller on November 19, 2003, 10:54:55 am
this has been asked very often; I moved your posting into the thread containing the answer. Do not use the same cookie names for phpbb and coppermine.

GauGau
Title: CPG 1.2/PhpBB2
Post by: reomac on November 19, 2003, 12:17:44 pm
ok
I have same groups in coppermine n' phpbb

cookie domain has a bit diffrent domain name, my phpbb cookie domain do not have 'www'

but it still do not work after i sync them.

check this

after i login in php bb
Quote

phpbb2_data
a%3A2%3A%7Bs%3A11%3A%22autologinid%22%3Bs%3A32%3A%225c729ddd145eddca44026be71903fc60%22%3Bs%3A6%3A%22userid%22%3Bs%3A1%3A%226%22%3B%7D
www.g-d-a.net/
1536
2741196288
29674847
715995088
29601422
*

after i go to coppermine
Quote

phpbb2_data
YToyOntzOjI6IklEIjtzOjMyOiJlYWEyYmM0YTMyZjkxOWVmM2I0NTU2NzZjM2EyYzQzYSI7czoyOiJhbSI7aToxO30%3D
www.g-d-a.net/
1024
1527273728
29607457
1663495088
29601422
*


session changed!
BTW i am using phpbb 2.0.4
Title: CPG 1.2/PhpBB2
Post by: reomac on November 19, 2003, 12:36:33 pm
Hi, my stupid fault, forgot to update the cokkie name in bridge file.
Title: How to get redirected to CPG after login (from CPG)?
Post by: pero on November 21, 2003, 01:55:23 pm
I (think) I have a fully working CPG/phpBB integration.
If I log in from CPG, I'm prompted with the phpBB login screen. After I pass username and password, I end up on the front page of phpBB, which is not what I would expect.

Is there some way so that I can get redirected to CPG if I log in from CPG (but not if I log in from phpBB)?
Title: CPG 1.2/PhpBB2
Post by: Joachim Müller on November 21, 2003, 04:35:56 pm
read the stickies and search the board :evil: !
This has been discussed in detail; I moved your posting to the thread that deals with this issue.

GauGau
Title: CPG 1.2/PhpBB2
Post by: Joachim Müller on November 24, 2003, 08:39:27 am
[size=18]To solve the issue with the "phpBB login/logout not working properly with coppermine", please use the fix mentioned in phpBB integration: solution for login/logout issue (http://forum.coppermine-gallery.net/index.php?topic=1841)

GauGau[/size]
Title: CPG 1.2/PhpBB2
Post by: Odin on January 10, 2004, 08:21:23 am
snip...nevermind...got it working..
Title: CPG 1.2/PhpBB2
Post by: mgurry on January 16, 2004, 07:25:05 pm
Gaugau, I had the login/logout issue with cp1.2 and phpbb2.0.6. But, I used the fix above and it fixed ALMOST everything. The problem now is that I get an "invalid_session" error on the phpbb login page when I attempt to logout of the gallery, rather than having it return me to another page.

If you would like a test account to see this problem, let me know.

http://DetMusic.com/gallery
Title: Error on logout while using cp1.2 / phpbb2.0.6
Post by: mgurry on January 22, 2004, 08:18:03 pm
I read the sticky for cp1.2/2.0.6 above, and even responded to it with my problem, but nobody has responded.

I originally had the login/logout issue described in the sticky, but followed the fix instructions and resolved it. However, the problem now is that I get an "invalid_session" error on the phpbb login page when I attempt to logout of the cp gallery, rather than having it return me to another page.

http://DetMusic.com/gallery
http://DetMusic.com/board

Thanks for any help that can be provided.
Title: CPG 1.2/PhpBB2
Post by: Joachim Müller on January 23, 2004, 12:54:50 am
...and as I won't let you get away with double-posting or cross-posting I moved your second standalone posting back to the thread where you posted the question the very first time.
If people don't answer to your question, there might be two reasons: they don't know the answer or they don't want to answer (your choice).
If you want to "clear your throat" and point out that you haven't received a reply to a question, you can reply to it with the words *bump*.
You may also want to have a look at http://coppermine.sourceforge.net/faq.php?q=lamesupport#lamesupport

GauGau
Title: CPG 1.2/PhpBB2
Post by: mgurry on January 23, 2004, 03:57:06 am
Quote from: "gaugau"
...and as I won't let you get away with double-posting or cross-posting I moved your second standalone posting back to the thread where you posted the question the very first time.
If people don't answer to your question, there might be two reasons: they don't know the answer or they don't want to answer (your choice).
If you want to "clear your throat" and point out that you haven't received a reply to a question, you can reply to it with the words *bump*.
You may also want to have a look at http://coppermine.sourceforge.net/faq.php?q=lamesupport#lamesupport

GauGau


"Won't let you get away with..." - What's that all about? Let me "get away with"? I'm sorry, but this doesn't sound very professional. Perhaps I should use a different application.
Title: CPG 1.2/PhpBB2
Post by: Joachim Müller on January 23, 2004, 09:05:37 am
I'm not a professional, I'm a volunteer on this project. No reason in threatening not to use coppermine - there's no benefit for me if you use it or not...

You haven't really read my posting - it's up to me to decide if I support people or not, that's what I was going to say...

GauGau
Title: CPG 1.2/PhpBB2
Post by: mgurry on January 23, 2004, 09:24:26 pm
Nobody threatened anything. I pointed out how unprofessional this is. It's obvious you don't care if anyone uses coppermine or not based on your professionalism. I'll just use an app that actually works with phpbb.

Thanks.
Title: CPG 1.2/PhpBB2
Post by: Joachim Müller on January 24, 2004, 10:57:02 am
oh yeah, I forgot: double-posting is considered to be highly professional! That's what the pros do all the time - some even make a living out of double posting on internet boards :lol: .

Go ahead and look for another app that works better for you, good luck!

GauGau
Title: CPG 1.2/PhpBB2
Post by: mgurry on February 20, 2004, 04:39:43 pm
Thanks. Your attitude sucks. Have a nice day.
Title: Invalid_session error
Post by: galaxyfantasy on March 02, 2004, 06:39:20 am
I have been working on this one project for some time now and for some reason still can't seem to figure it out. I am hoping that someone might know what is going on.

I have followed all the bridge instructions from cpg to phpbb. Everthing is running great as far as when someone logs in and as well as when someone registers new. However when someone tries to log out. It say this

General Error

Invalid_session

I am not sure why this is happing. I have spent to many hours just on this one simple thing.

Can anyone tell me what seems to be going on.

my gallery is located at http://galaxyfantasy.com/photogallery/

my phpbb2 is located at http://galaxyfantasy.com/phpBB2/
Title: CPG 1.2/PhpBB2
Post by: osfdeath on March 09, 2004, 03:56:04 am
Hello - terrific system you have here :)

Having 2 small problems

1.  Full integration with phpbb worked great but for some reason coppermine won't remember login details and requires login every time
(session or cookie? - how do i know and fix this?)

2.  Looking through  the index.html docs and it shows the catagory settings with PERMISSIONS being
 Album can be viewed by [Everybody (public album)]
After phpbb integration I no longer have that for some reason.
I have the other three options
Visitors can upload pictures  [Yes]
Visitors can post comments  [Yes]
Visitors can rate pictures      [Yes]

Ideas?
Title: CPG 1.2/PhpBB2
Post by: Joachim Müller on March 09, 2004, 08:01:12 am
you'll have to enable "Users can can have private albums" in coppermine config (this is a strange way of setting things up, since those two items don't seem to be related - I know. This will have to be reviewed in future versions of coppermine).

GauGau
Title: CPG 1.2/PhpBB2
Post by: osfdeath on March 09, 2004, 03:58:01 pm
erm...ok lol

Worked but I do see a potenial problem
I'm in the Admin group and set it to Can be viewed by Members Group
Then I can't see it anymore lol

Needs to be some sort of permission check boxes for multiple permissions

Idea on the login problem? (not keeping me logged in)
Title: CPG 1.2/PhpBB2
Post by: Casper on March 09, 2004, 06:45:21 pm
This is another of the things being changed in the next release.  For you to see these restricted albums, go into config and change 'show private album icon to unlogged user' to YES.  You will now be able to see and edit these albums.
Title: CPG & PHPBB2 integration problem
Post by: Gregski24 on April 17, 2004, 12:08:29 am
I installed CPG 1.2.1(?) and integrated it with PHPBB2.  It works great except for one issue.  While in admin mode, if I click on the "USERS" button I get "You are not authorized to view this page".  All the other features work in Admin mode, including "Groups".  I can see that a redirect to "phpbb2/admin/index.php" occurs just prior to the error, but I can't find a reason for it.  I searched this board, but I was unable to locate the same problem with a solution.  (also, the search function seems to not be available at the moment)

http://www.gregski24.com/phpbb2/portal.php
User: gallerytest
Password: test
Title: CPG 1.2/PhpBB2
Post by: Gregski24 on April 17, 2004, 03:20:18 pm
So after tinkering with it all day, I've come to the conclusion that you can't edit users in Coppermine when it's integrated with PHPBB2.  You have to do it from the admin panel in your board.  Is that correct?
By the way, I disabled the gallery test user, so you will need to contact me before attempting to use it.
Title: CPG 1.2/PhpBB2
Post by: Joachim Müller on April 18, 2004, 07:30:26 am
Quote from: "Gregski24"
you can't edit users in Coppermine when it's integrated with PHPBB2.  You have to do it from the admin panel in your board.
correct.
Quote from: "Gregski24"
While in admin mode, if I click on the "USERS" button I get "You are not authorized to view this page".
Expected behaviour, "user mode" sort of "simulates" for the admin how the gallery will look like if a user views the gallery. If you're on a page only the admin has access to and you switch to user mode, you will get this error. If you don't like it, never switch to user mode :wink: - it's only a tool after all.

GauGau
Title: CPG 1.2/PhpBB2
Post by: Gregski24 on April 18, 2004, 02:03:10 pm
Thanks gaugau.  I guess I'll have to live with that behavior.  For now. . .
Thanks again.
Title: Re: CPG 1.2/PhpBB2
Post by: Cirip on April 25, 2004, 12:33:13 pm
Hi all!

First of all:

I read all topics and threads in the forum but I can't solve my problem.
I use phpBB 2.08 and Coppermine 1.2.1 standalone.
If I use they "single" they works great, but in "cooperative mode" they present an error:
If I log in in Copermine, i will redirected to phpBB. I login and I redirected to a blank white page. (no error, or any message)
But if I close this windows and I ho again the Coppermine, I'm logged in already.
Idon't know, what is the problem, so I will copy and paste my config:  (Sorry if its too long I try to copy only the vital parts)
Oh, one thing: GauGau If you have a little time, please visit it in "real time"  (It's only a test version)
phpbb2=>         topeka.uw.hu/phpbb2/index.php (http://topeka.uw.hu/phpbb2/index.php)
Coppermine=>   topeka.uw.hu/photos/index.php (http://topeka.uw.hu/photos/index.php)

EDIT; admin login details removed.

Code: [Select]
define('COPPERMINE_VERSION', '1.2.1');
// User database integration
// Uncomment the applicable line if you want to use it
   define('UDB_INTEGRATION', 'phpbb');
// define('UDB_INTEGRATION', 'invisionboard');
// define('UDB_INTEGRATION', 'vbulletin');
// define('UDB_INTEGRATION', 'yabbse');

Code: [Select]
// database configuration
define('PHPBB_DB_NAME', 'topeka'); // The name of the database used by the board
define('PHPBB_BD_HOST', 'sql.ultraweb.hu'); // The name of the database server
define('PHPBB_DB_USERNAME', 'topeka'); // The username to use to connect to the database
define('PHPBB_DB_PASSWORD', 'topeka1981'); // The password to use to connect to the database

// The web path to your phpBB directory
// In this example http://yoursite_name.com/phpBB2/
define('PHPBB_WEB_PATH', '/phpbb2/');
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


Code: [Select]
// Login
// HTML code for login/logout redirection
DEFINE("REDIR1",'<HTML><BODY onLoad="document.redir.submit();"><FORM NAME="redir" METHOD="post" ACTION="');
DEFINE("REDIR2",'"><INPUT TYPE="hidden" NAME="redirect" VALUE="cpg_redir.php"></FORM></BODY></HTML>');
DEFINE('LOGIN_REDIR', 'login.php?redirect=cpg_redir.php');
DEFINE('LOGOUT_FLAG', '&logout=true');
// Login
function udb_login_page()
{
   udb_redirect(LOGIN_REDIR);
}
// Logout
function udb_logout_page()
{
       if (PHPBB_LOGOUT_GET) {

           udb_redirect(LOGIN_REDIR.LOGOUT_FLAG);
       } else {
           echo(REDIR1.PHPBB_WEB_PATH.LOGIN_REDIR.LOGOUT_FLAG.REDIR2);
               exit();
       }
}


and the last cpg_redir.php

Code: [Select]
<?php
$cpg_host
=$_SERVER&#91;'HTTP_HOST'&#93;;
$cpg_path='/photos';
header&#40;"Location&#58; http&#58;//".$cpg_host.$cpg_path&#41;;
exit;
?>



thanx for your patinece, Zoltan
Title: Re: CPG 1.2/PhpBB2
Post by: Casper on April 25, 2004, 12:53:04 pm
Your phpbb is trying to redirect you to 'http://topeka.uw.hu/phpbb2/cpg_redir.php?sid=085ed14921c9b0f2173713a8eabd9991',
Does such a file as 'phpbb2/cpg_redir.php' exist?

Note;  Never post an admin account details on an open board.  Unless we ask for one, we usually only require a regular user account.  If an admin account is required, you will ask to send it by PM.
Title: Re: CPG 1.2/PhpBB2
Post by: Cirip on April 25, 2004, 01:26:10 pm
hi!

of course this file exist. and its content:

Code: [Select]

<?php
$cpg_host
=$_SERVER&#91;'HTTP_HOST'&#93;;
$cpg_path='/photos';
header&#40;"Location&#58; http&#58;//".$cpg_host.$cpg_path&#41;;
exit;
?>




this is only a virtual server, but thanx for your attention.


But the problem is still exist, please help me, If you can. (or anyone who  has a good idea)
Title: Re: CPG 1.2/PhpBB2
Post by: Joachim Müller on April 25, 2004, 11:43:52 pm
There seems to be something messed up (but maybe the forum just did that to your code). Please double-check you have this code:
Code: [Select]
<?php
if (!$_SERVER['HTTP_HOST']) {
  
$cpg_host=$HTTP_SERVER_VARS['HTTP_HOST'];
} else {
  
$cpg_host=$_SERVER['HTTP_HOST'];
}
$cpg_path='/photos';
header("Location: http://".$cpg_host.$cpg_path);
exit;
?>


GauGau

P.S. What do you mean by "virtual server"? If it's accessible on the internet, it can be broken with an admin account being visible on a public board.
Title: Re: CPG 1.2/PhpBB2
Post by: Cirip on April 26, 2004, 08:56:57 am
thanx!

it'a works fine. I will tes a lot today and I report If I find any problem.


The problem was:   (the missing part of the code + the photos/index.php  need)
Code: [Select]

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



thanx again and have a nice day.

                                                 Zoltan :)
Title: Re: CPG 1.2/PhpBB2
Post by: shutiri on May 03, 2004, 06:22:28 am
Hi.

I have installed phpBB2.08 and Coppermine 1.2.1 standalone. 
Individually, they were working fine but now that I have integrated them, I can't login anymore in Coppermine !!  I read the thread about login/logout and did the fix (editing the phpbb.inc.php and creating the cpg_redir.php), but it wasn't that.

I log in my phpBB board and when I go to my gallery I'm not logged in anymore.  If I click on login in the gallery, it takes me to the board, so I can't get log in my gallery's (admin nor user).

Please, can you help me ?

my URL: www.huecos.com/foro/ and www.huecos.com/fotos/

Thank you.
Shutiri.
Title: Re: CPG 1.2/PhpBB2
Post by: Joachim Müller on May 03, 2004, 07:26:46 am
post a test user account as well, you can't expect supporters to go through registration...

GauGau
Title: Re: CPG 1.2/PhpBB2
Post by: shutiri on May 03, 2004, 08:35:29 am
thank you for your reply.  How do I set a user account ?  I can't log in coppermine's folder.  I'm sending you my username and password via PM (I read someone recommending that on another topic).

thank you again.
shutiri.
Title: Re: CPG 1.2/PhpBB2
Post by: Joachim Müller on May 03, 2004, 08:51:05 am
don't pm your admin account, untill you're explicitely asked for it. Just set up a test user on your phpBB forum and post the username and password, that's all.

GauGau
Title: Re: CPG 1.2/PhpBB2
Post by: shutiri on May 03, 2004, 09:03:40 am
I'm sorry, just delete the pm   :-[  

I did a test account with administrator privileges.  

*******
*******
Edit, admin account details removed.  Delete this account and please post new one with regular user priviledges only

I did a link to the /fotos directory on the phpBB, on the upper right corner
What else should I do ?

thank you again.
Title: Re: CPG 1.2/PhpBB2
Post by: Casper on May 03, 2004, 11:42:53 am
Have a look at this thread, which deals with the login/logout issues of phpbb2/cpg;
http://forum.coppermine-gallery.net/index.php?topic=2972.0
Title: Re: CPG 1.2/PhpBB2
Post by: shutiri on May 03, 2004, 12:05:09 pm
done.  (privileges removed)

username: test
password: test

thank you,
shutiri
Title: Re: CPG 1.2/PhpBB2
Post by: shutiri on May 03, 2004, 12:42:31 pm
ok, that gave me a little improvement: I can log in coppermine if (and only if) I'm logged in phpBB.

details:
1. If I log in phpBB,  I click on my link to Coppermine, everything is fine (that's the improvement)
2. If I log out from Coppermine, it takes me to the "error, you are not logged in page".  I click on login, it takes me to phpBB, still logged.  If I want to go back to Coppermine, it takes me there but not logged in.  I click on login in Coppermine, it takes me to phpBB, still logged...  cycle.
3. If I log out in phpBB, it works normally (I'm not logged in Coppermine).  If I log in Coppermine again,  it takes me to a blank page !!

So the only way to get to the user/admin panel of Coppermine ir through log in phpBB.

Help, please   :'(

I really appreciate your time and knowledge.
Thank you
Shutiri.
Title: Re: CPG 1.2/PhpBB2
Post by: shutiri on May 03, 2004, 12:56:57 pm
I think I know what I f***ed up.

I have just read this:

Cookie settings for CPG/phpBB integration

for phpBB2
Cookie domain: www.yoursite.com
Cookie name: phpbb2mysql
Cookie path: /

for Coppermine
cookie name: cpg11d
cookie path: /

But in the readme from the package, on the integration topic, I misunderstood this info:

If you are using phpBB 2, go to the admin control panel and check that "Cookie domain" corresponds to your domain, "Cookie name" is "phpbb2mysql" and "Cookie path" is "/". and I change the "cookie name" on CPG, not in phpBB.

Now, I can't get into the admin of CPG to change it, because even if I get correctly logged to the admin panel, when I click on config I get this "You don't have permission to access this page".

How do I change the cookie name on the code ?

thank you.
shutiri
Title: Re: CPG 1.2/PhpBB2
Post by: Casper on May 03, 2004, 03:37:24 pm
Please post lines 30 - 32 of your phpbb.inc.php here.
Title: Re: CPG 1.2/PhpBB2
Post by: Casper on May 03, 2004, 03:40:29 pm
You can change your cookie name back using your database tool, such as phpMyAdmin, and going to the cpg_config table.
Title: Re: CPG 1.2/PhpBB2
Post by: shutiri on May 03, 2004, 05:13:21 pm
Hi, Casper.  I'll try on the db.

these are the lines 30-33 (I've included 1 more, because of the change I did on 33):
// The web path to your phpBB directory
// In this example http://yoursite_name.com/phpBB2/
define('PHPBB_WEB_PATH', '/foro/');
define('PHPBB_LOGOUT_GET', TRUE);

thank you.
shutiri.
Title: Re: CPG 1.2/PhpBB2
Post by: shutiri on May 03, 2004, 05:39:51 pm
nop... 
I think it is working a little better (inside), but I get a lot of blank pages.  when I type the URL after doing some tasks, it tries to work.  Could somebody check it out, please ?

user: test
pass: test.

thank you, you're great.
shutiri.
Title: Re: CPG 1.2/PhpBB2
Post by: shutiri on May 04, 2004, 01:21:45 am
I understand a little bit better the symptoms now.  It's simple: the complete login/logout tasks in CPG is not working.

To login in CPG, I need to login first in phpBB.  If not, when I try to login in CPG, I get a blank page.
When logged in phpBB, I go to CPG, totally logged (that's the good difference after changing the cookie name in the db  ;)).  But if I try to logout from CPG, I get a blank page too.

Can somebody help ?  I think I could just take away the login/logout buttons form the CPG panel, but that's not the ideal solution.  I would like people to log directly in the pictures gallery without having to log in the forums.

Thank you for all your help.
Shutiri.
Title: Re: CPG 1.2/PhpBB2
Post by: shutiri on May 04, 2004, 01:43:42 am
Sorry about all separate posts.  I think the process is working, but I can't see it (that's what I meant about "inside").

- When I log in CPG (it does this through the phpBB login page, I think this is normal), it takes me to a blank page, but I'm actually logged in:  if I write the URL to my CPG (after login >> blank page), it takes to the CPG panel, apparently not logged in, but when I click on login,  it says "You are already logged in !" and everything works fine.
- When I logout from CPG, it takes to a blank page BUT not logged in anymore:  If I write the URL to my phpBB, it takes me to the login page (not logged in) and if I write the URL to my CPG, it takes me to the cpanel, apparently logged in, but when I click on anything, I see this "You don't have permission to access this page".  So, I'm not really logged in.

That's it...  It seems a little complicated but the inside process is working (login/logout), it's just that the redirection takes to blank pages in the middle.  How do I take away these blank pages ?

thank you,
shutiri.

Title: Re: CPG 1.2/PhpBB2
Post by: mscrw on May 06, 2004, 09:06:00 pm
I installed CPG 1.2.0 last year and it works great!  I currently have over 200 users and almost 4000 photos.  Yesterday I finished installing PHPBB 2.0.8 and it is also working fine.  I want to integrate the two, but it seems that the normal procedure is to install PHPBB first and then CPG.

Can I integrate them without losing any photos or user info?  Will the CPG user's info (username/password) apply to PHPBB or will they need to register again?

Is there a special integration procedure for this, or should I just follow the steps in the readme file?

Thanks.
Title: Re: CPG 1.2/PhpBB2
Post by: shutiri on May 07, 2004, 06:48:15 am
Hi. 

I just have integrated CPG with SMF board (the one on this page).  Trying to integrate phpBB and CPG for days, but it was not possible (a real PITA).  I would strongly recommend you to reconsider your forum choice.

shutiri.
Title: Re: CPG 1.2/PhpBB2
Post by: MichaelWhi on May 24, 2004, 05:14:14 pm


Thanks again,
the cookie names of both is phpbb2mysql, when cookie domain name is blank in phpbb.

is it right?
Thank you
Antoine

Hi! Set your PHPBB2-Cookiedomain to your Webserverdomain (without leading http:// ).
e.g.: Board and Gallery run at http://www.yourdomain.com/phpb22/ and http://www.yourdomain.com/cpg/ set your cookiedomain to "www.yourdomain.com".

This should solve the problem, that users get logged out although they didn't hit the Logout-Button....

Does it work now?
Title: Re: CPG 1.2/PhpBB2
Post by: Casper on May 24, 2004, 05:29:49 pm
The cookie names MUST be different.