]> source.dussan.org Git - nextcloud-server.git/commitdiff
first check if the user is already logged in and then try to authenticate via apache... 12372/head
authorBjoern Schiessle <bjoern@schiessle.org>
Tue, 30 Oct 2018 21:11:17 +0000 (22:11 +0100)
committerBjoern Schiessle <bjoern@schiessle.org>
Fri, 9 Nov 2018 10:43:51 +0000 (11:43 +0100)
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
apps/dav/lib/Connector/Sabre/Auth.php

index fcd1b34edbc8c3ee4d1e3140a4a9639508712638..292be61c9dcccd07afc7b2eb3eb7994b0652462f 100644 (file)
@@ -228,11 +228,12 @@ class Auth extends AbstractBasic {
                        if($this->twoFactorManager->needsSecondFactor($this->userSession->getUser())) {
                                throw new \Sabre\DAV\Exception\NotAuthenticated('2FA challenge not passed.');
                        }
-                       if (\OC_User::handleApacheAuth() ||
+                       if (
                                //Fix for broken webdav clients
                                ($this->userSession->isLoggedIn() && is_null($this->session->get(self::DAV_AUTHENTICATED))) ||
                                //Well behaved clients that only send the cookie are allowed
-                               ($this->userSession->isLoggedIn() && $this->session->get(self::DAV_AUTHENTICATED) === $this->userSession->getUser()->getUID() && $request->getHeader('Authorization') === null)
+                               ($this->userSession->isLoggedIn() && $this->session->get(self::DAV_AUTHENTICATED) === $this->userSession->getUser()->getUID() && $request->getHeader('Authorization') === null) ||
+                               \OC_User::handleApacheAuth()
                        ) {
                                $user = $this->userSession->getUser()->getUID();
                                \OC_Util::setupFS($user);