Code

Fixed undefined ...
[gosa.git] / plugins / admin / systems / class_terminalGeneric.inc
index 3872b38242e3a26077814f9b704a4a571581c661..b3b38ac5f1b4b392f4c5d16559c093b8f7c0c31b 100644 (file)
@@ -275,18 +275,7 @@ class termgeneric extends plugin
     $tmp2 = array(); 
     foreach($this->config->data['SERVERS']['NFS'] as $server){
       if($server != "default"){
-        $tmp = split("\|",$server);
-        $tmp3= split(":",$tmp[0]);
-
-        $servername = $tmp3[0];
-        $nfsname    = $tmp3[1];  
-
-        $path ="";
-        if(isset($tmp[4])){
-          $path       = $tmp[4];  
-        }
-
-        $tmp2[$servername.":".$path]= $servername.":".$path; 
+        $tmp2[$server]= $server;
       }else{
         $tmp2[$server]="["._("inherited")."]";
       }
@@ -419,7 +408,7 @@ class termgeneric extends plugin
     /* Strip out 'default' values */
     foreach (array("gotoTerminalPath", "gotoSwapServer", "gotoSyslogServer") as $val){
 
-      if ($this->attrs[$val] == "default"){
+      if (!isset($this->attrs[$val]) || $this->attrs[$val] == "default"){
         $this->attrs[$val]= array();
       }
     }
@@ -443,11 +432,9 @@ class termgeneric extends plugin
       $this->attrs= $attrs;
     }
 
-    if($this->inheritTimeServer){
-      $this->attrs['gotoNtpServer'] = array();
-    }else{  
-      /* Set ntpServers */
-      $this->attrs['gotoNtpServer'] = array();
+    /* Set ntpServers */
+    $this->attrs['gotoNtpServer'] = array();
+    if(!$this->inheritTimeServer){
       foreach($this->gotoNtpServer as $server){
         $this->attrs['gotoNtpServer'][] = $server;
       }
@@ -464,6 +451,9 @@ class termgeneric extends plugin
       $ldap->cd($this->config->current['BASE']);
       $ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $this->dn));
       $ldap->cd($this->dn);
+      if (!count($this->attrs['gotoNtpServer'])){
+        unset($this->attrs['gotoNtpServer']);
+      }
       $ldap->add($this->attrs);
       $this->handle_post_events("add");
     } else {