Merge pull request #11130 from owncloud/moveBasicAuthCheck
Move basic auth check
This commit is contained in:
commit
f0bf46b080
1 changed files with 4 additions and 12 deletions
16
lib/base.php
16
lib/base.php
|
@ -710,15 +710,6 @@ class OC {
|
||||||
self::checkUpgrade();
|
self::checkUpgrade();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!OC_User::isLoggedIn()) {
|
|
||||||
// Test it the user is already authenticated using Apaches AuthType Basic... very usable in combination with LDAP
|
|
||||||
if (!OC_Config::getValue('maintenance', false) && !self::checkUpgrade(false)) {
|
|
||||||
OC_App::loadApps(array('authentication'));
|
|
||||||
}
|
|
||||||
OC::tryBasicAuthLogin();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (!self::$CLI and (!isset($_GET["logout"]) or ($_GET["logout"] !== 'true'))) {
|
if (!self::$CLI and (!isset($_GET["logout"]) or ($_GET["logout"] !== 'true'))) {
|
||||||
try {
|
try {
|
||||||
if (!OC_Config::getValue('maintenance', false) && !\OCP\Util::needUpgrade()) {
|
if (!OC_Config::getValue('maintenance', false) && !\OCP\Util::needUpgrade()) {
|
||||||
|
@ -842,8 +833,9 @@ class OC {
|
||||||
} // remember was checked after last login
|
} // remember was checked after last login
|
||||||
elseif (OC::tryRememberLogin()) {
|
elseif (OC::tryRememberLogin()) {
|
||||||
$error[] = 'invalidcookie';
|
$error[] = 'invalidcookie';
|
||||||
} // logon via web form
|
} // logon via web form or WebDAV
|
||||||
elseif (OC::tryFormLogin()) {
|
elseif (OC::tryFormLogin()) {}
|
||||||
|
elseif (OC::tryBasicAuthLogin()) {
|
||||||
$error[] = 'invalidpassword';
|
$error[] = 'invalidpassword';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -974,10 +966,10 @@ class OC {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (OC_User::login($_SERVER["PHP_AUTH_USER"], $_SERVER["PHP_AUTH_PW"])) {
|
if (OC_User::login($_SERVER["PHP_AUTH_USER"], $_SERVER["PHP_AUTH_PW"])) {
|
||||||
//OC_Log::write('core',"Logged in with HTTP Authentication", OC_Log::DEBUG);
|
|
||||||
OC_User::unsetMagicInCookie();
|
OC_User::unsetMagicInCookie();
|
||||||
$_SERVER['HTTP_REQUESTTOKEN'] = OC_Util::callRegister();
|
$_SERVER['HTTP_REQUESTTOKEN'] = OC_Util::callRegister();
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue