plugins/libkolab

Thomas Brüderli bruederli at kolabsys.com
Wed Nov 21 09:56:42 CET 2012


 plugins/libkolab/lib/kolab_format_event.php |   15 ++++++++++++++-
 plugins/libkolab/lib/kolab_storage.php      |   12 ++++++++++++
 2 files changed, 26 insertions(+), 1 deletion(-)

New commits:
commit ace437f1dacd0471f36bc4abfba030c830ce0eab
Author: Thomas Bruederli <bruederli at kolabsys.com>
Date:   Wed Nov 21 09:56:21 2012 +0100

    Log errors if some libkolab modules are missing

diff --git a/plugins/libkolab/lib/kolab_format_event.php b/plugins/libkolab/lib/kolab_format_event.php
index d1e6b2e..bcd6de1 100644
--- a/plugins/libkolab/lib/kolab_format_event.php
+++ b/plugins/libkolab/lib/kolab_format_event.php
@@ -52,7 +52,20 @@ class kolab_format_event extends kolab_format_xcal
      */
     public function to_libcal()
     {
-        return class_exists('kolabcalendaring') ? new EventCal($this->obj) : false;
+        static $error_logged = false;
+
+        if (class_exists('kolabcalendaring')) {
+            return new EventCal($this->obj);
+        }
+        else if (!$error_logged) {
+            $error_logged = true;
+            rcube::raise_error(array(
+                'code' => 900, 'type' => 'php',
+                'message' => "required kolabcalendaring module not found"
+            ), true);
+        }
+
+        return false;
     }
 
     /**
diff --git a/plugins/libkolab/lib/kolab_storage.php b/plugins/libkolab/lib/kolab_storage.php
index ac7de34..4c9e75d 100644
--- a/plugins/libkolab/lib/kolab_storage.php
+++ b/plugins/libkolab/lib/kolab_storage.php
@@ -63,6 +63,18 @@ class kolab_storage
             ));
             self::$imap->set_pagesize(9999);
         }
+        else if (!class_exists('kolabformat')) {
+            rcube::raise_error(array(
+                'code' => 900, 'type' => 'php',
+                'message' => "required kolabformat module not found"
+            ), true);
+        }
+        else {
+            rcube::raise_error(array(
+                'code' => 900, 'type' => 'php',
+                'message' => "IMAP server doesn't support METADATA or ANNOTATEMORE"
+            ), true);
+        }
 
         return self::$ready;
     }





More information about the commits mailing list