Code

Updated Quota progress bar.
[gosa.git] / gosa-plugins / mail / personal / mail / class_mail-methods-cyrus.inc
index 4c81f9cfd3602638eef532802f02864b9f1a8818..152daee4d5ec2d1d74fb3b119f82c1b704143116 100644 (file)
@@ -8,7 +8,10 @@ class mailMethodCyrus extends mailMethod{
   protected $quota_loaded = FALSE;
    
   /* Allow modification of account_ids for existing mail accounts */
-  protected $modifyableMail = FALSE;
+  protected $modifyableMail   = FALSE;
+
+  /* Allow modification of the mail server attribute existing mail accounts */
+  protected $modifyableServer = FALSE;
 
   /* Enforces same value for 'mail' as used for 'cn' */
   protected $mailEqualsCN   = FALSE; 
@@ -53,9 +56,15 @@ class mailMethodCyrus extends mailMethod{
     /* Mailbox reachable? */
     if ($this->imap_handle === FALSE){
       $this->error = imap_last_error();
+
+      @DEBUG (DEBUG_MAIL, __LINE__, __FUNCTION__, __FILE__,"<b>Failed</b> :".imap_last_error(),
+        "<b>IMAP:</b> ".$cfg['admin']."@".$cfg['connect']);
+
       return (FALSE);
       $this->connected = FALSE;
     }
+    @DEBUG (DEBUG_MAIL, __LINE__, __FUNCTION__, __FILE__,"<b>successful</b>",
+        "<b>IMAP:</b> ".$cfg['admin']."@".$cfg['connect']);
     $this->connected = TRUE;
 
     return (TRUE);
@@ -104,10 +113,16 @@ class mailMethodCyrus extends mailMethod{
       return(FALSE);
     }
 
+    $this->reset_error();
+
     /* Load quota settings */
     $result = array("quotaUsage"=>"","gosaMailQuota"=>"");
     $quota_value = @imap_get_quota($this->imap_handle, $this->account_id);
 
+    /* Reset error queue, imap_qet_quota() will fail if the quota wasn't set yet.
+     */
+    imap_errors();
+
     if(is_array($quota_value) && count($quota_value)) {
       if (isset($quota_value["STORAGE"]) && is_array($quota_value["STORAGE"])){