diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2014-03-10 14:40:36 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2014-09-18 11:58:38 +0200 |
commit | b963723c212e7ad75ceda38f4b0922ae00c126b0 (patch) | |
tree | 71cbcf1e3ef4ad7a12634516552a2ed3dcec5bf3 /lib/private | |
parent | 7a2dbc25cb18ed4094c48c9b9e1d239fdc756534 (diff) | |
download | nextcloud-server-b963723c212e7ad75ceda38f4b0922ae00c126b0.tar.gz nextcloud-server-b963723c212e7ad75ceda38f4b0922ae00c126b0.zip |
close the session for all DAV calls right after authentication - no need to write to the session afterwards
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/connector/sabre/auth.php | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/private/connector/sabre/auth.php b/lib/private/connector/sabre/auth.php index 0c84fa6b757..5577273df8c 100644 --- a/lib/private/connector/sabre/auth.php +++ b/lib/private/connector/sabre/auth.php @@ -73,6 +73,20 @@ class OC_Connector_Sabre_Auth extends Sabre_DAV_Auth_Backend_AbstractBasic { */ public function authenticate(Sabre_DAV_Server $server, $realm) { + $result = $this->auth($server, $realm); + + // close the session - right after authentication there is not need to write to the session any more + \OC::$session->close(); + + return $result; + } + + /** + * @param Sabre_DAV_Server $server + * @param $realm + * @return bool + */ + private function auth(Sabre_DAV_Server $server, $realm) { if (OC_User::handleApacheAuth() || OC_User::isLoggedIn()) { $user = OC_User::getUser(); OC_Util::setupFS($user); @@ -81,5 +95,5 @@ class OC_Connector_Sabre_Auth extends Sabre_DAV_Auth_Backend_AbstractBasic { } return parent::authenticate($server, $realm); - } + } } |