Пример #1
0
 protected function _preDispatch($action)
 {
     parent::_preDispatch($action);
     $this->perms = $this->getModelFromCache('EWRatendo_Model_Perms')->getPermissions();
     $visitor = XenForo_Visitor::getInstance();
     date_default_timezone_set($visitor['timezone']);
 }
Пример #2
0
 protected function _preDispatch($action)
 {
     parent::_preDispatch($action);
     $this->perms = $this->getModelFromCache('EWRmedio_Model_Perms')->getPermissions();
     if (!$this->perms['browse']) {
         throw $this->getNoPermissionResponseException();
     }
 }
Пример #3
0
 protected function _preDispatch($action)
 {
     if ($dataModelName = static::_getDataModelName()) {
         $dataModelName = static::_getDataModelName();
         $this->_dataModel = $this->getModelFromCache($dataModelName);
         $repoName = $this->_getRepositoryName();
         $this->_repository = new $repoName($this->_dataModel);
         $this->_id = $this->_input->filterSingle($dataModelName::getKey(), self::UINT);
     }
     parent::_preDispatch($action);
 }
Пример #4
0
 public function _preDispatch($action)
 {
     parent::_preDispatch($action);
     $this->_routeMatch->setResponseType('json');
     $opts = XenForo_Application::get('options');
     if (!$opts->mcAssocApiEnable) {
         throw $this->getNoPermissionResponseException();
     } else {
         $token = $this->_input->filterSingle('token', XenForo_Input::STRING);
         if ($token != $opts->mcAssocApiToken) {
             throw $this->getNoPermissionResponseException();
         }
     }
 }
Пример #5
0
 /**
  * @param $action
  * @throws XenForo_ControllerResponse_Exception
  */
 protected function _preDispatch($action)
 {
     parent::_preDispatch($action);
     $xenOptions = XenForo_Application::getOptions();
     if ($styleId = $xenOptions->sonnbXG_forceStyle) {
         $this->setViewStateChange('styleId', $styleId);
     }
     if (!$this->_getGalleryModel()->canViewGallery()) {
         if (!XenForo_Visitor::getUserId()) {
             throw $this->responseException($this->responseReroute('XenForo_ControllerPublic_Error', 'registrationRequired'));
         }
         throw $this->getErrorOrNoPermissionResponseException('sonnb_xengallery_you_do_not_have_permission_to_use_gallery');
     }
     if ($this->getResponseType() === 'api') {
         $this->_apiRequest = true;
     }
 }
Пример #6
0
 protected function _preDispatch($action)
 {
     parent::_preDispatch($action);
     $this->_visitor = XenForo_Visitor::getInstance();
     if (!$this->_type['type_perms']) {
         $this->_type['type_perms'] = [];
     } else {
         $this->_type['type_perms'] = unserialize($this->_type['type_perms']);
     }
     if ($this->_visitor['user_id']) {
         $this->_filter = $this->_getFilterModel()->getByUserIdAndType($this->_visitor['user_id'], $this->_type['type_id']);
     } else {
         $test = XenForo_Helper_Cookie::getCookie('GeekListing_filter_' . $this->_type['type_id']);
         if ($test !== false) {
             $this->_filter = @unserialize($test);
         }
     }
     foreach ($this->_type['type_perms'] as $k => $v) {
         $yes = false;
         if (is_array($v) && in_array(-1, $v)) {
             $yes = true;
         } else {
             if (is_array($v)) {
                 foreach ($v as $p) {
                     if ($this->_visitor->isMemberOf($p, true)) {
                         $yes = true;
                         break;
                     }
                 }
             } else {
                 $yes = $this->_visitor->isMemberOf($v, true);
             }
         }
         $this->_perms[$k] = $yes;
     }
 }
Пример #7
0
 protected function _preDispatch($action)
 {
     $requiredScope = $this->_getScopeForAction($action);
     $this->_assertRequiredScope($requiredScope);
     parent::_preDispatch($action);
 }
Пример #8
0
 protected function _preDispatch($action)
 {
     parent::_preDispatch($action);
     $this->perms = $this->getModelFromCache('EWRmedio_Model_Perms')->getPermissions();
     $this->slugs = explode('/', $this->_routeMatch->getMinorSection());
     if (!$this->perms['view']) {
         throw $this->getNoPermissionResponseException();
     }
 }
Пример #9
0
 protected function _preDispatch($action)
 {
     parent::_preDispatch($action);
     $this->perms = $this->getModelFromCache('EWRatendo_Model_Perms')->getPermissions();
     $this->slugs = explode('/', $this->_routeMatch->getMinorSection());
 }
Пример #10
0
 protected function _preDispatch($action)
 {
     parent::_preDispatch($action);
     $this->perms = $this->getModelFromCache('EWRporta_Model_Perms')->getPermissions();
 }