コード例 #1
0
ファイル: Birthdays.php プロジェクト: Sywooch/forums
 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
ファイル: Keyword.php プロジェクト: Sywooch/forums
 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
ファイル: Api.php プロジェクト: adamjdev/XenForo-MCASSOC
 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
ファイル: Abstract.php プロジェクト: Sywooch/forums
 /**
  * @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
ファイル: Base.php プロジェクト: samuelsweet/xf
 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
ファイル: Abstract.php プロジェクト: codeversed/bdApi
 protected function _preDispatch($action)
 {
     $requiredScope = $this->_getScopeForAction($action);
     $this->_assertRequiredScope($requiredScope);
     parent::_preDispatch($action);
 }
コード例 #8
0
ファイル: Media.php プロジェクト: Sywooch/forums
 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
ファイル: Events.php プロジェクト: Sywooch/forums
 protected function _preDispatch($action)
 {
     parent::_preDispatch($action);
     $this->perms = $this->getModelFromCache('EWRatendo_Model_Perms')->getPermissions();
     $this->slugs = explode('/', $this->_routeMatch->getMinorSection());
 }
コード例 #10
0
ファイル: Portal.php プロジェクト: Sywooch/forums
 protected function _preDispatch($action)
 {
     parent::_preDispatch($action);
     $this->perms = $this->getModelFromCache('EWRporta_Model_Perms')->getPermissions();
 }