[ Thread Index |
Date Index
| More lists.tuxfamily.org/cllfst Archives
]
- To: cllfst@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [cllfst] conference
- From: hatem ounis <ounishatem@xxxxxxxxx>
- Date: Tue, 6 Apr 2010 16:57:18 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:content-type; bh=IkDAcl+7QwMFzgoY2uUufTBPWQIlfb9w6gPMJa8Bh8A=; b=AhiPLXa1FHEM253nKuboVUD+inH75E0+N6yKiLLrNnssOBERRXYqKa4sQ9pUxTDcN8 SgN1jDmy3E1Md2fqp+AAd+LSFWhsfmIlou46kdh541oH7jGZcdXzfco7iQyP/QxIGVaK 7LLWEcTGatA1zEps+F1Noh1qIDbIj9rbjZ2s8=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Uvq+9b632HTVNs38QcS5WIczXMZwpQZgX+vxo95EJBPWSGRkC5yrWZN9hugi1gK+gM 9JsDaqouxyRWOJDfTz6NfA09b94qQZSyPkZTjgbOJpFHzHXHOGkfApcjr8+vciwTuGaG ixIqTHexMds21p/RAdi+3qShFkUDiqHcVxPP8=
This is how i solved it. now i have anonymous user neither by creating that anonymous user nor having two separate urls for the authentication:
function authenticate() {
if (!isset($_SERVER['PHP_AUTH_USER']);) {
$this->setHeader();
} else {
$username = $_SERVER['PHP_AUTH_USER'];
$password = $_SERVER['PHP_AUTH_PW'];
$user = new User()->login($username, $password);
// if the user entered a wrong username or password
// if blank the user is considered as anonymous
if ($user->isAnonymous() && ($username || $password)) {
$this->setHeader();
} else {
return $user;
}
}
}
function setHeader() {
header('WWW-Authenticate: Basic realm="My Realm"');
header('HTTP/1.0 401 Unauthorized');
// text returned when user hit cancel
echo $GLOBALS['Language']->getText('plugin_webdav_common', 'authentication_required');
die();
}