This module override user module settings for register if Anonymous user has not access to register.
user module code.
if (variable_get('user_register', USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL)) {
$items[] = l(t('Create new account'), 'user/register', array('attributes' => array('title' => t('Create a new user account.'))));
}
Override by this module.
// Add register button.
if (in_array('register', $links_enabled) && $form_id != 'user_register_form') {
$options['attributes']['title'] = t('Create new account');
$links[] = l(t('Create new account'), 'ajax_register/register/nojs', $options);
}
Need to add extra condition for register button.
// Add register button.
if (in_array('register', $links_enabled) && $form_id != 'user_register_form' && variable_get('user_register', USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL)) {
$options['attributes']['title'] = t('Create new account');
$links[] = l(t('Create new account'), 'ajax_register/register/nojs', $options);
}
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | register_button_access_1909410_2.patch | 749 bytes | wjackson |
Comments
Comment #1
sarjeet.singh commentedComment #2
wjackson commentedThis is exactly what I needed!
Attached is a patch that applies your changes to the module.
Thank you, Sarjeet.singh!
Comment #3
kalabroMakes sense
Comment #4
spleshkaThanks all, commited to 7.x-4.x.