From ebfb8252f4ae613db5fcd27c6e2c48e8ec207212 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 18 Jan 2011 08:47:24 +0000 Subject: [PATCH] Fixed problem reported by 'mmerlone' closes #1122 -passwordHook return ignored on class_userManagement.inc git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6@20600 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/plugins/admin/users/class_userManagement.inc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gosa-core/plugins/admin/users/class_userManagement.inc b/gosa-core/plugins/admin/users/class_userManagement.inc index 9b1c574c2..f15817603 100644 --- a/gosa-core/plugins/admin/users/class_userManagement.inc +++ b/gosa-core/plugins/admin/users/class_userManagement.inc @@ -343,8 +343,18 @@ class userManagement extends management $attrs = $ldap->fetch(); exec($this->config->get_cfg_value("passwordHook")." ". escapeshellarg($attrs['uid'][0])." ".escapeshellarg($new_password), $resarr); + $check_hook_output = ""; + if(count($resarr) > 0) { + $check_hook_output= join('\n', $resarr); + } + if(!empty($check_hook_output)){ + $message[] = sprintf(_("Check-hook reported a problem: %s. Password change canceled!"),$check_hook_output); + msg_dialog::displayChecks($message); + return($smarty->fetch(get_template_path('password.tpl', TRUE))); + } } + // The user has to change his password on next login // - We are going to update samba and posix attributes here, to enforce // such a password change. -- 2.30.2