From: hickert Date: Tue, 18 Jan 2011 09:01:38 +0000 (+0000) Subject: Added password check hook to userManagement X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=34ecc82a16dc23ac2c84100134eaea815f8597a9;p=gosa.git Added password check hook to userManagement git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.7@20602 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)){