I have certain pages that require to a user to be logged in Joomla. When they click on the links to those pages a login box appears in an iframe overlay. Once they login, I want to redirect them back to the page they were trying to login to, however, Joomla seems to only allow a user to be redirected to a page that is predefined in the login form parameters. Is there a way to do this without completely hacking Joomla.
If not, does anyone have a recommendation on how to hack this an easy way.
You can use like
$return = JURI::getInstance()->toString();
$url = 'index.php?option=com_user&view=login';
$url .= '&return='.base64_encode($return);
$this->setRedirect($url, XiText::_('YOU_MUST_LOGIN_FIRST')); // if you are in controller
or
JFactory::getApplication()->redirect($url, XiText::_('YOU_MUST_LOGIN_FIRST'));