Code

Save sorting for gotoLdapServer assignments
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 10 Oct 2007 13:12:24 +0000 (13:12 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 10 Oct 2007 13:12:24 +0000 (13:12 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7492 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_terminalStartup.inc
plugins/admin/systems/class_workstationStartup.inc

index b887a272b95b4c05e64079f06b2750d80ed3e0d6..ba8a0c0424487c44205aef41d780f66e7467bc64 100644 (file)
@@ -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;
       }
     }
 
index b54499a40b6b24206c303bd7ac6c325e7ae7f95a..0860bcb992214b1fefd7a9b5d4ea2607fd2cde59 100644 (file)
@@ -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;
       }
     }