Exemplo n.º 1
0
 public function authenticateRequest()
 {
     $user_id = APIHelper::getAPIUserID();
     if ($user_id === false) {
         return false;
     } else {
         $user = JFactory::getUser($user_id);
         if (!$user->id) {
             $this->setError(JText::_('COM_API_USER_NOT_FOUND'));
             return false;
         }
         if ($user->block == 1) {
             $this->setError(JText::_('COM_API_BLOCKED_USER'));
             return false;
         }
         return $user;
     }
 }
Exemplo n.º 2
0
 function setSessionUser()
 {
     $session =& JFactory::getSession();
     $session->set('user', JUser::getInstance(APIHelper::getAPIUserID()));
 }