Example #1
0
 function listing()
 {
     $user = JFactory::getUser();
     if ($user->guest) {
         $app = JFactory::getApplication();
         $app->enqueueMessage(JText::_('PLEASE_LOGIN_FIRST'));
         global $Itemid;
         $url = '';
         if (!empty($Itemid)) {
             $url = '&Itemid=' . $Itemid;
         }
         if (version_compare(JVERSION, '1.6', '<')) {
             $url = 'index.php?option=com_user&view=login' . $url;
         } else {
             $url = 'index.php?option=com_users&view=login' . $url;
         }
         $app->redirect(JRoute::_($url . '&return=' . urlencode(base64_encode(hikashop_currentUrl('', false))), false));
         return false;
     }
     return parent::listing();
 }