summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2004-06-14 17:32:51 +0000
committerDries Buytaert <dries@buytaert.net>2004-06-14 17:32:51 +0000
commit624ffd1510e3b1ed1b4174992b95a1c2c2e11b4d (patch)
treebfa011fd68e4b80c3a6ade96a255c99cdca8a565
parent4d91449dd94f4476faed70b68219c97d55cfd759 (diff)
downloadbrdo-624ffd1510e3b1ed1b4174992b95a1c2c2e11b4d.tar.gz
brdo-624ffd1510e3b1ed1b4174992b95a1c2c2e11b4d.tar.bz2
- Patch #8444 by jhriggs: creating new users was broken due to recent changes.
-rw-r--r--modules/user.module29
-rw-r--r--modules/user/user.module29
2 files changed, 30 insertions, 28 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'] .'" &lt;'. $edit['mail'] .'&gt;');
+ if (!form_has_errors()) {
+ watchdog('user', 'new user: "'. $edit['name'] .'" &lt;'. $edit['mail'] .'&gt;');
+
+ 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()) {
diff --git a/modules/user/user.module b/modules/user/user.module
index 1d5551eec..ba85e5a32 100644
--- a/modules/user/user.module
+++ b/modules/user/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'] .'" &lt;'. $edit['mail'] .'&gt;');
+ if (!form_has_errors()) {
+ watchdog('user', 'new user: "'. $edit['name'] .'" &lt;'. $edit['mail'] .'&gt;');
+
+ 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()) {