forum.coppermine-gallery.net
Support => Older/other versions => cpg1.2 Standalone Support => Topic started 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
-
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...
-
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
-
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
-
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
-
hard to say without looking into this. Please post links and a test account.
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
-
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
-
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
-
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
-
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
-
I tried to integrate phpBB 2.0.6 and CPG 1.2RC2 and I have exactly the same problem :?
-
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
-
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...
-
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
-
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
-
Did someone successfully integrate CPG 1.2 with phpBB or another BBS ?
-
I was successfull with cpg and yabbse.
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
Maybe I could help out?
phpBB cookiesetup:
Cookie domain www.akkar.com
Cookie name phpbb2mysql
Cookie path /
Cookie secure off
Session length 3600
CPG cookiesetup:
Cookie name cpg11d
Cookie path /
Bridgefile phpbb.inc.php
// 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.
-
Still not working!!!!
Your integration is with CPG 1.2.0???
Antoine
-
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
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
<?php
// ------------------------------------------------------------------------- //
// Coppermine Photo Gallery //
// ------------------------------------------------------------------------- //
// Copyright (C) 2002,2003 Grégory DEMAR <gdemar@wanadoo.fr> //
// http://www.chezgreg.net/coppermine/ //
// ------------------------------------------------------------------------- //
// Based on PHPhotoalbum by Henning Støverud <henning@stoverud.com> //
// http://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 //
// (at your option) any later version. //
// ------------------------------------------------------------------------- //
//
// phpBB2 Integration for Coppermine
//
// ------------------------------------------------------------------------- //
// ------------------------------------------------------------------------- //
// Modify the values below according to your Board installation
// ------------------------------------------------------------------------- //
// database configuration
define('PHPBB_DB_NAME','phpbb'); // 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
// In this example http://yoursite_name.com/phpBB2/
define('PHPBB_WEB_PATH','http://your.url.here/');
// ------------------------------------------------------------------------- //
// 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
// ------------------------------------------------------------------------- //
// 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,
);
// 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'";
} 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'";
}
$result = db_query($sql, $UDB_DB_LINK_ID);
if (mysql_num_rows($result)){
$USER_DATA = mysql_fetch_array($result);
mysql_free_result($result);
define('USER_ID', (int)$USER_DATA['user_id']);
define('USER_NAME', $USER_DATA['user_name']);
// Define the basic groups
if($USER_DATA['user_level']==1){
$user_group_set = PHPBB_ADMIN_GROUP.','.PHPBB_MEMBERS_GROUP.',';
} else {
$user_group_set = PHPBB_MEMBERS_GROUP.',';
}
// Retrieve the groups the user is a member of
$sql = "SELECT (ug.group_id + 5) 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($sql);
while($row = mysql_fetch_array($result)){
$user_group_set .= $row['group_id'].',';
}
mysql_free_result($result);
$user_group_set = '('.substr($user_group_set, 0, -1).')';
// Default group data
$USER_DATA['group_quota'] = 1;
$USER_DATA['can_rate_pictures'] = 0;
$USER_DATA['can_send_ecards'] = 0;
$USER_DATA['can_post_comments'] = 0;
$USER_DATA['can_upload_pictures'] = 0;
$USER_DATA['can_create_albums'] = 0;
$USER_DATA['pub_upl_need_approval'] = 1;
$USER_DATA['priv_upl_need_approval'] = 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 {$CONFIG['TABLE_USERGROUPS']} ".
"WHERE group_id IN ".$user_group_set;
$result = db_query($sql);
// Merge permissions for groups the user is a member of
while($row = mysql_fetch_array($result)){
$USER_DATA['can_rate_pictures'] += $row['crp'];
$USER_DATA['can_send_ecards'] += $row['cse'];
$USER_DATA['can_post_comments'] += $row['cpc'];
$USER_DATA['can_upload_pictures'] += $row['cup'];
$USER_DATA['can_create_albums'] += $row['cca'];
$USER_DATA['pub_upl_need_approval'] *= $row['puna'];
$USER_DATA['priv_upl_need_approval'] *= $row['pruna'];
$quota = $USER_DATA['group_quota'];
if(($quota && $row['gq'] > $quota) || !$row['gq']) $USER_DATA['group_quota'] = $row['gq'];
}
mysql_free_result($result);
define('USER_GROUP', '');
define('USER_GROUP_SET', $user_group_set);
define('USER_IS_ADMIN', ($USER_DATA['user_level'] == 1));
define('USER_CAN_SEND_ECARDS', (int)$USER_DATA['can_send_ecards']);
define('USER_CAN_RATE_PICTURES', (int)$USER_DATA['can_rate_pictures']);
define('USER_CAN_POST_COMMENTS', (int)$USER_DATA['can_post_comments']);
define('USER_CAN_UPLOAD_PICTURES', (int)$USER_DATA['can_upload_pictures']);
define('USER_CAN_CREATE_ALBUMS', (int)$USER_DATA['can_create_albums']);
} else {
$result = db_query("SELECT * FROM {$CONFIG['TABLE_USERGROUPS']} WHERE group_id = ".PHPBB_GUEST_GROUP);
if (!mysql_num_rows($result)) {
$USER_DATA = $default_group;
} else {
$USER_DATA = mysql_fetch_array($result);
}
define('USER_ID', 0);
define('USER_NAME', 'Anonymous');
define('USER_GROUP_SET', '('.PHPBB_GUEST_GROUP.')');
define('USER_IS_ADMIN', 0);
define('USER_CAN_SEND_ECARDS', (int)$USER_DATA['can_send_ecards']);
define('USER_CAN_RATE_PICTURES', (int)$USER_DATA['can_rate_pictures']);
define('USER_CAN_POST_COMMENTS', (int)$USER_DATA['can_post_comments']);
define('USER_CAN_UPLOAD_PICTURES', (int)$USER_DATA['can_upload_pictures']);
define('USER_CAN_CREATE_ALBUMS', 0);
mysql_free_result($result);
}
}
// Retrieve the name of a user
function udb_get_user_name($uid)
{
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($sql, $UDB_DB_LINK_ID);
if (mysql_num_rows($result)) {
$row = mysql_fetch_array($result);
mysql_free_result($result);
return $row['user_name'];
} else {
return '';
}
}
// Redirect
function udb_redirect($target)
{
header('Location: '.PHPBB_WEB_PATH.$target);
exit;
}
// Register
function udb_register_page()
{
$target = 'profile.php?mode=register';
udb_redirect($target);
}
// Login
function udb_login_page()
{
global $CONFIG;
$target = 'login.php';
udb_redirect($target);
}
// Logout
function udb_logout_page()
{
global $CONFIG;
$target = 'login.php?logout=true';
udb_redirect($target);
}
// Edit users
function udb_edit_users()
{
$target = 'admin/index.php';
udb_redirect($target);
}
// Get user information
function udb_get_user_infos($uid)
{
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($sql, $UDB_DB_LINK_ID);
if(!mysql_num_rows($result)) cpg_die(ERROR, $lang_register_php['err_unk_user'], __FILE__, __LINE__);
$user_data = mysql_fetch_array($result);
$user_data['group_name'] = '';
mysql_free_result($result);
return $user_data;
}
// Edit user profile
function udb_edit_profile($uid)
{
$target = 'profile.php?mode=editprofile';
udb_redirect($target);
}
// Query used to list users
function udb_list_users_query(&$user_count)
{
global $CONFIG, $FORBIDDEN_SET;
$sql = "SELECT (category - ".FIRST_USER_CAT.") as user_id,".
" '???' as user_name,".
" COUNT(DISTINCT a.aid) as alb_count,".
" COUNT(DISTINCT pid) as pic_count,".
" MAX(pid) as thumb_pid ".
"FROM {$CONFIG['TABLE_ALBUMS']} AS a ".
"INNER JOIN {$CONFIG['TABLE_PICTURES']} 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($sql);
$user_count = mysql_num_rows($result);
return $result;
}
function udb_list_users_retrieve_data($result, $lower_limit, $count)
{
global $CONFIG, $UDB_DB_NAME_PREFIX, $UDB_DB_LINK_ID;
mysql_data_seek($result, $lower_limit);
$rowset = array();
$i=0;
$user_id_set='';
while (($row = mysql_fetch_array($result)) && ($i++ < $count)){
$user_id_set .= $row['user_id'].',';
$rowset[] = $row;
}
mysql_free_result($result);
$user_id_set = '('.substr($user_id_set, 0, -1).')';
$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($sql, $UDB_DB_LINK_ID);
while ($row = mysql_fetch_array($result)){
$name[$row['user_id']] = $row['user_name'];
}
for($i=0; $i<count($rowset); $i++){
$rowset[$i]['user_name'] = empty($name[$rowset[$i]['user_id']]) ? '???' : $name[$rowset[$i]['user_id']];
}
return $rowset;
}
// Group table synchronisation
function udb_synchronize_groups()
{
global $CONFIG, $UDB_DB_NAME_PREFIX, $UDB_DB_LINK_ID;
$PHPBB_groups = array(
PHPBB_ADMIN_GROUP => 'Admin',
PHPBB_MEMBERS_GROUP => 'Members',
PHPBB_GUEST_GROUP => 'Guests',
PHPBB_BANNED_GROUP => 'Banned',
);
$sql = "SELECT (ug.group_id + 5) 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($sql, $UDB_DB_LINK_ID);
while ($row = mysql_fetch_array($result)){
$PHPBB_groups[$row['group_id']] = $row['group_name'];
}
mysql_free_result($result);
$result=db_query("SELECT group_id, group_name FROM {$CONFIG['TABLE_USERGROUPS']} WHERE 1");
while ($row = mysql_fetch_array($result)){
$cpg_groups[$row['group_id']] = $row['group_name'];
}
mysql_free_result($result);
// Scan Coppermine groups that need to be deleted
foreach($cpg_groups as $c_group_id => $c_group_name){
if ((!isset($PHPBB_groups[$c_group_id]))) {
db_query("DELETE FROM {$CONFIG['TABLE_USERGROUPS']} WHERE group_id = '".$c_group_id."' LIMIT 1");
unset($cpg_groups[$c_group_id]);
}
}
// Scan phpBB groups that need to be created inside Coppermine table
foreach($PHPBB_groups as $i_group_id => $i_group_name){
if ((!isset($cpg_groups[$i_group_id]))) {
db_query("INSERT INTO {$CONFIG['TABLE_USERGROUPS']} (group_id, group_name) VALUES ('$i_group_id', '".addslashes($i_group_name)."')");
$cpg_groups[$i_group_id] = $i_group_name;
}
}
// Update Group names
foreach($PHPBB_groups as $i_group_id => $i_group_name){
if ($cpg_groups[$i_group_id] != $i_group_name) {
db_query("UPDATE {$CONFIG['TABLE_USERGROUPS']} SET group_name = '".addslashes($i_group_name)."' WHERE group_id = '$i_group_id' LIMIT 1");
}
}
}
// Retrieve the album list used in gallery admin mode
function udb_get_admin_album_list()
{
global $CONFIG, $UDB_DB_NAME_PREFIX, $UDB_DB_LINK_ID, $FORBIDDEN_SET;
if (UDB_CAN_JOIN_TABLES) {
$sql = "SELECT aid, CONCAT('(', username, ') ', title) AS title ".
"FROM {$CONFIG['TABLE_ALBUMS']} AS a ".
"INNER JOIN ".$UDB_DB_NAME_PREFIX.PHPBB_TABLE_PREFIX.PHPBB_USER_TABLE." AS u ON category = (".FIRST_USER_CAT." + user_id) ".
"ORDER BY title";
return $sql;
} else {
$sql = "SELECT aid, IF(category > ".FIRST_USER_CAT.", CONCAT('* ', title), CONCAT(' ', title)) AS title ".
"FROM {$CONFIG['TABLE_ALBUMS']} ".
"ORDER BY title";
return $sql;
}
}
// ------------------------------------------------------------------------- //
// Define wheter we can join tables or not in SQL queries (same host & same db or user)
define('UDB_CAN_JOIN_TABLES', (PHPBB_BD_HOST == $CONFIG['dbserver'] && (PHPBB_DB_NAME == $CONFIG['dbname'] || PHPBB_DB_USERNAME == $CONFIG['dbuser'])));
//define('UDB_CAN_JOIN_TABLES', false);
// Connect to phpBB database if necessary
$UDB_DB_LINK_ID = 0;
$UDB_DB_NAME_PREFIX = PHPBB_DB_NAME ? '`'.PHPBB_DB_NAME.'`.' : '';
if (!UDB_CAN_JOIN_TABLES) {
$UDB_DB_LINK_ID = @mysql_connect(PHPBB_BD_HOST, PHPBB_DB_USERNAME, PHPBB_DB_PASSWORD);
if (!$UDB_DB_LINK_ID) die("<b>Coppermine critical error</b>:<br />Unable to connect to phpBB Board database !<br /><br />MySQL said: <b>".mysql_error()."</b>");
}
?>
-
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.
-
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
-
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
-
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
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
phpbb2_data
YToyOntzOjI6IklEIjtzOjMyOiJlYWEyYmM0YTMyZjkxOWVmM2I0NTU2NzZjM2EyYzQzYSI7czoyOiJhbSI7aToxO30%3D
www.g-d-a.net/
1024
1527273728
29607457
1663495088
29601422
*
session changed!
BTW i am using phpbb 2.0.4
-
Hi, my stupid fault, forgot to update the cokkie name in bridge file.
-
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)?
-
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
-
[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]
-
snip...nevermind...got it working..
-
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
-
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.
-
...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
-
...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.
-
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
-
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.
-
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
-
Thanks. Your attitude sucks. Have a nice day.
-
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/
-
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?
-
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
-
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)
-
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.
-
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
-
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.
-
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.
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
-
Thanks gaugau. I guess I'll have to live with that behavior. For now. . .
Thanks again.
-
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.
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');
// 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
// 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
<?php
$cpg_host=$_SERVER['HTTP_HOST'];
$cpg_path='/photos';
header("Location: http://".$cpg_host.$cpg_path);
exit;
?>
thanx for your patinece, Zoltan
-
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.
-
hi!
of course this file exist. and its content:
<?php
$cpg_host=$_SERVER['HTTP_HOST'];
$cpg_path='/photos';
header("Location: http://".$cpg_host.$cpg_path);
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)
-
There seems to be something messed up (but maybe the forum just did that to your code). Please double-check you have this code:
<?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.
-
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)
<?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 :)
-
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.
-
post a test user account as well, you can't expect supporters to go through registration...
GauGau
-
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.
-
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
-
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.
-
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
-
done. (privileges removed)
username: test
password: test
thank you,
shutiri
-
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.
-
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
-
Please post lines 30 - 32 of your phpbb.inc.php here.
-
You can change your cookie name back using your database tool, such as phpMyAdmin, and going to the cpg_config table.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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?
-
The cookie names MUST be different.