Posted by dandaman on December 28, 2009 at 4:59pm
5 followers
Jump to:
| Project: | Thickbox |
| Version: | 6.x-1.6 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
I've found on a couple sites that the code of the Thickbox Login would always redirect you back to the home page of the site after login. Many of us, I expect, would like the ability to use the standard Drupal action, which is just logging you in and then bringing you back to the same page. I have included a patch that adds the necessary code so that the redirect does pass through.
| Attachment | Size |
|---|---|
| thickbox_redirect.patch | 2.3 KB |
Comments
#1
If you add a destination to the login link Thickbox will use that. I believe that is a better way of handling this.
This code:
l(t('Login'), 'user/login', array('query' => drupal_get_destination()))Will print out this if you e.g. are on the blog page:
<a href="/user/login?destination=blog">Login</a>#2
That patch is really helpful. I would rather it be an option on the admin page, but this is good for a quick fix.
#3
@fro
Yes, this works perfect. I don't see a reason for a patch..
<?phpprint l(t('Login'), 'user/login', array('query' => drupal_get_destination()));
?>
#4
Could you please give instruction as to where to put the php code?
I am using a hand-typed link on a page plus thickbox and I need to redirect back to that page after login.
Thank you!
#5
If you are using a hand typed link just construct it like this:
<a href="/user/login?destination=blog">Login</a>Replace "blog" with the path to the page in question.
#6
I did that and it works, except that I also have "Already In" module for those who are logged in so that they get redirected to another page instead of Access Denied error.
Changing the link is now breaking that feature.
I just can't seem to get all of the features I want working at once. They seem like pretty basic things most people would want.
I need to:
1. allow user a way to avoid a page load on login (Thickbox or Lightbox or something similar)
2. redirect back to page user was on once logged in (tried many methods/modules and #5 is the only one that works)
3. if user is already logged in, give a message other than "Access Denied"
It would also be lovely to be able to request a new account in the same manner, but that is a separate issue.