diff --git a/html/password.php b/html/password.php
index 29e1edbf22b789a39b134a025a0d442bc33ef6bb..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);
if (isset($_GET['method'])){
$method= validate($_GET['method']);
$tmp = new passwordMethod($config);
- $available = $tmp->get_available_methods_if_not_loaded();
+ $available = $tmp->get_available_methods();
if (!isset($available[$method])){
echo _("Error: Password method not available!");
exit;