By glennnz on
Hi
I have created a custom page-user.tpl.php file that puts the three forms (Login, Register and lost password) into the same page.
Code is:
<div id="main">
<?php if ($mission) { ?><div id="mission"><?php print $mission ?></div><?php } ?>
<?php print $breadcrumb ?>
<?php drupal_set_title($title = 'Login or Register'); ?>
<?php if ($title) { ?><h1 class="node-title"><?php print $title ?></h1><?php } ?>
<?php if ($show_messages) { print $messages; } ?>
<?php print $help ?>
<table>
<tr>
<td>
<?php $form = drupal_get_form('user_login'); ?>
<h3>Existing users login</h3>
<?php print $form; ?>
<?php $form = drupal_get_form('user_pass'); ?>
<h3>Forgotten password?</h3>
<?php print $form; ?>
</td>
<td>
<?php $form = drupal_get_form('user_register'); ?>
<h3>Create new account</h3>
<?php print $form; ?>
</td>
</tr>
</table>
<?php print $feed_icons; ?>
</div>
Renders great, but when a user requests a new password, and clicks the link in the email, it takes them to this page again and doesn't log them in so they can edit their password.
Any ideas?
Thanks
Glenn
Comments
User get redirected to my
User get redirected to my account edit to change the password.
In your case you have changed the page-user.tpl to just display these form alone even if the user is logged in
Change your tpl as below
Ah, of course! It's always
Ah, of course!
It's always easy once someone points out the answer ;-)
Thanks
Glenn
--UPDATE--
That didn't work....
:-(
Glenn
Glenn
THECA Group
subscribe
subscribe
I tried this snippet of code
I tried this snippet of code and it work as expected
but how to get rid of the tab ?
http://i36.photobucket.com/albums/e28/adrianmak2/Capture-14.jpg
Hi all, Any workaround?
Hi all,
Any workaround? Please! I have the exactly same problem...
Thanks.
Best Regards,
Eurico
OK... I got it... I check
OK... I got it...
I check if the arg(1) == 'reset' then print $content. Like $user->uid...
This is fantastic - love your
This is fantastic - love your work!
Sweet! Works like a charm..
Sweet! Works like a charm..
filtermusic.net
It works, thanks!
I had some trouble until I realized that I needed to copy the parts of my page.tpl.php that I wanted to include into the page-user.tpl.php. The code here just spits out the actual login and register fields/inputs.
I also changed the name to page-user-login.tpl.php so the user account page wouldn't be affected.
Thanks for the code, you can see it at http://lickitornot.com/user/login
Validate to login and registration form on same page
How can handle validations for separate each form in the same page ?