diff options
author | Dries Buytaert <dries@buytaert.net> | 2003-03-09 15:50:26 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2003-03-09 15:50:26 +0000 |
commit | 738cebbaf21fc694d315352028b86ceb54388292 (patch) | |
tree | d72f53ef26c0d20984903af6be25fe76f8f77ba0 /modules/user/user.module | |
parent | accb30677c7c542c45d383881a5e53b0d55b71ca (diff) | |
download | brdo-738cebbaf21fc694d315352028b86ceb54388292.tar.gz brdo-738cebbaf21fc694d315352028b86ceb54388292.tar.bz2 |
- Moved some block up to avoid the user module duplicating data.
Diffstat (limited to 'modules/user/user.module')
-rw-r--r-- | modules/user/user.module | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/modules/user/user.module b/modules/user/user.module index b32500772..425a8029c 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -903,19 +903,6 @@ function user_edit($edit = array()) { $error = t("The e-mail address '%s' is already taken.", array("%s" => $edit["mail"])); } else if ($user->uid) { - foreach (module_list() as $module) { - if (module_hook($module, "user")) { - $result = module_invoke($module, "user", "edit_validate", $edit, $user); - } - if (is_array($result)) { - $data = array_merge($data, $result); - } - elseif (is_string($result)) { - $error = $result; - break; - } - } - /* ** If required, check that proposed passwords match. If so, ** add new password to $edit. @@ -947,6 +934,24 @@ function user_edit($edit = array()) { $edit["session"] = $user->session; } + /* + ** Have the modules that extend the user information validate + ** their data. + */ + + foreach (module_list() as $module) { + if (module_hook($module, "user")) { + $result = module_invoke($module, "user", "edit_validate", $edit, $user); + } + if (is_array($result)) { + $data = array_merge($data, $result); + } + elseif (is_string($result)) { + $error = $result; + break; + } + } + if (!$error) { /* ** Save user information: |