diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2013-10-02 00:55:35 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2013-10-02 00:55:35 +0200 |
commit | 4cecede13d74cc26f92aba50d415ff31d277ade5 (patch) | |
tree | a1c5ee60b102d44b9c8e063fa08f59377731287b /lib/base.php | |
parent | 493e948146e3ab0b58f15adb533854d7edef1212 (diff) | |
download | nextcloud-server-4cecede13d74cc26f92aba50d415ff31d277ade5.tar.gz nextcloud-server-4cecede13d74cc26f92aba50d415ff31d277ade5.zip |
code cleanup - remove special case for webdav in handleApacheAuth()
Diffstat (limited to 'lib/base.php')
-rw-r--r-- | lib/base.php | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/lib/base.php b/lib/base.php index f0a0b94a41f..56061ba53b3 100644 --- a/lib/base.php +++ b/lib/base.php @@ -756,14 +756,17 @@ class OC { protected static function handleLogin() { OC_App::loadApps(array('prelogin')); $error = array(); - if (OC::tryApacheAuth()) { + // auth possible via apache module? + if (OC::tryApacheAuth()) { + $error[] = 'apacheauthfailed'; } // remember was checked after last login elseif (OC::tryRememberLogin()) { $error[] = 'invalidcookie'; - // Someone wants to log in : - } elseif (OC::tryFormLogin()) { + } + // Someone wants to log in : + elseif (OC::tryFormLogin()) { $error[] = 'invalidpassword'; } @@ -782,7 +785,17 @@ class OC { } protected static function tryApacheAuth() { - return OC_User::handleApacheAuth(false); + $return = OC_User::handleApacheAuth(); + + // if return is true we are logged in -> redirect to the default page + if ($return === true) { + $_REQUEST['redirect_url'] = \OC_Request::requestUri(); + OC_Util::redirectToDefaultPage(); + exit; + } + + // in case $return is null apache based auth is not enabled + return is_null($return) ? false : true; } protected static function tryRememberLogin() { |