Code

Added ldap base inherit, for terminal - Starttab
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 29 May 2006 10:35:00 +0000 (10:35 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 29 May 2006 10:35:00 +0000 (10:35 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3541 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_terminalStartup.inc

index e4d3412abf273d1767415fc05ca4aaa01f406f39..e795803be3a6f25951d2470f68982f5e2d41bdcf 100644 (file)
@@ -96,10 +96,11 @@ class termstartup extends plugin
         $fh= popen($command, "r");
         while (!feof($fh)) {
           $buffer= fgets($fh, 256);
-          $this->gotoBootKernels[]= $buffer;
+          if(!empty($buffer)){
+            $this->gotoBootKernels[]= $buffer;
+          }
         }
         pclose($fh);
-        sort($this->gotoBootKernels);
       }
 
     }
@@ -111,6 +112,27 @@ class termstartup extends plugin
       }
       $this->goLdapServerList[$server] = $visible;
     }
+
+     /* Load hardware list */
+    $ldap= $this->config->get_ldap_link();
+    $ldap->cd($this->config->current['BASE']);
+    $ldap->search("(&(objectClass=gotoWorkstationTemplate)(member=".$this->dn."))");
+    if ($ldap->count() == 1){
+      $map= array("gotoLdapServer");
+      $attrs= $ldap->fetch();
+
+      foreach ($map as $name){
+        if (!isset($attrs[$name][0])){
+          continue;
+        }
+
+        switch ($name){
+          case 'gotoLdapServer':
+            $this->goLdapServerList= array_merge(array('default' => _("inherited").' ['.$attrs[$name][0].']' ), $this->goLdapServerList);
+            break;
+        }
+      }
+    }
   }
 
   function execute()