After login, direct user back to the page where they clicked sign in?

Permalink
Hi all

At present my c5 installation redirects the user to the homepage following a login. I'd like it to redirect to the page one which the link was clicked, so when the editor user browses the site and sees a mistake, or a page which needs to be updated, they can click the sign in link and be returned to the page where they noticed the mistake.

If the site is big with lots of levels (or lots of very similar pages), it could be cumbersome to go from the homepage to the specific page with the mistake on it.

Any thoughts on this? It seems like it should be easy enough to include the referring URL in the resultant URL following login.

If this has already been dealt with, I apologise! (I couldn't find anything by searching)

melat0nin
 
melat0nin replied on at Permalink Reply
melat0nin
Apologies, it seems I didn't search hard enough. The solution is here:

http://www.concrete5.org/private/bugs/login-redirect-at-the-last-pa...

Basically the code is as follows (for anyone else who wants to achieve this):

<a href="<?php echo $this->url('/login?rcID=') . DIR_REL . $c->getCollectionPath() ?>"><?php echo t('Sign in')?></a>