cvs: pear /LiveUser/Auth Common.php

From: Date: Mon, 28 Nov 2005 19:52:48 +0000
Subject: cvs: pear /LiveUser/Auth Common.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-36576@lists.php.net to get a copy of this message
lsmith Mon Nov 28 14:52:48 2005 EDT Modified files: /pear/LiveUser/Auth Common.php Log: - removed loginTimeout feature (disable lastlogin if you are concerned about the cost of updating the lastlogin time) - phpdoc fixes http://cvs.php.net/diff.php/pear/LiveUser/Auth/Common.php?r1=1.40&r2=1.41&ty=u Index: pear/LiveUser/Auth/Common.php diff -u pear/LiveUser/Auth/Common.php:1.40 pear/LiveUser/Auth/Common.php:1.41 --- pear/LiveUser/Auth/Common.php:1.40 Mon Nov 28 07:35:32 2005 +++ pear/LiveUser/Auth/Common.php Mon Nov 28 14:52:44 2005 @@ -40,7 +40,7 @@ * @author Bjoern Kraus <krausbn@php.net> * @copyright 2002-2005 Markus Wolff * @license http://www.gnu.org/licenses/lgpl.txt - * @version CVS: $Id: Common.php,v 1.40 2005/11/28 12:35:32 lsmith Exp $ + * @version CVS: $Id: Common.php,v 1.41 2005/11/28 19:52:44 lsmith Exp $ * @link http://pear.php.net/LiveUser */ @@ -75,15 +75,6 @@ var $currentLogin = 0; /** - * Number of hours that must pass between two logins - * to be counted as a new login. Comes in handy in - * some situations. - * - * @var integer - */ - var $loginTimeout = 12; - - /** * Auth maximum lifetime in seconds * * If this variable is set to 0, auth never expires @@ -373,33 +364,12 @@ } /** - * Checks if there's enough time between lastLogin - * and current login (now) to count as a new login. - * - * @return boolean true if it is a new login, false if not - * - * @access public - */ - function isNewLogin() - { - if (!array_key_exists('lastlogin', $this->propertyValues)) { - return true; - } - $meantime = $this->loginTimeout * 3600; - if (time() >= $this->propertyValues['lastlogin'] + $meantime) { - return true; - } else { - return false; - } - } - - /** * Tries to make a login with the given handle and password. * A user can't login if he's not active. * * @param string user handle * @param string user password - * @return boolean true on success or false on failure + * @return boolean null when user is inactive, true on success or false on failure * * @access public */ @@ -424,9 +394,8 @@ $this->currentLogin = time(); } - // In case Login was successful, check if this can be counted - // as a _new_ login by definition... - if ($this->loggedIn && $this->isNewLogin()) { + // In case Login was successful update user data + if ($this->loggedIn) { $this->_updateUserData(); } @@ -451,8 +420,7 @@ } /** - * Reads auth_user_id, passwd, is_active flag - * lastlogin timestamp from the database + * Reads user data from the given data source * If only $handle is given, it will read the data * from the first user with that handle and return * true on success. @@ -550,12 +518,13 @@ /** * properly disconnect from resources * - * @return void + * @return boolean true on success or false on failure * * @access public */ function disconnect() { + return true } }

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