cvs: pear /Perm_LiveUser LoginManager.php
| From: | Bj�rn Kraus | Date: | Sun, 23 Mar 2003 21:06:06 +0000 |
| Subject: | cvs: pear /Perm_LiveUser LoginManager.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-9598@lists.php.net to get a copy of this message | ||
krausbn Sun Mar 23 16:06:06 2003 EDT
Modified files:
/pear/Perm_LiveUser LoginManager.php
Log:
Added auth status, but not fully implemented yet.
Index: pear/Perm_LiveUser/LoginManager.php
diff -u pear/Perm_LiveUser/LoginManager.php:1.73 pear/Perm_LiveUser/LoginManager.php:1.74
--- pear/Perm_LiveUser/LoginManager.php:1.73 Sun Mar 23 14:22:41 2003
+++ pear/Perm_LiveUser/LoginManager.php Sun Mar 23 16:06:05 2003
@@ -41,6 +41,16 @@
define('LIVEUSER_MISSING_DEPS', -6);
/**#@-*/
+/**#@+
+ * Status is the current user.
+ */
+define('LIVEUSER_AUTH_OK', 1);
+define('LIVEUSER_AUTH_IDLED', -1);
+define('LIVEUSER_AUTH_EXPIRED', -2);
+define('LIVEUSER_AUTH_WRONG_LOGIN', -3);
+define('LIVEUSER_AUTH_ISINACTIVE', -4);
+/**#@-*/
+
/**
* Class LoginManager - Login handling class
*
@@ -75,7 +85,7 @@
* Bjoern Schotte, Kristian Koehntopp, Antonio Guerra
*
* @author Markus Wolff <wolff@21st.de>
- * @version $Id: LoginManager.php,v 1.73 2003/03/23 19:22:41 arnaud Exp $
+ * @version $Id: LoginManager.php,v 1.74 2003/03/23 21:06:05 krausbn Exp $
* @package LiveUser
*/
class LoginManager extends PEAR
@@ -272,6 +282,13 @@
var $idled = false;
/**
+ * Current authentication status
+ *
+ * @var string
+ */
+ var $status = NULL;
+
+ /**
* Posible Types of the config file and it's import function.
*
* @var array
@@ -374,6 +391,7 @@
($this->_auth->currentLogin + $this->_auth->expireTime) < time()) {
$this->expired = true;
+ $this->status = LIVEUSER_AUTH_EXPIRED;
$this->processLogout();
}
@@ -384,6 +402,7 @@
($_SESSION[$this->sessionVarName]['idle'] + $this->_auth->idleTime)
< time()) {
$this->idled = true;
+ $this->status = LIVEUSER_AUTH_IDLED;
$this->processLogout();
}
$_SESSION[$this->sessionVarName]['idle'] = time();
@@ -1047,6 +1066,18 @@
}
return $that;
}
+
+ /**
+ * Get the current status
+ *
+ * @access public
+ * @return integer
+ */
+ function getStatus()
+ {
+ return $this->status;
+ }
+
}