Commit 9974d0b3 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 972c6f06
...@@ -315,16 +315,6 @@ class userManagement extends management ...@@ -315,16 +315,6 @@ class userManagement extends management
return $smarty->fetch(get_template_path('password.tpl', TRUE)); 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") != "") { if ($this->config->get_cfg_value("passwordHook") != "") {
$ldap = $this->config->get_ldap_link(); $ldap = $this->config->get_ldap_link();
$ldap->cd($this->config->current['BASE']); $ldap->cd($this->config->current['BASE']);
...@@ -343,6 +333,17 @@ class userManagement extends management ...@@ -343,6 +333,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 // The user has to change his password on next login
// - We are going to update samba and posix attributes here, to enforce // - 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