summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2006-01-05 10:55:51 +0000
committerDries Buytaert <dries@buytaert.net>2006-01-05 10:55:51 +0000
commitdb1e1b53887ddf29f7e9470372e1c40de91dd644 (patch)
treefcb67af55cfabefceeb36a29360c1722b4755fd1
parent8d7ff5aea28c96856ee9b66e7d85bfd4ba0c39f9 (diff)
downloadbrdo-db1e1b53887ddf29f7e9470372e1c40de91dd644.tar.gz
brdo-db1e1b53887ddf29f7e9470372e1c40de91dd644.tar.bz2
- Patch #42541 by merlinofchaos: critical bug fix: public user registrations not always working.
-rw-r--r--modules/user.module3
-rw-r--r--modules/user/user.module3
2 files changed, 4 insertions, 2 deletions
diff --git a/modules/user.module b/modules/user.module
index d72d6da2c..75490a142 100644
--- a/modules/user.module
+++ b/modules/user.module
@@ -1118,7 +1118,8 @@ function user_register_submit($form_id, $form_values) {
watchdog('security', t('Detected malicious attempt to alter protected user fields.'), WATCHDOG_WARNING);
drupal_goto('user/register');
}
- $account = user_save('', array_merge($form_values, array('pass' => $pass, 'init' => $mail, 'roles' => array('authenticated user' => _user_authenticated_id()), 'status' => $admin || variable_get('user_register', 1))));
+
+ $account = user_save('', array_merge($form_values, array('pass' => $pass, 'init' => $mail, 'roles' => array('authenticated user' => _user_authenticated_id()), 'status' => ($admin || variable_get('user_register', 1) == 1))));
watchdog('user', t('New user: %name %email.', array('%name' => theme('placeholder', $name), '%email' => theme('placeholder', '<'. $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));
diff --git a/modules/user/user.module b/modules/user/user.module
index d72d6da2c..75490a142 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -1118,7 +1118,8 @@ function user_register_submit($form_id, $form_values) {
watchdog('security', t('Detected malicious attempt to alter protected user fields.'), WATCHDOG_WARNING);
drupal_goto('user/register');
}
- $account = user_save('', array_merge($form_values, array('pass' => $pass, 'init' => $mail, 'roles' => array('authenticated user' => _user_authenticated_id()), 'status' => $admin || variable_get('user_register', 1))));
+
+ $account = user_save('', array_merge($form_values, array('pass' => $pass, 'init' => $mail, 'roles' => array('authenticated user' => _user_authenticated_id()), 'status' => ($admin || variable_get('user_register', 1) == 1))));
watchdog('user', t('New user: %name %email.', array('%name' => theme('placeholder', $name), '%email' => theme('placeholder', '<'. $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));