Code

Fixed saving
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 27 Apr 2006 11:28:40 +0000 (11:28 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 27 Apr 2006 11:28:40 +0000 (11:28 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3146 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_terminalGeneric.inc

index 35b001d341b8df2b240800f57172b28767e699f6..e7c8fe4b4ff65da5afc7aa31308030566a674a10 100644 (file)
@@ -58,7 +58,7 @@ class termgeneric extends plugin
     }
 
     /* Create used ntp server array */
-    $this->gotoNtpServer= array();
+    $this->gotoNtpServer= array("default"=>"default");
     if(isset($this->attrs['gotoNtpServer'])){
       unset($this->attrs['gotoNtpServer']['count']);
       foreach($this->attrs['gotoNtpServer'] as $server){
@@ -163,14 +163,18 @@ class termgeneric extends plugin
       return($display);
     }
 
+    /* Add new ntp Server to our list */
     if((isset($_POST['addNtpServer'])) && (isset($_POST['gotoNtpServers']))){
       $this->gotoNtpServer[$_POST['gotoNtpServers']] = $_POST['gotoNtpServers'];
     }
 
+    /* Delete selected NtpServer for list of used servers  */
     if((isset($_POST['delNtpServer'])) && (isset($_POST['gotoNtpServerSelected']))){
       foreach($_POST['gotoNtpServerSelected'] as $name){
         unset($this->gotoNtpServer[$name]);
       } 
+    
+      /* if nothing is selected, add default */
       if(count($this->gotoNtpServer) == 0){
         $this->gotoNtpServer['default'] = "default";
       }
@@ -352,6 +356,12 @@ class termgeneric extends plugin
       $this->attrs= $attrs;
     }
 
+    /* Set ntpServers */
+    $this->attrs['gotoNtpServer'] = array();
+    foreach($this->gotoNtpServer as $server){
+      $this->attrs['gotoNtpServer'][] = $server;
+    }
+
     /* Write back to ldap */
     $ldap= $this->config->get_ldap_link();
     if ($this->orig_dn == 'new'){