Update of /cvsroot/phplib/php-lib/pages
In directory usw-pr-cvs1:/tmp/cvs-serv24350
Modified Files:
defauth.php3
Log Message:
fix a long-standing problem that prevented the demo "relogin" from working as expected.
Index: defauth.php3
===================================================================
RCS file: /cvsroot/phplib/php-lib/pages/defauth.php3,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** defauth.php3 1999/04/30 19:51:29 1.2
--- defauth.php3 2001/08/18 09:41:31 1.3
***************
*** 18,21 ****
--- 18,32 ----
// NOTE: We are using Example_Default_Auth here...
page_open(array("sess" => "Example_Session", "auth" => "Example_Default_Auth", "perm" => "Example_Perm", "user" => "Example_User"));
+
+ // Remove the "again=yes" from QUERY_STRING. This is required
+ // because the login form will be submitted to the URL of this
+ // page. This URL is constructed from $PHP_SELF and $QUERY_STRING.
+ // So, we need to remove this parameter from QUERY_STRING or else
+ // after the user submits a username and password, we will unauth
+ // them before they even get logged in!
+ $QUERY_STRING = ereg_replace(
+ "(^|&)again=yes(&|$)",
+ "\\1", $QUERY_STRING);
+
$auth->login_if($again); // relogin, if this was requested...
$user->register("u"); // register our user variable...
|