Code

Added some comments, adn additional checks for item selection
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 29 Mar 2006 06:41:49 +0000 (06:41 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 29 Mar 2006 06:41:49 +0000 (06:41 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2924 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_workstationStartup.inc

index 33e23c53e51704cc8295a737b5a65cc7a2051e43..a3f3366b22c86fe277def7d2be443b00c3c99f9f 100644 (file)
@@ -519,25 +519,29 @@ class workstartup extends plugin
     $smarty->assign("gotoShareKeys",array_flip($this->printOutAssignedShares()));
 
     /* Arrays */
-
     $tmp = $this->config->data['SERVERS']['LDAP'];
-    $smarty->assign("ldapserverKeys", $tmp);
-
-//    foreach($tmp as $key => $server){
-//      if(strlen($server)> 51){
-//        $tmp[$key] = substr($server,0,48)."...";
-//      }
-//    }
-    $smarty->assign("ldapservers", $tmp);
-    $smarty->assign("gotoLdapServer_select", $this->gotoLdapServer);
-
 
+    /* Create divSelectBox for ldap server selection
+     */
     $SelectBoxLdapServer = new divSelectBox("LdapServer");
     $SelectBoxLdapServer->SetHeight(80);
+
+    /* Set first entry as selected, if $this->gotoLdapServer is empty
+     *  or given entry is no longer available ... 
+     */
+    $found = false;
     foreach($tmp as $server){
+      if($this->gotoLdapServer==$server){
+        $found = true;
+      }
+    }
 
+    /* Add Entries 
+     */
+    foreach($tmp as $server){
       $use ="";
-      if($this->gotoLdapServer == $server) {
+      if(($this->gotoLdapServer == $server) || ($found == false)) {
+        $found = true;
         $use = " checked ";
       };