Code

Fixed objectclass
[gosa.git] / plugins / personal / mail / class_mailAccount.inc
index 209072123441da0386e6c3a62236301504bd68f7..7673aa45e2ee21cf4102f251176eee6c4ca06589 100644 (file)
@@ -124,6 +124,13 @@ class mailAccount extends plugin
 
         /* Adapt attributes if needed */
         $method->fixAttributesOnLoad($this);
+
+        /* FixAttributesOnLoad possibly creates an array out of gosaMailServer.
+            If the mail tab wasn't opened once before saving, the account can't be saved */
+        if(is_array($this->gosaMailServer)){
+          $this->gosaMailServer = $this->gosaMailServer[0];
+        }
+
         if ($method->connect($this->attrs["gosaMailServer"][0])){
 
           /* Update quota values */
@@ -140,7 +147,7 @@ class mailAccount extends plugin
           }else{
             $this->quotaUsage     = "";
             $this->gosaMailQuota  = "";
-            print_red(sprintf(_("Can't get quota for for '%s'."),$this->folder_prefix.$this->$id));
+            print_red(sprintf(_("Can't get quota information for '%s'."),$this->folder_prefix.$this->$id));
           }
 
           /* Get mailboxes / folder like INBOX ..*/
@@ -157,9 +164,6 @@ class mailAccount extends plugin
       }
     }
 
-
-    /* Get vacation message */
-
     /* Fill vacation array */
     $this->vacation= array();
     if (isset($this->config->current['VACATIONDIR'])){
@@ -379,7 +383,7 @@ class mailAccount extends plugin
     }
 
   
-    /* Vocation message */
+    /* Vacation message */
   
     /* Import vacation message? */
     if (isset($_POST["import_vacation"]) && isset($this->vacation[$_POST["vacation_template"]])){
@@ -616,7 +620,7 @@ class mailAccount extends plugin
     $this->cleanup();
     $ldap->modify ($this->attrs); 
 
-    show_ldap_error($ldap->get_error(), _("Removing mail account failed"));
+    show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/mail account with dn '%s' failed."),$this->dn));
 
     /* Connect to IMAP server for account deletion */
     if ($this->gosaMailServer != ""){
@@ -720,7 +724,7 @@ class mailAccount extends plugin
     $this->cleanup();
     $ldap->modify ($this->attrs); 
 
-    show_ldap_error($ldap->get_error(), _("Saving mail account failed"));
+    show_ldap_error($ldap->get_error(), sprintf(_("Saving of user/mail account with dn '%s' failed."),$this->dn));
 
     /* Only do IMAP actions if we are not a template */
     if (!$this->is_template){
@@ -961,14 +965,41 @@ class mailAccount extends plugin
         if($ldap->count()){
           $attrs = $ldap->fetch();
           if(isset($attrs['kolabDeleteFlag'])){ 
-            return(_("Waiting for kolabd to remove mail properties."));
+            return(_("Waiting for kolab to remove mail properties."));
           }elseif(in_array("gosaMailAccount",$attrs['objectClass'])){
-            return(_("Please remove the mail account first, to allow kolabd to call its remove methods."));
+            return(_("Please remove the mail account first, to allow kolab to call its remove methods."));
           }
         }
       }
     }
   }
+
+
+  function plInfo()
+  {
+    return (array("plDescription"   => _("Mail settings"),
+          "plSelfModify"    => TRUE,
+          "plDepends"       => array("objectClass" => "gosaAccount"),
+
+          "mail"                      =>  _("Mail address"),
+          "gosaMailServer"            =>  _("Mail server"),
+          "gosaMailQuota"             =>  _("Quota sizw"),
+          "gosaMailMaxSize"           =>  _("Mail max size"),
+          "gosaMailForwardingAddress" =>  _("Forwarding address"),
+          "gosaMailDeliveryMode_L"    =>  "FIXME"._("Local delivery"),            // This is flag of gosaMailDeliveryMode
+          "gosaMailDeliveryMode_R"    =>  "FIXME"._("Reject due to mailsize"),    // This is flag of gosaMailDeliveryMode
+          "gosaMailDeliveryMode_s"    =>  "FIXME"._("Use spam filter"),           // This is flag of gosaMailDeliveryMode
+          "gosaMailDeliveryMode_V"    =>  "FIXME"._("Add vacation information"),  // This is flag of gosaMailDeliveryMode
+          "gosaMailDeliveryMode_C"    =>  "FIXME"._("Use custom sieve script"),   // This is flag of gosaMailDeliveryMode
+          "gosaMailDeliveryMode_I"    =>  "FIXME"._("Only insider delivery"),     // This is flag of gosaMailDeliveryMode
+          "gosaSpamSortLevel"         =>  _("Spam level"),
+          "gosaSpamMailbox"           =>  _("Spam mail box"),
+          "gosaMailAlternateAddress"  =>  _("Mail alternative addresses"),
+
+          "gosaVacationMessage"       =>  _("Vocation message"),
+          "gosaMailForwardingAddress" =>  _("Forwarding address")));
+
+  }
 }
 
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: