Commit b739554b authored by Côme Bernigaud's avatar Côme Bernigaud Committed by Benoit Mortier
Browse files

Fixes #3072 Password hook not block the password change if you logged in fd-admin

parent c1d2cf23
......@@ -314,16 +314,6 @@ class userManagement extends management
return $smarty->fetch(get_template_path('password.tpl', TRUE));
}
// Change password
if (isset($this->force_hash_type[$this->dn])) {
if (!change_password($this->dn, $new_password, 0, $this->force_hash_type[$this->dn])) {
return $smarty->fetch(get_template_path('password.tpl', TRUE));
}
} else {
if (!change_password($this->dn, $new_password)) {
return $smarty->fetch(get_template_path('password.tpl', TRUE));
}
}
if ($this->config->get_cfg_value("passwordHook") != "") {
$ldap = $this->config->get_ldap_link();
$ldap->cd($this->config->current['BASE']);
......@@ -342,6 +332,17 @@ class userManagement extends management
}
}
// Change password
if (isset($this->force_hash_type[$this->dn])) {
if (!change_password($this->dn, $new_password, 0, $this->force_hash_type[$this->dn])) {
return $smarty->fetch(get_template_path('password.tpl', TRUE));
}
} else {
if (!change_password($this->dn, $new_password)) {
return $smarty->fetch(get_template_path('password.tpl', TRUE));
}
}
// The user has to change his password on next login
// - We are going to update samba and posix attributes here, to enforce
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment