]> source.dussan.org Git - nextcloud-server.git/commitdiff
Don't barf on OC_Connector_Sabre_Principal::getGroupMemberSet
authorThomas Tanghus <thomas@tanghus.net>
Thu, 15 Aug 2013 23:46:31 +0000 (01:46 +0200)
committerThomas Tanghus <thomas@tanghus.net>
Thu, 15 Aug 2013 23:46:31 +0000 (01:46 +0200)
Refs: owncloud/contacts#166 and owncloud/calendar#102

lib/connector/sabre/principal.php

index 16c88b96ea6fc4dbcf8b9f941eee48c38836c52e..59a96797c160a0198d9410265b866318c84da9d3 100644 (file)
@@ -66,13 +66,13 @@ class OC_Connector_Sabre_Principal implements Sabre_DAVACL_IPrincipalBackend {
         */
        public function getGroupMemberSet($principal) {
                // TODO: for now the group principal has only one member, the user itself
-               list($prefix, $name) = Sabre_DAV_URLUtil::splitPath($principal);
-
-               $principal = $this->getPrincipalByPath($prefix);
-               if (!$principal) throw new Sabre_DAV_Exception('Principal not found');
+               $principal = $this->getPrincipalByPath($principal);
+               if (!$principal) {
+                       throw new Sabre_DAV_Exception('Principal not found');
+               }
 
                return array(
-                       $prefix
+                       $principal['uri']
                );
        }
 
@@ -88,7 +88,9 @@ class OC_Connector_Sabre_Principal implements Sabre_DAVACL_IPrincipalBackend {
                $group_membership = array();
                if ($prefix == 'principals') {
                        $principal = $this->getPrincipalByPath($principal);
-                       if (!$principal) throw new Sabre_DAV_Exception('Principal not found');
+                       if (!$principal) {
+                               throw new Sabre_DAV_Exception('Principal not found');
+                       }
 
                        // TODO: for now the user principal has only its own groups
                        return array(