Merge pull request #4578 from houbaastef/master

fixes #4574
This commit is contained in:
Stephane Martin 2013-08-30 06:20:07 -07:00
commit 95f42d6544
1 changed files with 10 additions and 5 deletions

View File

@ -815,11 +815,16 @@ class OC {
) { ) {
return false; return false;
} }
OC_App::loadApps(array('authentication')); // don't redo authentication if user is already logged in
if (OC_User::login($_SERVER["PHP_AUTH_USER"], $_SERVER["PHP_AUTH_PW"])) { // otherwise session would be invalidated in OC_User::login with
//OC_Log::write('core',"Logged in with HTTP Authentication", OC_Log::DEBUG); // session_regenerate_id at every page load
OC_User::unsetMagicInCookie(); if (!OC_User::isLoggedIn()) {
$_SERVER['HTTP_REQUESTTOKEN'] = OC_Util::callRegister(); OC_App::loadApps(array('authentication'));
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();
$_SERVER['HTTP_REQUESTTOKEN'] = OC_Util::callRegister();
}
} }
return true; return true;
} }