From a5f9391550415d7c856521dc4ab1678de5bbcc36 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Fri, 21 Oct 2005 09:30:14 +0000 Subject: [PATCH] - Modified patch #34472 by Moshe: uid=1 does not redirect to edit page after registration. --- modules/user.module | 4 ++-- modules/user/user.module | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/user.module b/modules/user.module index e6175e03e85..ea8975d5d09 100644 --- a/modules/user.module +++ b/modules/user.module @@ -182,7 +182,7 @@ function user_save($account, $array = array(), $category = 'account') { // Build and save the serialized data field now $data = array(); foreach ($array as $key => $value) { - if ((substr($key, 0, 4) !== 'auth') && (!in_array($key, $user_fields)) && ($value !== null)) { + if ((substr($key, 0, 4) !== 'auth') && ($key != 'roles') && (!in_array($key, $user_fields)) && ($value !== null)) { $data[$key] = $value; } } @@ -1086,7 +1086,7 @@ function user_register($edit = array()) { user_mail($edit['mail'], t('drupal user account details for %s', array('%s' => $edit['name'])), strtr(t("%username,\n\nYou may now login to %uri using the following username and password:\n\n username: %username\n password: %password\n\n%edit_uri\n\n--drupal"), $variables), "From: $from\nReply-to: $from\nX-Mailer: Drupal\nReturn-path: $from\nErrors-to: $from"); // This should not be t()'ed. No point as its only shown once in the sites lifetime, and it would be bad to store the password. $form['instructions'] = array('#type' => 'markup', '#value' => "

Welcome to Drupal. You are user #1, which gives you full and immediate access. All future registrants will receive their passwords via e-mail, so please configure your e-mail settings using the Administration pages.

Your password is $pass. You may change your password on the next page.

Please login below.

"); - $form['#action'] = url("user/$account->uid/edit"); + $form['#action'] = url('user/1/edit', 'destination=user/1/edit'); $form['name'] = array('#type' => 'hidden', '#value' => $account->name); $form['pass'] = array('#type' => 'hidden', '#value' => $pass); $form['submit'] = array('#type' => 'submit', '#value' => t('Log in')); diff --git a/modules/user/user.module b/modules/user/user.module index e6175e03e85..ea8975d5d09 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -182,7 +182,7 @@ function user_save($account, $array = array(), $category = 'account') { // Build and save the serialized data field now $data = array(); foreach ($array as $key => $value) { - if ((substr($key, 0, 4) !== 'auth') && (!in_array($key, $user_fields)) && ($value !== null)) { + if ((substr($key, 0, 4) !== 'auth') && ($key != 'roles') && (!in_array($key, $user_fields)) && ($value !== null)) { $data[$key] = $value; } } @@ -1086,7 +1086,7 @@ function user_register($edit = array()) { user_mail($edit['mail'], t('drupal user account details for %s', array('%s' => $edit['name'])), strtr(t("%username,\n\nYou may now login to %uri using the following username and password:\n\n username: %username\n password: %password\n\n%edit_uri\n\n--drupal"), $variables), "From: $from\nReply-to: $from\nX-Mailer: Drupal\nReturn-path: $from\nErrors-to: $from"); // This should not be t()'ed. No point as its only shown once in the sites lifetime, and it would be bad to store the password. $form['instructions'] = array('#type' => 'markup', '#value' => "

Welcome to Drupal. You are user #1, which gives you full and immediate access. All future registrants will receive their passwords via e-mail, so please configure your e-mail settings using the Administration pages.

Your password is $pass. You may change your password on the next page.

Please login below.

"); - $form['#action'] = url("user/$account->uid/edit"); + $form['#action'] = url('user/1/edit', 'destination=user/1/edit'); $form['name'] = array('#type' => 'hidden', '#value' => $account->name); $form['pass'] = array('#type' => 'hidden', '#value' => $pass); $form['submit'] = array('#type' => 'submit', '#value' => t('Log in'));