diff --git a/html/password.php b/html/password.php
index d04b92aa07720910f4576e4d8289ba3bb4c359cd..c93410bd41a0651d899cfe96871f868affaa2c54 100644 (file)
--- a/html/password.php
+++ b/html/password.php
/* 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);