IPB 2.2.2 + CPG 1.4.10 Logout Problem IPB 2.2.2 + CPG 1.4.10 Logout Problem
 

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

IPB 2.2.2 + CPG 1.4.10 Logout Problem

Started by Darth Unrivaled, April 15, 2007, 11:23:11 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Darth Unrivaled

Coppermine install: http://www.majin-planet.com/gallery/index.php
Forum install: http://community.majin-planet.com/
Coppermine version: cpg1.4.10
Forum version: Invasion Power Board 2.2.2
Test user account: Testing Bot / dragon88

BridgeManager settings:
Forum URL:  http://www.majin-planet.com/community
Relative path to your BBS's config file:  ../community/
Use post-based groups?: 1
Cookie name/preifx: none

Okay I search and couldn't find a anwser to my questions. I found lot of common topics but nothing that seems to work. First off the bridging worked. I have a few small issues with the members list link pointing to a admin folder, which I fixed. I have two majoir problems.

The first one is logout. When I logout of my board, threw the forums (some topics point out that maybe you can't logout with the gallery, and that link should be removed) however when I go back to the gallery I'm still login. The only way to logout is to delete the set cookie.

The next issue is guest can't view the gallery. When I go to view the gallery after I delete the cookie, it sends me back to the board's login page.

I would like to get those fixed. I'm kind of stuck and I'm unable to unbridge because my username was the same for both my board and gallery (and same password) but for some reason the gallery locked my password to only 8 or so characters (I have a strong 15 character password) so I'm having a hard time counting how many characters will be because the login form lets me type the whole thing... Lucky I left a page with the bridging open with a login to cancel it.

My only guess is the cookies are matching up because if it wasn't it wouldn't login me into the gallery and forum, but for someone reason when I logout it doesn't on the gallery part of it.

My board cookie settings are .majin-planet.com and the other two are blank. In CPG both cookie settings are blank.

Darth Unrivaled

Can someone at least point me to the topics if there has already been a discussion about this problem?

Nibbler

Try changing the logout link to http://www.majin-planet.com/sources/access/logout.html in the bridge file. Make sure you didnt block access to unregistered users in config.

Darth Unrivaled

Quote from: Nibbler on April 17, 2007, 03:32:52 PM
Try changing the logout link to http://www.majin-planet.com/sources/access/logout.html in the bridge file. Make sure you didnt block access to unregistered users in config.

Yeah I check that, and it wasn't set. But for some reason it was set so in the database and I can to change it by hand.

I try to change the logot link to my custom logot page, however it does log me out on the forums, but not on the gallery. It still shows me login and I'm still able to do stuff. I think the problems is the cookie for the gallery. The cookie host set by the gallery is www.majin-planet.com. I believe if I can change that to .majin-planet.com then when I logout it will work on both. however I can't find anywhere in the files or the database that sets the cookie value.

Nibbler

Coppermine doesn't specify the cookie domain. You'd need to add it in to the setcookie() calls. I don't think that is the problem though. I don't know how your logout system works.

Darth Unrivaled

<?
/**
* IPB SDK Code Snippet - Logout and redirect to a customized page
* Copyright (C) 2004 media++||webmechanic.biz
* Designed for IPB SDK 1.0
*
* This script logs out the current user and redirect
* her/him to any possible URL on this planet.
*
* @author CirTap <cirtap@otherone.org>
* @date   25.04.2004
*/

// Load and Start IPB SDK
require_once "/########/community/ipbsdk/ipbsdk_class.inc.php";
$GLOBALS['SDK'] =& new IPBSDK();

/*
where do you want to send 'em?
how 'bout this domain's homepage?

# For the sake of this example, JUST LEAVE THIS AS IS! OK?
# Believe me: this entry works!!
# Maybe you don't end up on YOUR personal homepage,
# but the one for this domain.

IF YOU CHANGE THIS IN YOUR OWN SCRIPT, you should
always provide a full URL incl. the domainname, i.e.
$redirect_to  = "http://ipbsdk.sourceforge.net/forums/"
*/
$css = $GLOBALS['SDK']->get_css();
$redirect_to  = $_SERVER['HTTP_REFERER'];
$redirect_msg = "Please wait while we transfer you...";

// Go!
if ( $GLOBALS['SDK']->logout() ) {
/*
the user was successfully logged out, now write some
redirect screen to correctly reset the $_COOKIES
for the destination URL in $redirect_to

Until this point, you MUST NOT send any output
to the browser or the Cookies will not be reset!
*/

echo <<<HTML
<html>
<head>
<title>Please stand by...</title>
<meta http-equiv="refresh" content="2; url={$redirect_to}" />
<link rel="stylesheet" type="text/css" media="screen" href="http://www.majin-planet.com/sources/css/default2.css" />
{$css}
</head>
<body>

<div id="redirectwrap">
<h4>You have been logged out.</h4>
<p>{$redirect_msg}<br/><div style="text-align:center;"><img src="http://community.majin-planet.com/style_images/theasylum07/loading.gif" width="86" height="10" alt="loading" /></div></p>
<p class="redirectfoot">(<a href="{$redirect_to}" target="_self">Click here, if you dont want to wait.</a>)</p>
</div>


</body>
</html>
HTML;



// make sure nothing follows...
exit();

}

// if we got here, something went wrong... but what could THAT be???
echo <<<HTML
<p><b>Logout failed</b>
<br />The last error returned was:</p>
HTML;

echo $GLOBALS['SDK']->sdk_error();

?>


Its a simple IPBSDK Logout function. This is the only to work it because in 2.2.x you have to have a session id attach to the url, which you can't do out of IPB for some reason. That is why when you go to the logout link thats the default of IPB it gives you an error. It has to have a session attached. The IPBSDK logout function gets the session threw it uses sessions. I'm not 100% sure how it works, but the problem I think may be because my forum cookie is being set by a subdomain but my gallery is not on a subdomain, which is resulting in the cookie not being reset on logout. However I'm not even sure how much of a problem that is or if it even is a problem because it seems to login just fine.

However even by going thre IPB's default logout link from the board itself (on the default skin) it still doesn't logout of the gallery.

Nibbler

Your logout page is not clearing the member_id and pass_hash cookies. It's not even trying in fact. I downloaded the IPB SDK and the code is there to do that. Are you using the latest version, apparently 1.6 beta 4?

Darth Unrivaled

Version 1.6 beta 4 isn't the latest. The most stable release is 1.6 beta 5, but only works on IPB 2.1.x series. The latest version that works for 2.2.x series is 1.7.0 Beta 1 which you have to get off http://svn.sourceforge.net/viewcvs.cgi/ipbsdk/

If as you say the members_id and pass_hash aren't being clear when its loaded, that could explain some things. However if they weren't being clear then I wouldn't even be logout on the forum itself. I don't think its a issue with the logout() function because it does work.

If I login and use the default logout link that is generated by IPB itself, it still doesn't log you out. So its not the logout script. If anything its something changed between 2.1.x series and 2.2.x series that prevents users from being logout threw the gallery.

I check and I saw lot of threads with people saying they have had problems with IPB 2.2.2 and logout. Maybe the bridge file needs to be updated because right now as far as I can tell whatever the problem is it has to be in the bridge file or the working of CPG that work but now doesn't due to IPB 2.2.x series.

I know its not up to CPG to fix this problem as its totally on IPB, but if anyone has a work around or maybe if someone who has a live IPB 2.2.2 and CPG 1.4.10 working logout fully then I could look into more deeper parts of maybe the SDK and or try to force those cookies to be clear by other means. Right now thought I doubt CPG + IPB 2.2.2 works fully.

Darth Unrivaled

Okay I talk to a friend of mine who also uses IPBSDK and he told me that in order to full logout I had to update the script as I wasn't using the logout function right.

I had to place $GLOBALS['SDK']->logout(); in the script before any output and then I could use the if else statement. He said it still logout me out either way but it would be saver to use the $GLOBALS['SDK']->logout(); before the if else statement.

So problem fixed, thanks for the help.