Some hotfixes to make creating shares work.
authorGunnar Wrobel <p@rdus.de>
Mon, 15 Mar 2010 09:59:25 +0000 (10:59 +0100)
committerGunnar Wrobel <wrobel@temple.(none)>
Mon, 15 Mar 2010 10:33:26 +0000 (11:33 +0100)
framework/Kolab_Storage/lib/Horde/Kolab/Storage/Folder.php
framework/Kolab_Storage/lib/Horde/Kolab/Storage/Permission.php

index d06be64..017e411 100644 (file)
@@ -434,7 +434,7 @@ class Horde_Kolab_Storage_Folder
                 // setAnnotation apparently does not suppoort UTF-8 nor any special characters
                 $store = base64_encode($value);
                 if ($key == 'desc') {
-                    $entry = '/comment';
+                    $entry = '/shared/comment';
                 } else {
                     $entry = self::ANNOT_SHARE_ATTR . $key;
                 }
@@ -1260,12 +1260,12 @@ class Horde_Kolab_Storage_Folder
      */
     function setPermission(&$perms, $update = true)
     {
-        if (!is_a($perms, 'Horde_Permission')) {
-            return PEAR::raiseError('The permissions for this share must be specified as an instance of the Horde_Permission class!');
+        if (!is_a($perms, 'Horde_Perms_Permission')) {
+            return PEAR::raiseError('The permissions for this share must be specified as an instance of the Horde_Perms_Permission class!');
         }
 
-        if (!is_a($perms, 'Horde_Permission_Kolab')) {
-            $this->_perms = new Horde_Permission_Kolab($this, $perms->data);
+        if (!is_a($perms, 'Horde_Kolab_Storage_Permission')) {
+            $this->_perms = new Horde_Kolab_Storage_Permission($this, $perms->data);
         } else {
             $this->_perms = $perms;
             $this->_perms->setFolder($this);
index c3fe6f0..200543a 100644 (file)
@@ -149,9 +149,10 @@ class Horde_Kolab_Storage_Permission extends Horde_Perms_Permission
 
         // Loop through the returned users
         $data = array();
-        foreach ($acl as $user => $rights) {
+        foreach ($acl as $user => $r) {
             // Convert the user rights to horde format
             $result = 0;
+            $rights = join('', $r);
             for ($i = 0, $j = strlen($rights); $i < $j; $i++) {
                 switch ($rights[$i]) {
                 case 'l':