PHPBB 2.0.10 and CPG 1.3.1 - Logout Issue PHPBB 2.0.10 and CPG 1.3.1 - Logout Issue
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

PHPBB 2.0.10 and CPG 1.3.1 - Logout Issue

Started by r4merlin, August 12, 2004, 01:12:57 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

r4merlin

Maybe I am going mad as its late as well, but when I log out of gallery I want to be re-directed to my portal page.  For some reason it does not seem to be working.

URL:  www.cichlidsoutheast.co.uk/phpBB2
URL: www.cichlidsoutheast.co.uk/coppermine

Any suggestions

Joachim Müller

read the integration instructions once more carefully - you have to set up a file in your phpbb folder that redirects you back to coppermine after you successfully logged in. If you set up this file already, post it's contents here.

GauGau

r4merlin

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

It does the log in re-direct fine, just need to go back to www.domain.co.uk/phpBB/portal.php for logout

Joachim Müller

Oh yes ;)
You're not being redirected when logging in, it's being used after you have logged in. I doubt it works, since your coppermine gallery is stored in the folder "coppermine", but your redirect file says to use the folder "gallery".

GauGau

aceracer24

Quote from: r4merlin on August 12, 2004, 01:12:57 AM
Maybe I am going mad as its late as well, but when I log out of gallery I want to be re-directed to my portal page.  For some reason it does not seem to be working.

URL:  www.cichlidsoutheast.co.uk/phpBB2
URL: www.cichlidsoutheast.co.uk/coppermine

Any suggestions

Not sure if you guys where understanding what he is asking...he wants the re-direct AFTER he logs OUT to send him to his PORTAL.PHP.

I am having the same problem which is why I am now posting. Redirect WORKS when I log IN. It sends me to gallery like it's suppose to. But I want it to send me to my portal.php when i log out. The redirect for log out isn't working and I can't find how to fix it.  Currently, the re-direct brings me back to the gallery index .php when I log out. How can i fixz this to re-direct me to my forums portal.php page?

URL:  www.aceracercs.com/forums/portal.php
URL: www.aceracercs.com/coppermine/index.php

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


Joachim Müller

I understand what you want, but the feature simply isn't there: phpbb is capable of redirecting you somewhere after you logged in, but it simply doesn't have the feature of redirecting you somewhere after you logged out. You will have to edit your phpbb install to display a link to portal.php or whatever, nothing that can be done by us. If you have further questions on this, take a look at the phpbb forum, as we (the coppermine developemht team) know "our" software coppermine, but not phpbb (we don't even use it).

GauGau

EZ

#6
r4merlin -

What you are asking for can be done, but it requires modifying the code. Here's how I think you can do it. Note that I have NOT tested it, so you may need to debug and fix it yourself:

1. In your phpBB directory, find the file cpg_redir.php. Make two copies of that file (so the original remains untouched), and name them cpg_redir_login.php and cpg_redir_logout.php.

2. Edit the new cpg_redir_logout.php and put whatever URL target you want to redirect to after logout. Assuming that URL is on the same server as Coppermine & phpBB (most likely), you only need to provide the target path in the $cpg_path variable. For example to redirect to the high score page in your games directory, you need something like this: $cpg_path=/games/hiscore.html

3. Make a backup of your <coppermine>/bridge/phpbb.inc.php.

4. Open <coppermine>/bridge/phpbb.inc.php for editing.

5. Find this section // 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();
   }
}


6. Replace with this // 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_logout.php" /></form></body></html>');
DEFINE('LOGIN_REDIR', 'login.php?redirect=cpg_redir_login.php');
DEFINE('LOGOUT_REDIR', 'login.php?redirect=cpg_redir_logout.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(LOGOUT_REDIR.LOGOUT_FLAG);
   } else {
       echo(REDIR1.PHPBB_WEB_PATH.LOGOUT_REDIR.LOGOUT_FLAG.REDIR2);
      exit();
   }
}


7. Test and debug.

As GauGau mentioned this is not part of Coppermine's standard functionality, so you'll have to repeat those steps each time you update or re-install Coppermine.

Good luck, and please post the results.

Eyal.