Commit 624ffd15 authored by Dries's avatar Dries
Browse files

- Patch #8444 by jhriggs: creating new users was broken due to recent changes.

parent 4d91449d
......@@ -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()) {
......
......@@ -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()) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment