diff options
author | Lukas Reschke <lukas@owncloud.com> | 2015-01-20 13:38:36 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2015-01-20 13:38:36 +0100 |
commit | fedc7c6f34f659401f503d6306faff65f5eecf6a (patch) | |
tree | 77838841c4a98f8cbc3282e3b826f38643863eaa | |
parent | 2fe6513557e22653551cfe59c006282c3793b1b9 (diff) | |
parent | 476579b9c64753ec4e614b64f5a931b39eb2ddaa (diff) | |
download | nextcloud-server-fedc7c6f34f659401f503d6306faff65f5eecf6a.tar.gz nextcloud-server-fedc7c6f34f659401f503d6306faff65f5eecf6a.zip |
Merge pull request #13497 from owncloud/fix-basic-auth-for-session
Fix WebDAV auth for session authentication only
-rw-r--r-- | lib/private/connector/sabre/auth.php | 6 | ||||
-rw-r--r-- | lib/private/user.php | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/private/connector/sabre/auth.php b/lib/private/connector/sabre/auth.php index f40706b73e3..533d250d68e 100644 --- a/lib/private/connector/sabre/auth.php +++ b/lib/private/connector/sabre/auth.php @@ -101,7 +101,6 @@ class OC_Connector_Sabre_Auth extends \Sabre\DAV\Auth\Backend\AbstractBasic { public function authenticate(\Sabre\DAV\Server $server, $realm) { $result = $this->auth($server, $realm); - return $result; } @@ -111,10 +110,13 @@ class OC_Connector_Sabre_Auth extends \Sabre\DAV\Auth\Backend\AbstractBasic { * @return bool */ private function auth(\Sabre\DAV\Server $server, $realm) { - if (OC_User::handleApacheAuth()) { + if (OC_User::handleApacheAuth() || + (OC_User::isLoggedIn() && is_null(\OC::$server->getSession()->get(self::DAV_AUTHENTICATED))) + ) { $user = OC_User::getUser(); OC_Util::setupFS($user); $this->currentUser = $user; + \OC::$server->getSession()->close(); return true; } diff --git a/lib/private/user.php b/lib/private/user.php index d66354b247d..d1fedffcaaf 100644 --- a/lib/private/user.php +++ b/lib/private/user.php @@ -320,7 +320,7 @@ class OC_User { * Tries to login the user with HTTP Basic Authentication */ public static function tryBasicAuthLogin() { - if(!empty($_SERVER['PHP_AUTH_USER']) && !empty($_SERVER['PHP_AUTH_USER'])) { + if(!empty($_SERVER['PHP_AUTH_USER']) && !empty($_SERVER['PHP_AUTH_PW'])) { \OC_User::login($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']); } } |