From a57530dcef3f4e863f607e2b856842e0d60254c1 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 18 Jan 2011 09:00:51 +0000 Subject: [PATCH] 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 --- .../plugins/admin/users/class_userManagement.inc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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)){ -- 2.30.2