diff --git a/gosa-core/plugins/admin/users/class_userManagement.inc b/gosa-core/plugins/admin/users/class_userManagement.inc
index e62358c7e45a4910d65ecc5f77e7be0823434d88..2d27f7c4f50c7a51662ddec92b8a73ea1d7c3e3b 100644 (file)
}
}
+ // Call external check hook to validate the password change
+ if(!count($message)){
+ $attrs = array();
+ $attrs['current_password'] = '';
+ $attrs['new_password'] = $new_password;
+ $checkRes = password::callCheckHook($this->config,$this->dn,$attrs);
+ if(count($checkRes)){
+ $message[] = sprintf(_("Check-hook reported a problem: %s. Password change canceled!"),
+ implode($checkRes));
+ }
+ }
+
// Display errors
if (count($message) != 0){
msg_dialog::displayChecks($message);
return($smarty->fetch(get_template_path('password.tpl', TRUE)));
}
+
+
// Change cassword
if(isset($this->force_hash_type[$this->dn])){
- if(!change_password ($this->dn, $new_password,0,$this->force_hash_type[$this->dn])){
+ if(!change_password ($this->dn, $new_password,0,$this->force_hash_type[$this->dn],'', $message)){
+ msg_dialog::displayChecks(array($message));
return($smarty->fetch(get_template_path('password.tpl', TRUE)));
}
}else{
- if(!change_password ($this->dn, $new_password)){
+ if(!change_password ($this->dn, $new_password,0,'','',$message)){
+ msg_dialog::displayChecks(array($message));
return($smarty->fetch(get_template_path('password.tpl', TRUE)));
}
}
- if ($this->config->get_cfg_value("core","passwordHook") != ""){
- $ldap = $this->config->get_ldap_link();
- $ldap->cd($this->config->current['BASE']);
- $ldap->cat($this->dn,array('uid'));
- $attrs = $ldap->fetch();
- exec($this->config->get_cfg_value("core","passwordHook")." ".$attrs['uid'][0]." ".$new_password, $resarr);
- }
// The user has to change his password on next login
// - We are going to update samba and posix attributes here, to enforce
if($samba){
$sambaAccount = new sambaAccount($this->config, $this->dn);
$sambaAccount->is_modified=TRUE;
- $sambaAccount->kickoff_time_set = "1";
- $sambaAccount->sambaKickoffTime= date('d.m.Y', time() - (1 * 24 * 60 *60));
+ $sambaAccount->flag_enforcePasswordChange = TRUE;
+ $sambaAccount->flag_cannotChangePassword = FALSE;
$sambaAccount->save();
}
}
"apple-user" => array("image" => "plugins/netatalk/images/select_netatalk.png",
"plugin" => "netatalk",
"alt" => _("Netatalk"),
- "title" => _("Edit netatalk properties")),
+ "title" => _("Edit Netatalk properties")),
"gotoEnvironment" => array("image" => "plugins/users/images/small_environment.png",
"plugin" => "environment",
"alt" => _("Environment"),