Code

Added password check hook to userManagement
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 18 Jan 2011 09:01:38 +0000 (09:01 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 18 Jan 2011 09:01:38 +0000 (09:01 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.7@20602 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/plugins/admin/users/class_userManagement.inc

index b8462732be880c299621ac01760ab9ff3d9cfa24..2d27f7c4f50c7a51662ddec92b8a73ea1d7c3e3b 100644 (file)
@@ -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)){