Redirect to Previous Page on Login
Permalink 1 user found helpful
Right now when a user logs into my C5 site, they get directed to the dashboard rather than back to the page they were on. Is there an easy way to change this? I thought I saw something in the Forum here about that, but now I can't find it.
Thanks!
Thanks!
Thanks Andrew, worked perfectly!
Now I'm wondering if there's any way to do the same thing if you're on a front-end page and hit the logout button (obviously logging out from within the dashboard is a separate issue).
I found the page "elements/page_controls.php" with its logout link, but obviously I don't want to go meddling with the core code. Any thoughts on a workaround? I tried creating my own file at root level and it didn't seem like I can override the core elements pages.
Now I'm wondering if there's any way to do the same thing if you're on a front-end page and hit the logout button (obviously logging out from within the dashboard is a separate issue).
I found the page "elements/page_controls.php" with its logout link, but obviously I don't want to go meddling with the core code. Any thoughts on a workaround? I tried creating my own file at root level and it didn't seem like I can override the core elements pages.
ok so that forwards back to the same page but what If I want to have a login go to a 'members' area (and not dashboard)
David,
If I understand Andrew's post correctly, I think you could accomplish your goal by substituting the members area's cID in place of $c->getCollectionID(). So if your member area collection ID is "48", you would make the link:
If I understand Andrew's post correctly, I think you could accomplish your goal by substituting the members area's cID in place of $c->getCollectionID(). So if your member area collection ID is "48", you would make the link:
<a href="<?=$this->url('/login', 'forward', '48')?>">Login here!</a>
This is exactly what I have wanted to do but can't seem to get it to work. Any help is appreciated...Thanks.
Here's my code:
I get a Parse error: syntax error, unexpected ';' in default.php on this line of code.
Here's my code:
<form method="post" action="<?=$this->url('/login';'forward','24')?>">
I get a Parse error: syntax error, unexpected ';' in default.php on this line of code.
...after the first argument
should do the things :D
cYa
<form method="post" action="<?=$this->url('/login', 'forward', '24')?>">
should do the things :D
cYa
Yep...needed the reading glasses. However this approach still requires a user to login twice prior to passing to the cID. Anyway to do this directly from my post action??
I tried this but no go:
Thoughts..??
I tried this but no go:
<form method="post" action="<?=$this->url('/login/-/do_login','forward','24')?>">
Thoughts..??
<a href="<?=$this->url('/login','forward',$c->getCollectionID())?>">
you'll need another ")" at the end as the original was just ('/login'), we added getCollectionID() but forgot to close the ")"
you'll need another ")" at the end as the original was just ('/login'), we added getCollectionID() but forgot to close the ")"
I know this is a very old topic, but any ideas on how to reverse this for the logout?
"logout" seems to replace the "forward" variable. Can they be stacked or something?
<a href="<?php echo $this->url('/login', 'logout')?>">
"logout" seems to replace the "forward" variable. Can they be stacked or something?
Does anybody know a way to forward back to the same page but also pass the GET variables? Otherwise can we pass the URL instead of the page id?
To login and redirected back, this should work:
The forward method ensures that on completion of the login process, you'll be forwarded back to that page ID. At least, that's how it's supposed to work.