Temporarily fix handling of return values from the Imap_Client library
authorGunnar Wrobel <p@rdus.de>
Thu, 11 Mar 2010 18:48:16 +0000 (19:48 +0100)
committerGunnar Wrobel <wrobel@temple.(none)>
Thu, 11 Mar 2010 21:35:01 +0000 (22:35 +0100)
so that Kolab_Storage can be used by the applications.

framework/Kolab_Storage/lib/Horde/Kolab/Storage/Driver/Imap.php

index bfd99cd..8c1a505 100644 (file)
@@ -278,7 +278,17 @@ class Horde_Kolab_Storage_Driver_Imap extends Horde_Kolab_Storage_Driver
             return $acl;
         }
 
-        return $this->_imap->getACL($folder);
+        try {
+            return $this->_imap->getACL($folder);
+        } catch (Exception $e) {
+            try {
+                return $this->_imap->getMyACLRights($folder);
+            } catch (Exception $e) {
+                $acl = array();
+                $acl[Horde_Auth::getAuth()] = 'lrid';
+                return $acl;
+            }
+        }            
     }
 
     /**
@@ -305,8 +315,12 @@ class Horde_Kolab_Storage_Driver_Imap extends Horde_Kolab_Storage_Driver
      */
     function getAnnotation($entry, $mailbox_name)
     {
-        $result = $this->_imap->getMetadata($mailbox_name, $entry);
-        return $result[$mailbox_name][$entry];
+        try {
+            $result = $this->_imap->getMetadata($mailbox_name, $entry);
+        } catch (Exception $e) {
+            return '';
+        }
+        return isset($result[$mailbox_name][$entry]) ? $result[$mailbox_name][$entry] : '';
     }
 
     /**