Code

Password is must too
[gosa.git] / plugins / admin / systems / class_goImapServer.inc
index ebf9fbb4c8860e959c5dbb66d543facaeafa6293..56d658bab5cbb17314c802bb3e3c15ab9460f1ce 100644 (file)
@@ -46,11 +46,11 @@ class goImapServer extends plugin{
   {
     plugin::plugin($config,$dn);
   
-    $this->DisplayName = _("Cyrus service");
+    $this->DisplayName = _("IMAP/POP3 service");
 
     $this->Actions = array( SERVICE_STOPPED=>SERVICE_STOPPED,
                             SERVICE_STARTED => SERVICE_STARTED,
-                            SERVICE_RESETTED=>SERVICE_RESETTED,
+                            SERVICE_RESTARTED=>SERVICE_RESTARTED,
                             "repair_database"=>_("Repair database"));
     
   }
@@ -72,6 +72,7 @@ class goImapServer extends plugin{
     }
     $smarty->assign("Actions",$this->Actions);
     $smarty->assign("is_new",$this->dn);
+    $smarty->assign("is_acc",$this->initially_was_account);
     return($smarty->fetch(get_template_path("goImapServer.tpl",TRUE,dirname(__FILE__))));
   }
 
@@ -82,7 +83,7 @@ class goImapServer extends plugin{
     $fields['Message']    = _("Cyrus service");
     $fields['AllowStart'] = true;
     $fields['AllowStop']  = true;
-    $fields['AllowReset'] = true;
+    $fields['AllowRestart'] = true;
     $fields['AllowRemove']= true;
     $fields['AllowEdit']  = true;
     return($fields);
@@ -126,33 +127,16 @@ class goImapServer extends plugin{
   function setStatus($value)
   {
     if($value == "none") return;
+    if(!$this->initially_was_account) return;
     $ldap = $this->config->get_ldap_link();
     $ldap->cd($this->dn);
-    $ldap->cat($this->dn,array("objectClass","goImapName","goImapConnect","goImapAdmin","goImapPassword"));
-
+    $ldap->cat($this->dn,array("objectClass"));
     if($ldap->count()){
 
-      $attrs =array();
-      foreach(array("goImapName","goImapConnect","goImapAdmin","goImapPassword") as $required){
-        if(!isset($attrs[$required])){
-          if(empty($this->$required)){
-            print_red(_("Can't set new status while there are blank option within generic configuration part."));
-            return;
-          }else{
-            $attrs[$required] = $this->$required;
-          }
-        }else{
-          $attrs[$required] = $attrs[$required][0];
-        }
-      }
-
       $tmp = $ldap->fetch();
       for($i = 0; $i < $tmp['objectClass']['count']; $i ++){
         $attrs['objectClass'][] = $tmp['objectClass'][$i];
       }
-      if(!in_array("goImapServer",$attrs['objectClass'])){
-        $attrs['objectClass'][] = "goImapServer";
-      }
       $flag = $this->StatusFlag;
       $attrs[$flag] = $value;
       $this->$flag = $value;