cvs: pear /LiveUser LiveUser.php

From: Date: Mon, 07 Feb 2005 11:47:19 +0000
Subject: cvs: pear /LiveUser LiveUser.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-29168@lists.php.net to get a copy of this message
lsmith Mon Feb 7 06:47:19 2005 EDT Modified files: /pear/LiveUser LiveUser.php Log: - removed allowDuplicateHandles auth option - added updateLastLogin auth option - various cosmetic fixes - unfreeze() before logging out to ensure that the user data is available on logout http://cvs.php.net/diff.php/pear/LiveUser/LiveUser.php?r1=1.37&r2=1.38&ty=u Index: pear/LiveUser/LiveUser.php diff -u pear/LiveUser/LiveUser.php:1.37 pear/LiveUser/LiveUser.php:1.38 --- pear/LiveUser/LiveUser.php:1.37 Tue Feb 1 19:18:56 2005 +++ pear/LiveUser/LiveUser.php Mon Feb 7 06:47:19 2005 @@ -156,7 +156,7 @@ * @author Lukas Smith <smith@backendmedia.com> * @author Pierre-Alain Joye <pajoye@php.net> * @author Arnaud Limbourg <arnaud@php.net> - * @version $Id: LiveUser.php,v 1.37 2005/02/02 00:18:56 dufuz Exp $ + * @version $Id: LiveUser.php,v 1.38 2005/02/07 11:47:19 lsmith Exp $ * @package LiveUser */ class LiveUser @@ -393,7 +393,7 @@ * 'loginTimeout' => 0, * 'expireTime' => 3600, * 'idleTime' => 1800, - * 'allowDuplicateHandles' => 0, + * 'updateLastLogin' => true, * 'authTable' => 'liveuser_users', * 'authTableCols' => array( * 'required' => array( @@ -498,8 +498,7 @@ $signature = serialize(array($handle, $passwd, $confName)); if (!isset($instances[$signature])) { $obj = &LiveUser::factory( - $conf, $handle, $passwd, $logout, - $remember, $confName + $conf, $handle, $passwd, $logout, $remember, $confName ); $instances[$signature] =& $obj; } @@ -896,13 +895,13 @@ } } + // Try to fetch auth object from session + $this->unfreeze(); + if ($logout || $handle) { $this->logout($logout); } - // Try to fetch auth object from session - $this->unfreeze(); - if ($this->isLoggedIn()) { // Check if user authenticated with new credentials if ($handle && $this->_auth->handle != $handle) { @@ -967,11 +966,14 @@ $this->status = LIVEUSER_STATUS_AUTHFAILED; //loop into auth containers while ($backend_cnt > $counter) { - $auth = &$this->authFactory($this->authContainers[$backends[$counter]], $backends[$counter]); + $auth = &$this->authFactory( + $this->authContainers[$backends[$counter]], + $backends[$counter] + ); if ($auth === false) { return false; } - $auth->login($handle, $passwd, true); + $auth->login($handle, $passwd); if ($auth->loggedIn) { $this->_auth = $auth; $this->_auth->backendArrayIndex = $backends[$counter]; @@ -982,7 +984,10 @@ return false; } $this->_perm =& $perm; - $this->_perm->mapUser($this->_auth->authUserId, $this->_auth->backendArrayIndex); + $this->_perm->mapUser( + $this->_auth->authUserId, + $this->_auth->backendArrayIndex + ); } $this->freeze(); $this->setRememberCookie($handle, $passwd, $remember);

« previous php.pear.cvs (#29168) next »