summaryrefslogtreecommitdiff
path: root/modules/user.module
diff options
context:
space:
mode:
Diffstat (limited to 'modules/user.module')
-rw-r--r--modules/user.module29
1 files changed, 15 insertions, 14 deletions
diff --git a/modules/user.module b/modules/user.module
index 1d5551eec..ba85e5a32 100644
--- a/modules/user.module
+++ b/modules/user.module
@@ -1257,26 +1257,27 @@ function user_admin_create($edit = array()) {
else if (db_num_rows(db_query("SELECT mail FROM {users} WHERE LOWER(mail) = LOWER('%s')", $edit['mail'])) > 0) {
form_set_error('mail', t('The e-mail address "%s" is already taken.', array('%s' => $edit['mail'])));
}
- }
- if (!form_has_errors()) {
- watchdog('user', 'new user: "'. $edit['name'] .'" <'. $edit['mail'] .'>');
+ if (!form_has_errors()) {
+ watchdog('user', 'new user: "'. $edit['name'] .'" <'. $edit['mail'] .'>');
+
+ user_save('', array('name' => $edit['name'], 'pass' => $edit['pass'], 'init' => $edit['mail'], 'mail' => $edit['mail'], 'rid' => array(_user_authenticated_id()), 'status' => 1));
- user_save('', array('name' => $edit['name'], 'pass' => $edit['pass'], 'init' => $edit['mail'], 'mail' => $edit['mail'], 'rid' => array(_user_authenticated_id()), 'status' => 1));
+ drupal_set_message(t('Created a new user account. No e-mail has been sent.'));
- drupal_set_message(t('Created a new user account. No e-mail has been sent.'));
+ return;
+ }
}
- else {
- $output = form_textfield(t('Username'), 'name', $edit['name'], 30, 55, t('Provide the username of the new account.'));
- $output .= form_textfield(t('E-mail address'), 'mail', $edit['mail'], 30, 55, t('Provide the e-mail address associated with the new account.'));
- $output .= _user_profile($edit, $edit, 'form');
- $output .= form_textfield(t('Password'), 'pass', $edit['pass'], 30, 55, t('Provide a password for the new account.'));
- $output .= form_submit(t('Create account'));
- $output = form_group(t('Create new user account'), $output);
+ $output = form_textfield(t('Username'), 'name', $edit['name'], 30, 55, t('Provide the username of the new account.'));
+ $output .= form_textfield(t('E-mail address'), 'mail', $edit['mail'], 30, 55, t('Provide the e-mail address associated with the new account.'));
+ $output .= _user_profile($edit, $edit, 'form');
+ $output .= form_textfield(t('Password'), 'pass', $edit['pass'], 30, 55, t('Provide a password for the new account.'));
+ $output .= form_submit(t('Create account'));
- return form($output);
- }
+ $output = form_group(t('Create new user account'), $output);
+
+ return form($output);
}
function user_admin_access($edit = array()) {