#154300 by chx: enforce site user account creation policy in openid module too

6.x
Gábor Hojtsy 2007-09-25 14:52:55 +00:00
parent 1f5ea29689
commit 6143f13c41
1 changed files with 4 additions and 1 deletions

View File

@ -345,7 +345,7 @@ function openid_authentication($response) {
drupal_set_message(t('You must validate your email address for this account before logging in via OpenID'));
}
}
else {
elseif (variable_get('user_register', 1)) {
// Register new user
$form_state['redirect'] = NULL;
$form_state['values']['name'] = (empty($response['openid.sreg.nickname'])) ? $identity : $response['openid.sreg.nickname'];
@ -374,6 +374,9 @@ function openid_authentication($response) {
}
drupal_redirect_form($form, $form_state['redirect']);
}
else {
drupal_set_message(t('Only site administrators can create new user accounts.'), 'error');
}
drupal_goto();
}