summaryrefslogtreecommitdiff
path: root/modules/user/user.module
diff options
context:
space:
mode:
authorSteven Wittens <steven@10.no-reply.drupal.org>2006-12-12 07:06:29 +0000
committerSteven Wittens <steven@10.no-reply.drupal.org>2006-12-12 07:06:29 +0000
commit4eda8b315d731b72fd6a3900c6187cc29b969c1d (patch)
tree780f33ef848650549c7b7fc7f480fcbaa9c8bf0c /modules/user/user.module
parentcfe44ef80c5bd0aaaf8705a79429d94927a433b8 (diff)
downloadbrdo-4eda8b315d731b72fd6a3900c6187cc29b969c1d.tar.gz
brdo-4eda8b315d731b72fd6a3900c6187cc29b969c1d.tar.bz2
#101900: Can't create blocked user
Diffstat (limited to 'modules/user/user.module')
-rw-r--r--modules/user/user.module7
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/user/user.module b/modules/user/user.module
index f8689d019..8fbd2be0d 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -1226,7 +1226,12 @@ function user_register_submit($form_id, $form_values) {
//the unset below is needed to prevent these form values from being saved as user data
unset($form_values['form_token'], $form_values['submit'], $form_values['op'], $form_values['notify'], $form_values['form_id'], $form_values['affiliates'], $form_values['destination']);
- $account = user_save('', array_merge($form_values, array('pass' => $pass, 'init' => $mail, 'roles' => $roles, 'status' => ($admin || variable_get('user_register', 1) == 1))));
+ $merge_data = array('pass' => $pass, 'init' => $mail, 'roles' => $roles);
+ if (!$admin) {
+ // Set the user's status because it was not displayed in the form.
+ $merge_data['status'] = variable_get('user_register', 1) == 1;
+ }
+ $account = user_save('', array_merge($form_values, $merge_data));
watchdog('user', t('New user: %name %email.', array('%name' => $name, '%email' => '<'. $mail .'>')), WATCHDOG_NOTICE, l(t('edit'), 'user/'. $account->uid .'/edit'));
$variables = array('!username' => $name, '!site' => variable_get('site_name', 'Drupal'), '!password' => $pass, '!uri' => $base_url, '!uri_brief' => substr($base_url, strlen('http://')), '!mailto' => $mail, '!date' => format_date(time()), '!login_uri' => url('user', NULL, NULL, TRUE), '!edit_uri' => url('user/'. $account->uid .'/edit', NULL, NULL, TRUE), '!login_url' => user_pass_reset_url($account));