From d2235b29bc69562b585f0d166735964f5b1adac0 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 10 Oct 2007 13:12:24 +0000 Subject: [PATCH] Save sorting for gotoLdapServer assignments git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7492 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/systems/class_terminalStartup.inc | 10 +++++++--- plugins/admin/systems/class_workstationStartup.inc | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/plugins/admin/systems/class_terminalStartup.inc b/plugins/admin/systems/class_terminalStartup.inc index b887a272b..ba8a0c042 100644 --- a/plugins/admin/systems/class_terminalStartup.inc +++ b/plugins/admin/systems/class_terminalStartup.inc @@ -126,8 +126,10 @@ class termstartup extends plugin $this->gotoLdapServerList[]= $server; } if(isset($this->attrs['gotoLdapServer'])){ - for($i = 0 ; $i < $this->attrs['gotoLdapServer']['count'];$i++){ - $this->gotoLdapServers[] = $this->attrs['gotoLdapServer'][$i]; + unset($this->attrs['gotoLdapServer']['count']); + sort($this->attrs['gotoLdapServer']); + foreach($this->attrs['gotoLdapServer'] as $value){ + $this->gotoLdapServers[] = preg_replace("/^[0-9]*:/","",$value); } } if(!count($this->gotoLdapServers)){ @@ -447,8 +449,10 @@ class termstartup extends plugin /* Prepare list of ldap servers */ $this->attrs['gotoLdapServer'] = array(); if(!$this->gotoLdap_inherit){ + $i = 0; foreach($this->gotoLdapServers as $server){ - $this->attrs['gotoLdapServer'][] = $server; + $i ++; + $this->attrs['gotoLdapServer'][] = $i.":".$server; } } diff --git a/plugins/admin/systems/class_workstationStartup.inc b/plugins/admin/systems/class_workstationStartup.inc index b54499a40..0860bcb99 100644 --- a/plugins/admin/systems/class_workstationStartup.inc +++ b/plugins/admin/systems/class_workstationStartup.inc @@ -93,8 +93,10 @@ class workstartup extends plugin } if(isset($this->attrs['gotoLdapServer'])){ - for($i = 0 ; $i < $this->attrs['gotoLdapServer']['count'];$i++){ - $this->gotoLdapServers[] = $this->attrs['gotoLdapServer'][$i]; + unset($this->attrs['gotoLdapServer']['count']); + sort($this->attrs['gotoLdapServer']); + foreach($this->attrs['gotoLdapServer'] as $value){ + $this->gotoLdapServers[] = preg_replace("/^[0-9]*:/","",$value); } } if(!count($this->gotoLdapServers)){ @@ -1138,8 +1140,10 @@ class workstartup extends plugin /* Prepare list of ldap servers */ $this->attrs['gotoLdapServer'] = array(); if(!$this->gotoLdap_inherit){ + $i = 0; foreach($this->gotoLdapServers as $server){ - $this->attrs['gotoLdapServer'][] = $server; + $i ++; + $this->attrs['gotoLdapServer'][] = $i.":".$server; } } -- 2.30.2