[Pkg-owncloud-commits] [php-sabredav] 153/220: Generating html for supported-privilege-set correctly.

David Prévot taffit at moszumanska.debian.org
Thu May 12 01:21:21 UTC 2016


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

taffit pushed a commit to branch master
in repository php-sabredav.

commit 5fb0abe4eb3b5a843a8066d8158ec7c638c52d59
Author: Evert Pot <me at evertpot.com>
Date:   Mon Apr 11 06:09:32 2016 -0400

    Generating html for supported-privilege-set correctly.
---
 lib/DAV/Browser/Plugin.php                        |  2 +-
 lib/DAVACL/Plugin.php                             |  4 +---
 lib/DAVACL/Xml/Property/SupportedPrivilegeSet.php | 10 +++++-----
 3 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/lib/DAV/Browser/Plugin.php b/lib/DAV/Browser/Plugin.php
index 7cee59b..481efef 100644
--- a/lib/DAV/Browser/Plugin.php
+++ b/lib/DAV/Browser/Plugin.php
@@ -48,7 +48,7 @@ class Plugin extends DAV\ServerPlugin {
     public $uninterestingProperties = [
         '{DAV:}supportedlock',
         '{DAV:}acl-restrictions',
-        '{DAV:}supported-privilege-set',
+//        '{DAV:}supported-privilege-set',
         '{DAV:}supported-method-set',
     ];
 
diff --git a/lib/DAVACL/Plugin.php b/lib/DAVACL/Plugin.php
index e9abaab..ab3ddf5 100644
--- a/lib/DAVACL/Plugin.php
+++ b/lib/DAVACL/Plugin.php
@@ -1014,9 +1014,7 @@ class Plugin extends DAV\ServerPlugin {
                 $propFind->set('{DAV:}current-user-privilege-set', null, 403);
             } else {
                 $val = $this->getCurrentUserPrivilegeSet($node);
-                if (!is_null($val)) {
-                    return new Xml\Property\CurrentUserPrivilegeSet($val);
-                }
+                return new Xml\Property\CurrentUserPrivilegeSet($val);
             }
         });
         $propFind->handle('{DAV:}acl', function() use ($node, $propFind, $path) {
diff --git a/lib/DAVACL/Xml/Property/SupportedPrivilegeSet.php b/lib/DAVACL/Xml/Property/SupportedPrivilegeSet.php
index 7c41abf..55e7783 100644
--- a/lib/DAVACL/Xml/Property/SupportedPrivilegeSet.php
+++ b/lib/DAVACL/Xml/Property/SupportedPrivilegeSet.php
@@ -93,9 +93,9 @@ class SupportedPrivilegeSet implements XmlSerializable, HtmlOutput {
      */
     function toHtml(HtmlOutputHelper $html) {
 
-        $traverse = function($priv) use (&$traverse, $html) {
+        $traverse = function($privName, $priv) use (&$traverse, $html) {
             echo "<li>";
-            echo $html->xmlName($priv['privilege']);
+            echo $html->xmlName($privName);
             if (isset($priv['abstract']) && $priv['abstract']) {
                 echo " <i>(abstract)</i>";
             }
@@ -104,8 +104,8 @@ class SupportedPrivilegeSet implements XmlSerializable, HtmlOutput {
             }
             if (isset($priv['aggregates'])) {
                 echo "\n<ul>\n";
-                foreach ($priv['aggregates'] as $subPriv) {
-                    $traverse($subPriv);
+                foreach ($priv['aggregates'] as $subPrivName => $subPriv) {
+                    $traverse($subPrivName, $subPriv);
                 }
                 echo "</ul>";
             }
@@ -114,7 +114,7 @@ class SupportedPrivilegeSet implements XmlSerializable, HtmlOutput {
 
         ob_start();
         echo "<ul class=\"tree\">";
-        $traverse($this->getValue());
+        $traverse('{DAV:}all', [ 'aggregates' => $this->getValue() ]);
         echo "</ul>\n";
 
         return ob_get_clean();

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



More information about the Pkg-owncloud-commits mailing list