From: hickert Date: Tue, 18 Jan 2011 09:00:51 +0000 (+0000) Subject: Added check hook to password change from userManagement plugin. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a57530dcef3f4e863f607e2b856842e0d60254c1;p=gosa.git Added check hook to password change from userManagement plugin. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20601 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/plugins/admin/users/class_userManagement.inc b/gosa-core/plugins/admin/users/class_userManagement.inc index b8462732b..2d27f7c4f 100644 --- a/gosa-core/plugins/admin/users/class_userManagement.inc +++ b/gosa-core/plugins/admin/users/class_userManagement.inc @@ -320,12 +320,26 @@ class userManagement extends management } } + // 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],'', $message)){