[Pkg-owncloud-commits] [owncloud] 26/50: close the session for all DAV calls right after authentication - no need to write to the session afterwards

David Prévot taffit at moszumanska.debian.org
Fri Oct 17 03:12:13 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag v6.0.6RC1
in repository owncloud.

commit b963723c212e7ad75ceda38f4b0922ae00c126b0
Author: Thomas Müller <thomas.mueller at tmit.eu>
Date:   Mon Mar 10 14:40:36 2014 +0100

    close the session for all DAV calls right after authentication - no need to write to the session afterwards
---
 lib/private/connector/sabre/auth.php | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/lib/private/connector/sabre/auth.php b/lib/private/connector/sabre/auth.php
index 0c84fa6..5577273 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);
-    }
+	}
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list