diff --git a/modules/openid/openid.module b/modules/openid/openid.module index 54eee9abf13..a0bc93324fd 100644 --- a/modules/openid/openid.module +++ b/modules/openid/openid.module @@ -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(); }