Code

Updated password.php.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 20 Sep 2007 07:23:15 +0000 (07:23 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 20 Sep 2007 07:23:15 +0000 (07:23 +0000)
Use first ldap->server (location), if default is not valid.

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7343 594d385d-05f5-0310-b6e9-bd551577e9d8

html/password.php

index d04b92aa07720910f4576e4d8289ba3bb4c359cd..c93410bd41a0651d899cfe96871f868affaa2c54 100644 (file)
@@ -101,13 +101,17 @@ textdomain($domain);
 
 /* Generate server list */
 $servers= array();
+foreach ($config->data['LOCATIONS'] as $key => $ignored){
+       $servers[$key]= $key;
+}
 if (isset($_POST['server'])){
        $directory= validate($_POST['server']);
 } else {
        $directory= $config->data['MAIN']['DEFAULT'];
-}
-foreach ($config->data['LOCATIONS'] as $key => $ignored){
-       $servers[$key]= $key;
+
+  if(!isset($servers[$directory])){
+    $directory = key($servers);
+  }
 }
 if (isset($_GET['directory']) && isset($servers[$_GET['directory']])){
        $smarty->assign ("show_directory_chooser", false);