Closed (fixed)
Project:
Login Destination
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
3 May 2007 at 10:18 UTC
Updated:
11 May 2007 at 13:52 UTC
Hi,
I was jus wondering how to code a snippet that would redirect the user to the page where he logged in. For example, if my user logs in on node/180 because he would like to post a comment, I think that he should be redirected to the node/180.
Can somebody explain how to do that?
Thanks in advance!
Caroline
Comments
Comment #1
ardas commentedInteresting question...
I wonder, is it possible to login from node/180 page? Login is performed from user/login page unless you set up logintoboggan.module which has an ability to output login form on a 'no access' page. If so, you can try to use $_GET['q'] in your snippet to take current path.
Or am I missing something?
Comment #2
Luneh commentedWell, what I mean is that you can log in on every single page when using a login block. Which means that, yes, you can be reading for example node/180 page and decide to log in using the box.
On most websites you then come back to the page where you decided to log in.
Comment #3
ardas commentedI don't know at the moment:)
You can of course write something like a variable_set('ld_path', $_GET['q']) in a Redirect condition option in order to save old page path. And then read ld_path variable and redirect to that path.
But I'll think of a better solution.
Comment #4
ardas commentedbtw, drupal.org behaves exactly as you described. I'm starting to think that Drupal core user.module redirects you to the page you were logging from, doesn't it? You don't need login_destination.module in this case at all.
Comment #5
Luneh commentedHi,
You're right. I was so deep into the thinking about how to change this issue that I did not even remember that before I installed the module, Drupal was reacting as intended. I have desactivated the module and found another way to do what I wanted to do with the module.
Thanks :)
Comment #6
ardas commentedno prob :)
Comment #7
ardas commentedno prob :)