Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function redirectToLogin($msg = 'You must login first')
- {
- global $mainframe;
- $currentUser =& JFactory::getUser();
- //If user is not logged-in
- if($currentUser->get('guest'))
- {
- $uri = JFactory::getURI();
- $return = $uri->toString();
- $url = 'index.php?option=com_user&view=login';
- $url .= '&return='.base64_encode($return);
- $mainframe->redirect($url, JText::_($msg));
- exit();
- }
- }
- ?>
Add Comment
Please, Sign In to add comment