Code

Password is must too
[gosa.git] / plugins / admin / systems / class_goNtpServer.inc
index bea2dc1af1070aa826e775cf49a8887a5cd801c9..b7577f202c4af287ff917fcbec2a38cd6d9b611e 100644 (file)
@@ -24,7 +24,7 @@ class goNtpServer extends plugin{
   function goNtpServer($config,$dn)
   {
     plugin::plugin($config,$dn);
-    $this->DisplayName = _("NTP Service");
+    $this->DisplayName = _("Time service");
     
     /* Load arrays */
     $tmp = array();
@@ -48,7 +48,7 @@ class goNtpServer extends plugin{
     }
 
     /* Deleting an Entry, is a bit more complicated than adding one*/
-    if(isset($_POST['DelNTPEnt'])) {
+    if((isset($_POST['DelNTPEnt'])) && (isset($_POST['goTimeSource']))) {
       foreach ($_POST['goTimeSource'] as $entry){
         if (isset($this->goTimeSource[$entry])){
           unset($this->goTimeSource[$entry]);
@@ -69,7 +69,7 @@ class goNtpServer extends plugin{
     $fields['Message']    = _("NTP service");
     $fields['AllowStart'] = true;
     $fields['AllowStop']  = true;
-    $fields['AllowReset'] = true;
+    $fields['AllowRestart'] = true;
     $fields['AllowRemove']= true;
     $fields['AllowEdit']  = true;
     return($fields);
@@ -117,28 +117,26 @@ class goNtpServer extends plugin{
   /* Directly save new status flag */
   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"));
-      
     if($ldap->count()){
-      $attrs =array();
+
       $tmp = $ldap->fetch();
       for($i = 0; $i < $tmp['objectClass']['count']; $i ++){
         $attrs['objectClass'][] = $tmp['objectClass'][$i];
-      }    
-      if(!in_array("goNtpServer",$attrs['objectClass'])){
-        $attrs['objectClass'][] = "goNtpServer";
       }
-
       $flag = $this->StatusFlag;
       $attrs[$flag] = $value;
       $this->$flag = $value;
       $ldap->modify($attrs);
       show_ldap_error($ldap->get_error());
-    }    
+    }
   }
-  
+
+
   function check(){ return array();}
   
 function save_object(){;}