From 47ef2e21ded230f9fb959e76b698d3ec1380c848 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Mon, 28 Jun 2004 07:23:53 +0000 Subject: - Fixed 'pass by reference'-bug in the validation code and further simplified it. --- modules/user.module | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'modules/user.module') diff --git a/modules/user.module b/modules/user.module index f26e90a63..f61a7e4a7 100644 --- a/modules/user.module +++ b/modules/user.module @@ -938,7 +938,7 @@ function user_register($edit = array()) { } if ($edit) { - _user_validate($edit, NULL, 'account'); + user_module_invoke('validate', $edit, $edit, 'account'); if (!form_has_errors()) { $from = variable_get('site_mail', ini_get('sendmail_from')); @@ -1076,7 +1076,7 @@ function user_edit($category = 'account') { $edit = $_POST['op'] ? $_POST['edit'] : object2array($account); if ($_POST['op'] == t('Save account')) { - _user_validate($edit, $account, $category); + user_module_invoke('validate', $edit, $account, $category); if (!form_has_errors()) { // Validate input to ensure that non-privileged users can't alter protected data. @@ -1266,7 +1266,7 @@ function user_configure_settings() { function user_admin_create($edit = array()) { if ($edit) { - _user_validate($edit, NULL, 'account'); + user_module_invoke('validate', $edit, $edit, 'account'); if (!form_has_errors()) { watchdog('user', 'new user: "'. $edit['name'] .'" <'. $edit['mail'] .'>'); @@ -1682,14 +1682,4 @@ function _user_forms(&$edit, $account, $category) { return $output; } -/** - * Validate the user data for the specified category. - */ -function _user_validate(&$edit, $account, $category) { - foreach (module_list() as $module) { - module_invoke($module, 'user', 'validate', $edit, $account, $category); - } -} - - ?> -- cgit v1.2.3