From: hickert Date: Wed, 29 Mar 2006 06:41:49 +0000 (+0000) Subject: Added some comments, adn additional checks for item selection X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b06ab2d6700b491eefc4e78c1c7b73aed9515c45;p=gosa.git Added some comments, adn additional checks for item selection git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2924 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/systems/class_workstationStartup.inc b/plugins/admin/systems/class_workstationStartup.inc index 33e23c53e..a3f3366b2 100644 --- a/plugins/admin/systems/class_workstationStartup.inc +++ b/plugins/admin/systems/class_workstationStartup.inc @@ -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 "; };