Friday, November 27, 2009

Joomla: Redirect to same page after login

Here's some code to redirect Joomla to the page you want, after forcing a user to login first.


$uri =& JFactory::getURI();
$redirect = '&return='.base64_encode($uri->toString());
$this->setRedirect(JRoute::_('/index.php?option=com_user&view=login'.$redirect),
"Please login.");

No comments: