From: cajus Date: Mon, 17 Mar 2008 16:13:26 +0000 (+0000) Subject: Beautify ldap lists X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=80e3f5905d1290edc6edbf32b1a9d65e4d78d7c7;p=gosa.git Beautify ldap lists git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9902 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/goto/admin/systems/goto/class_workstationStartup.inc b/gosa-plugins/goto/admin/systems/goto/class_workstationStartup.inc index 0b12ac8e8..0e0fcb87a 100644 --- a/gosa-plugins/goto/admin/systems/goto/class_workstationStartup.inc +++ b/gosa-plugins/goto/admin/systems/goto/class_workstationStartup.inc @@ -543,13 +543,22 @@ class workstartup extends plugin } } - /* Add Entries - */ + /* Add Entries */ foreach($this->gotoLdapServers as $key => $server){ + /* Announce missing entries */ if(!in_array($server,$this->gotoLdapServerList)){ $server = $server." (missing)"; } + /* Convert old style entry */ + if (!preg_match('%:ldap://%', $server)){ + $server= "ldap://".preg_replace('/^([^:]+):/', '\1/', $server); + + /* Beautify new style entries */ + } else { + $server= preg_replace("/^[^:]+:/", "", $server); + } + $SelectBoxLdapServer->AddEntry( array(array("string" => $server), array("string" => @@ -568,6 +577,16 @@ class workstartup extends plugin $list = array(); foreach($this->gotoLdapServerList as $key => $entry){ if(!in_array($entry,$this->gotoLdapServers)){ + + /* Convert old style entry */ + if (!preg_match('%:ldap://%', $entry)){ + $entry= "ldap://".preg_replace('/^([^:]+):/', '\1/', $entry); + + /* Beautify new style entries */ + } else { + $entry= preg_replace("/^[^:]+:/", "", $entry); + } + $list[$key] = $entry; } }