made work with http authentication kind of sso login

This commit is contained in:
Patrick Stricker 2011-10-13 10:04:39 +02:00
parent 9d3c7badb5
commit 2cc5f5e19e

View file

@ -100,6 +100,18 @@ else {
$error = true;
}
}
// The user is already authenticated using Apaches AuthType Basic... very usable in combination with LDAP
elseif(isset($_SERVER["PHP_AUTH_USER"]) && isset($_SERVER["PHP_AUTH_PW"]))
{
if (OC_User::login($_SERVER["PHP_AUTH_USER"],$_SERVER["PHP_AUTH_PW"]))
{
OC_User::unsetMagicInCookie();
OC_Util::redirectToDefaultPage();
}
else
{
$error = true;
}
}
OC_Template::printGuestPage('', 'login', array('error' => $error, 'redirect' => isset($_REQUEST['redirect_url'])?$_REQUEST['redirect_url']:'' ));
}