Tinebase Email Quota - more robust in case no email backend configured
authorPaul Mehrer <p.mehrer@metaways.de>
Mon, 7 Aug 2017 10:51:32 +0000 (12:51 +0200)
committerPaul Mehrer <p.mehrer@metaways.de>
Mon, 7 Aug 2017 12:25:09 +0000 (14:25 +0200)
Change-Id: I695c44a2a6ba51aed17f666d6f8ee740009034fc
Reviewed-on: http://gerrit.tine20.com/customers/5409
Tested-by: Jenkins CI (http://ci.tine20.com/) <tine20-jenkins@metaways.de>
Reviewed-by: Paul Mehrer <p.mehrer@metaways.de>
Tested-by: Paul Mehrer <p.mehrer@metaways.de>
tine20/Admin/Controller/User.php
tine20/Admin/Frontend/Json.php

index 521273c..f307ce8 100644 (file)
@@ -87,9 +87,15 @@ class Admin_Controller_User extends Tinebase_Controller_Abstract
         
         $result = $this->_userBackend->getUsers($_filter, $_sort, $_dir, $_start, $_limit, 'Tinebase_Model_FullUser');
 
         
         $result = $this->_userBackend->getUsers($_filter, $_sort, $_dir, $_start, $_limit, 'Tinebase_Model_FullUser');
 
-        $emailUser = Tinebase_EmailUser::getInstance();
-        foreach ($result as $user) {
-            $emailUser->inspectGetUserByProperty($user);
+        $emailUser = null;
+        try {
+            $emailUser = Tinebase_EmailUser::getInstance();
+        } catch (Tinebase_Exception_NotFound $tenf) {}
+
+        if (null !== $emailUser) {
+            foreach ($result as $user) {
+                $emailUser->inspectGetUserByProperty($user);
+            }
         }
         
         return $result;
         }
         
         return $result;
index 7430f79..0b4cefd 100644 (file)
@@ -1379,7 +1379,10 @@ class Admin_Frontend_Json extends Tinebase_Frontend_Json_Abstract
         } else {
             $records = Tinebase_FileSystem::getInstance()->search($filter);
             if ($path === $emailPath) {
         } else {
             $records = Tinebase_FileSystem::getInstance()->search($filter);
             if ($path === $emailPath) {
-                $imapBackend = Tinebase_EmailUser::getInstance();
+                $imapBackend = null;
+                try {
+                    $imapBackend = Tinebase_EmailUser::getInstance();
+                } catch (Tinebase_Exception_NotFound $tenf) {}
                 if ($imapBackend instanceof Tinebase_EmailUser_Imap_Dovecot) {
                     /** @var Tinebase_Model_Tree_Node $emailNode */
                     $emailNode = clone $records->getFirstRecord();
                 if ($imapBackend instanceof Tinebase_EmailUser_Imap_Dovecot) {
                     /** @var Tinebase_Model_Tree_Node $emailNode */
                     $emailNode = clone $records->getFirstRecord();