Created
June 30, 2016 13:16
-
-
Save hans2103/2a40b13fe62b31cb7cf8e93d817a6db4 to your computer and use it in GitHub Desktop.
return to the previous page after login. Template override com_users/login/default_login.php for Joomla!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ($this->params->get('login_redirect_url')) | |
{ | |
$login_redirect_url = $this->params->get('login_redirect_url', $this->form->getValue('return')); | |
} | |
else | |
{ | |
$referer = htmlspecialchars($_SERVER['HTTP_REFERER']); | |
$uri = JUri::getInstance($referer); | |
$query = JFactory::getApplication()->getRouter()->parse($uri); | |
$login_redirect_url = 'index.php?' . JUri::getInstance()->buildQuery($query); | |
} | |
?> | |
<input type="hidden" name="return" | |
value="<?php echo base64_encode($login_redirect_url); ?>"/> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
feel free to improve when visitor access the page directly to login screen. ;-)