Date: 04/06/01
- Next message: Stephen Woodbridge: "[phplib] HELP: phplib leaving processes in MySQL"
- Previous message: Holger Bahr: "[phplib] Re: Loginform on every page"
- In reply to: mark <email protected>: "[phplib] Loginform on every page"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Here's a bit of code that someone sent me. Works for me.
Add this to your auth class in local.inc
---------------------------------------------
function login_if($attempt) {
global $sess, $username, $password;
$challenge = md5(uniqid($this->magic));
$sess->register("challenge");
if ($attempt && ( "nobody" == $this->auth["uid"])) {
$uid = false;
$uid = $this->auth_validatelogin();
}
if($uid) {
$this->auth["uid"] = $uid;
$this->auth["uname"] = $username;
}
return $challenge;
}
-----------------------------------------------
The put this after page open
-----------------------------------------------
$challenge = $auth->login_if($username);
-----------------------------------------------
If the username/password is wrong check if username is set to print the
error.
ie.
if(isset($username))
{
// wrong username/password message
}
HTH
M@
---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>
- Next message: Stephen Woodbridge: "[phplib] HELP: phplib leaving processes in MySQL"
- Previous message: Holger Bahr: "[phplib] Re: Loginform on every page"
- In reply to: mark <email protected>: "[phplib] Loginform on every page"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

