cvs: pear /Auth Auth.php
| From: | Martin Jansen | Date: | Mon, 10 Sep 2001 17:14:51 +0000 |
| Subject: | cvs: pear /Auth Auth.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-829@lists.php.net to get a copy of this message | ||
mj Mon Sep 10 13:14:51 2001 EDT
Modified files:
/pear/Auth Auth.php
Log:
* Make drawLogin working properly even when register_globals = off
Index: pear/Auth/Auth.php
diff -u pear/Auth/Auth.php:1.3 pear/Auth/Auth.php:1.4
--- pear/Auth/Auth.php:1.3 Sun Jul 22 07:57:41 2001
+++ pear/Auth/Auth.php Mon Sep 10 13:14:51 2001
@@ -16,10 +16,10 @@
// | Authors: Martin Jansen <mj@php.net> |
// +----------------------------------------------------------------------+
//
-// $Id: Auth.php,v 1.3 2001/07/22 11:57:41 mj Exp $
+// $Id: Auth.php,v 1.4 2001/09/10 17:14:51 mj Exp $
//
- /**
+/**
* PEAR::Auth
*
* The PEAR::Auth class provides methods for creating an
@@ -45,7 +45,7 @@
*
* @author Martin Jansen <mj@php.net>
* @package Auth
- * @version 0.2 2001-07-21
+ * @version 0.3 2001-08-22
*/
class Auth
{
@@ -116,6 +116,7 @@
// }}}
// {{{ _factory
+
/**
* Return a storage driver based on $driver and $options
*
@@ -168,6 +169,8 @@
/**
* Start new auth session
+ *
+ * @access private
*/
function start()
{
@@ -185,6 +188,8 @@
/**
* Login function
+ *
+ * @access private
*/
function login()
{
@@ -231,6 +236,7 @@
/**
* Checks if there is a session with valid auth information.
*
+ * @access private
* @return boolean Whether or not the user is authenticated.
*/
function checkAuth()
@@ -321,12 +327,14 @@
* this, it will look terrible :-).
*
* @access public
+ * @global $HTTP_SERVER_VARS
* @param string Username if already entered
* @param string Password if already entered
*/
function drawLogin($username = "", $password = "")
{
-
+ global $HTTP_SERVER_VARS;
+
echo "<center>\n";
if ($this->expired) {
@@ -335,7 +343,7 @@
echo "<i>You have been idle for too long. Please login
again!</i>\n";
}
- echo "<form method=\"post\"
action=\"".$GLOBALS['PHP_SELF']."\">\n";
+ echo "<form method=\"post\"
action=\"".$HTTP_SERVER_VARS['PHP_SELF']."\">\n";
echo "<table border=\"0\" cellpadding=\"2\"
cellspacing=\"0\">\n";
echo "<tr>\n";
echo " <td colspan=\"2\"
bgcolor=\"#eeeeee\"><b>Login:</b></td>\n";
@@ -412,5 +420,4 @@
// }}}
}
-
?>