Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.16.14

Bug #943 Logout problematic
Submitted: 2004-03-04 06:42 UTC
From: alain_d99 at freesurf dot ch Assigned: lsmith
Status: Closed Package: LiveUser
PHP Version: 4.2.1 OS: Windows
Roadmaps: (Not assigned)    
Subscription  


 [2004-03-04 06:42 UTC] alain_d99 at freesurf dot ch
Description: ------------ Hello, LiveUser.php: v1.79 I use the following schema: Config (partial): logout => array( 'trigger' => 'logout', 'destroy' => true ) File: AdminUser.php In the AdminUser.php, I use the code: $nLiveUser =& LiveUser::factory($Config); $nResult = $nLiveUser->init(); if(PEAR::isError($nResult)) HandleError1.... if(!$nResult) HandleError2... $if($nLiveUser->isLoggedIn()) {} else { HandleNotLogged... } The login process works perfectly well when I call: AdminUser.php?lang=fr if I call the following URL to logout: AdminUser.php?lang=fr&logout=1 the logout is made correctly and I go into the HandleError2. BUT I don't know if it is an error (cookies not set in browser by example when I log in) or a logout if I only use the LiveUser class, the 'status' gives me always LIVEUSER_STATUS_UNKNOWN. It would be great if the logout is clearly designed from LiveUser::init() if we don't use the key 'redirect' in the Config variable (here because I give lang=fr in the URL, a dynamic variable). Hope I am clear. Thank for your work, Alain

Comments

 [2004-03-05 14:49 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2004-03-05 16:04 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2004-03-06 09:23 UTC] alain_d99 at freesurf dot ch
Hello Smith, I copy your patch and test it. An error to correct in your patch in line ~769: if (!is_null($this->status)) { $this->status = LIVEUSER_STATUS_UNKNOWN; } return false; would be if (is_null($this->status)) { // STATUS MUST BE NULL $this->status = LIVEUSER_STATUS_UNKNOWN; } return false; And your solution works perfectly well, thanks Smith. Alain
 [2004-03-08 12:44 UTC] alain_d99 at freesurf dot ch
Hello Smith, another corrections with the introduction of LIVUSER_STATUS_LOGGEDOUT: processLogout() function sets the status variable, then in init() function: line: ~731 if ($lulogin && $this->_auth->loggedIn && $this->_auth->expireTime > 0 && $this->_auth->currentLogin > 0 && ($this->_auth->currentLogin + $this->_auth->expireTime) < time() ) { $this->expired = true; $this->status = LIVEUSER_STATUS_EXPIRED; $this->processLogout(true); } would be: if ($lulogin && $this->_auth->loggedIn && $this->_auth->expireTime > 0 && $this->_auth->currentLogin > 0 && ($this->_auth->currentLogin + $this->_auth->expireTime) < time() ) { $this->expired = true; $this->processLogout(true); //SWAP THE LAST TWO LINES $this->status = LIVEUSER_STATUS_EXPIRED; //NOW, OK } Must be made for LIVEUSER_STATUS_IDLED condition too. Thank, and greetings, Alain PS: my comment in #942 about redundancy of status, idled and expired variables can be problematic here, because logout() function use idled and expired variables and change the status variable
 [2004-03-08 12:47 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2004-03-08 21:10 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!