[Pkg-owncloud-commits] [php-sabredav] 03/07: Don't trigger auth twice.

David Prévot taffit at moszumanska.debian.org
Tue Aug 11 13:35:33 UTC 2015


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

taffit pushed a commit to tag 3.0.3
in repository php-sabredav.

commit 1b13d936733b2d1654d31ab672904216d06fc4aa
Author: Evert Pot <me at evertpot.com>
Date:   Thu Aug 6 16:13:58 2015 -0400

    Don't trigger auth twice.
---
 lib/DAV/Auth/Plugin.php | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/lib/DAV/Auth/Plugin.php b/lib/DAV/Auth/Plugin.php
index 444fca4..bea242e 100644
--- a/lib/DAV/Auth/Plugin.php
+++ b/lib/DAV/Auth/Plugin.php
@@ -137,6 +137,23 @@ class Plugin extends ServerPlugin {
      */
     function beforeMethod(RequestInterface $request, ResponseInterface $response) {
 
+        if ($this->currentPrincipal) {
+
+            // We already have authentication information. This means that the
+            // event has already fired earlier, and is now likely fired for a
+            // sub-request.
+            //
+            // We don't want to authenticate users twice, so we simply don't do
+            // anything here. See Issue #700 for additional reasoning.
+            //
+            // This is not a perfect solution, but will be fixed once the
+            // "currently authenticated principal" is information that's not
+            // not associated with the plugin, but rather per-request.
+            //
+            // See issue #580 for more information about that.
+            return;
+
+        }
         if (!$this->backends) {
             throw new \Sabre\DAV\Exception('No authentication backends were configured on this server.');
         }

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



More information about the Pkg-owncloud-commits mailing list