Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $app = JFactory::getApplication();
- $message = "You must be logged in to view this content";
- $url = JRoute::_('index.php?option=com_users&view=login&return=' . base64_encode('YOUR COMPONENT VIEW URL HERE')
- $app->redirect($url, $message);
- <?php
- $user = JFactory::getUser();
- if($user->id=='' || $user->id==NULL){
- // Your message here.
- }else{
- // Your code here
- }
- ?>
- JFactory::getApplication()->redirect(JRoute::_('index.php?option=com_users&view=login', JText::_("You must be logged in to view this content"));
- $url = JRoute::_('index.php?option=com_users&view=login&return=' . base64_encode('YOUR COMPONENT VIEW URL HERE')
- $this->setRedirect($url);
- return $this;
- $app = JFactory::getApplication();
- $app->enqueueMessage("You must be logged in to view this content", "Notice");
Add Comment
Please, Sign In to add comment