Posted by yenidem on December 24, 2011 at 9:56am
4 followers
Jump to:
| Project: | LoginToboggan |
| Version: | 7.x-1.3 |
| Component: | User interface |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
| Issue tags: | public registration |
Issue Summary
Hello to Drupal lovers,
I want to show user registration form when the visitors try to get limited/authorization required pages. The Logintoboggan module has this feature but there are two options/tab, login form and registration form. The default view is login form. Can I change to default view as registration form?
I checked below codes but I could not find it..
/**
* Theme function for unified login page.
*
* @ingroup themable
*/
function theme_lt_unified_login_page($variables) {
$login_form = $variables['login_form'];
$register_form = $variables['register_form'];
$active_form = $variables['active_form'];
$output = '';
$output .= '<div class="toboggan-unified ' . $active_form . '">';
// Create the initial message and links that people can click on.
$output .= '<div id="login-message">' . t('You are not logged in.') . '</div>';
$output .= '<div id="login-links">';
$output .= l(t('I have an account'), 'user/login', array('attributes' => array('class' => array('login-link'), 'id' => 'login-link')));
$output .= ' ';
$output .= l(t('I want to create an account'), 'user/register', array('attributes' => array('class' => array('login-link'), 'id' => 'register-link')));
$output .= '</div>';
// Add the login and registration forms in.
$output .= '<div id="login-form">' . $login_form . '</div>';
$output .= '<div id="register-form">' . $register_form . '</div>';
$output .= '</div>';
return $output;
}
Comments
#1
up.
#2
I'm not sure how to accomplish this "the right way" either.
It seems like either line 915 (
function logintoboggan_get_authentication_form($active_form = 'login') {) or 746 (function logintoboggan_unified_login_page($active_form = 'login') {) of logintoboggan.module would control theunifiedLoginActiveFormsetting called on line 23 of logintoboggan.unifiedlogin.js which would determine which of the two forms is the "active" form.I've changed both lines 915 and 746 of logintoboggan.module to
function logintoboggan_get_authentication_form($active_form = 'register') {) and (function logintoboggan_unified_login_page($active_form = 'register') {, respectively as a temporary hack, but that didn't seem to have an effect.Any suggestions?
#3
I have a problem related with this. On a node i' ve put a link to /user/register, so unregistered users can get to register form fast.
Problem is user gets a login form, not a register form (as yenidem mentioned).
Looking the code, i think the "bug" is on line 929 function logintoboggan_denied() { }
It seems by default anonymous users hasn't permission access to /user/register, and also that function calls directly
$output = logintoboggan_get_authentication_form('login');
notice the fixed 'login' parameter.
I hope somebody can work on this?
#4
@javier.alejandro.castro — Thanks for pointing me in the right direction. Changing line 933 of logintoboggan.module to
$output = logintoboggan_get_authentication_form('register');does, indeed, call up the register form by default. I wish there were a way to change that without hacking the module.