cvs: pear /Auth Auth.php
| From: | Martin Jansen | Date: | Mon, 26 Nov 2001 15:48:26 +0000 |
| Subject: | cvs: pear /Auth Auth.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-1411@lists.php.net to get a copy of this message | ||
mj Mon Nov 26 10:48:26 2001 EDT
Modified files:
/pear/Auth Auth.php
Log:
* Add possibility to store more information from the storage container
in the session.
Index: pear/Auth/Auth.php
diff -u pear/Auth/Auth.php:1.14 pear/Auth/Auth.php:1.15
--- pear/Auth/Auth.php:1.14 Tue Nov 20 09:17:28 2001
+++ pear/Auth/Auth.php Mon Nov 26 10:48:24 2001
@@ -16,10 +16,9 @@
// | Authors: Martin Jansen <mj@php.net> |
// +----------------------------------------------------------------------+
//
-// $Id: Auth.php,v 1.14 2001/11/20 14:17:28 mj Exp $
+// $Id: Auth.php,v 1.15 2001/11/26 15:48:24 mj Exp $
//
-
/**
* PEAR::Auth
*
@@ -48,7 +47,7 @@
*
* @author Martin Jansen <mj@php.net>
* @package Auth
- * @version $Revision: 1.14 $
+ * @version $Revision: 1.15 $
*/
define("AUTH_IDLED", -1);
@@ -312,10 +311,11 @@
* has logged in successfully
*
* @param string Username
+ * @param array Additional information that is stored in
+ * the session.
*/
- function setAuth($username)
+ function setAuth($username, $data = array())
{
-
if (!isset($GLOBALS['HTTP_SESSION_VARS']['auth'])) {
session_register('auth');
}
@@ -325,6 +325,10 @@
$GLOBALS['auth']['username'] = $username;
$GLOBALS['auth']['timestamp'] = time();
$GLOBALS['auth']['idle'] = time();
+
+ if (count($data) > 0) {
+ $GLOBALS['auth']['data'] = $data;
+ }
}
// }}}
@@ -337,7 +341,6 @@
*/
function getAuth()
{
-
if ($GLOBALS['HTTP_SESSION_VARS']['auth']['registered'] ==
true) {
return true;
} else {