Code

Fixed saving of users which are member in a sharedFolder.
[gosa.git] / html / password.php
index 5348a4531a1931764952d8cc03bc209b21491465..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);
@@ -152,7 +156,7 @@ $method= $config->current['HASH'];
 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;
@@ -218,7 +222,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['apply'])){
     /* Do we have the selected user somewhere? */
     $ui= ldap_login_user ($uid, $current_password);
 
-    if ($ui == NULL){
+    if ($ui === NULL){
       $message[]= _("Please check the username/password combination.");
     } else {
       $acls = $ui->get_permissions($ui->dn,"users/password");