當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CFilterChain類代碼示例

本文整理匯總了PHP中CFilterChain的典型用法代碼示例。如果您正苦於以下問題:PHP CFilterChain類的具體用法?PHP CFilterChain怎麽用?PHP CFilterChain使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了CFilterChain類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: filterSuperAdminOnly

 public function filterSuperAdminOnly(CFilterChain $filterChain)
 {
     if (!Yii::app()->user->is("SuperAdmin")) {
         throw new CHttpException("You don't have super admin privileges to access this page");
     }
     $filterChain->run();
 }
開發者ID:jankichaudhari,項目名稱:yii-site,代碼行數:7,代碼來源:BaseSuperAdminController.php

示例2: filterEnsureToken

 /**
  * @param \CFilterChain $filterChain
  */
 public function filterEnsureToken(\CFilterChain $filterChain)
 {
     if (($token = \Yii::app()->request->getQuery('token')) === null) {
         $this->accessDenied(Helper::t('errors', 'Invalid authentication token.'));
     }
     $filterChain->run();
 }
開發者ID:azamath,項目名稱:yii-account,代碼行數:10,代碼來源:Controller.php

示例3: filterValidateServe

 /**
  * Ensure that everything is prepared before we execute the serve action.
  * @param CFilterChain $filterChain Instance of CFilterChain.
  */
 public function filterValidateServe($filterChain)
 {
     header('X-Powered-By:');
     header('Pragma:');
     header('Expires:');
     header('Cache-Control:');
     header('Last-Modified:');
     header('Etag:');
     @ob_end_clean();
     if (isset($_GET['g'])) {
         $qs = 'g=' . $_GET['g'];
         if (isset($_GET['lm'])) {
             $lm = $_GET['lm'];
             if (ctype_digit((string) $lm)) {
                 $qs .= '&' . $lm;
             }
         }
         $_SERVER['QUERY_STRING'] = $qs;
     }
     if (isset(Yii::app()->log)) {
         foreach (Yii::app()->log->routes as $route) {
             if ($route instanceof CWebLogRoute) {
                 $route->enabled = false;
             }
         }
     }
     $filterChain->run();
 }
開發者ID:maruthisivaprasad,項目名稱:zurmo,代碼行數:32,代碼來源:ExtMinScriptController.php

示例4: filterNotGuestAndFriendIdExists

 public function filterNotGuestAndFriendIdExists(CFilterChain $chain)
 {
     if (!isset($_POST['friend_id']) || Yii::app()->user->isGuest) {
         $this->badRequest();
     }
     return $chain->run();
 }
開發者ID:blindest,項目名稱:Yii-CMS-2.0,代碼行數:7,代碼來源:FriendController.php

示例5: filterPreloadOrder

 /**
  * Filters requests that are not passing order_id as a parameter.
  *
  * @param CFilterChain $filterchain 
  */
 public function filterPreloadOrder($filterchain)
 {
     if ($this->order === null) {
         throw new CHttpException(403, 'Invalid request!');
     }
     $filterchain->run();
 }
開發者ID:sanggabee,項目名稱:fmi-mini-market,代碼行數:12,代碼來源:OrderItemController.php

示例6: filterGuestView

 public function filterGuestView(CFilterChain $filterChain)
 {
     if (Yii::app()->user->is("guest")) {
         $this->layout = '/layouts/guestLogin';
     }
     $filterChain->run();
 }
開發者ID:jankichaudhari,項目名稱:yii-site,代碼行數:7,代碼來源:AdminController.php

示例7: filterCheckBackendCanStream

 /**
  * Displays a flash if the backend doesn't support streaming
  * @param CFilterChain $filterChain the filter chain
  */
 public function filterCheckBackendCanStream($filterChain)
 {
     // Check backend version and warn about incompatibilities
     if (!Yii::app()->xbmc->meetsMinimumRequirements() && !Setting::getBoolean('disableFrodoWarning')) {
         Yii::app()->user->setFlash('info', Yii::t('Misc', 'Streaming of video files is not possible from XBMC 12 "Frodo" backends'));
     }
     $filterChain->run();
 }
開發者ID:pweisenburger,項目名稱:xbmc-video-server,代碼行數:12,代碼來源:MediaController.php

示例8: filterCheckConfiguration

 /**
  * Checks that the application has been configured, and if not redirects 
  * to the "create backend" page
  * @param CFilterChain $filterChain
  */
 public function filterCheckConfiguration($filterChain)
 {
     if (Yii::app()->backendManager->getCurrent() === null) {
         Yii::app()->user->setFlash('error', Yii::t('Backend', 'You must configure a backend before you can use the application'));
         $this->redirect(array('backend/create'));
     }
     $filterChain->run();
 }
開發者ID:pweisenburger,項目名稱:xbmc-video-server,代碼行數:13,代碼來源:Controller.php

示例9: filterCheckConfiguration

 /**
  * Override parent implementation so we don't get stuck in a redirect loop
  * @param CFilterChain $filterChain
  */
 public function filterCheckConfiguration($filterChain)
 {
     if ($this->route === 'backend/create') {
         $filterChain->run();
     } else {
         parent::filterCheckConfiguration($filterChain);
     }
 }
開發者ID:Victor61,項目名稱:xbmc-video-server,代碼行數:12,代碼來源:BackendController.php

示例10: filterAjaxOnlySilent

 /**
  * Фильтр аналогичен фильтру ajaxOnly, только по нему не происходит уведомлений об ошибках на e-mail
  * The filter method for 'ajaxOnly' filter.
  * This filter throws an exception (CHttpException with code 400) if the applied action is receiving a non-AJAX request.
  * @param CFilterChain $filterChain the filter chain that the filter is on.
  * @throws CHttpException if the current request is not an AJAX request.
  */
 public function filterAjaxOnlySilent($filterChain)
 {
     if (Yii::app()->getRequest()->getIsAjaxRequest()) {
         $filterChain->run();
     } else {
         throw new DaHttpException(400, Yii::t('yii', 'Your request is invalid.'));
     }
 }
開發者ID:kot-ezhva,項目名稱:ygin,代碼行數:15,代碼來源:DaWebController.php

示例11: filter

 /**
  * Performs the filtering.
  * The default implementation simply calls {@link init()},
  * {@link CFilterChain::run()} and {@link run()} in order
  * Derived classes may want to override this method to change this behavior.
  * @param CFilterChain $filterChain the filter chain that the filter is on.
  */
 public function filter($filterChain)
 {
     $this->init();
     if (!$this->stopAction) {
         $filterChain->run();
         $this->run();
     }
 }
開發者ID:conghua1013,項目名稱:Yii-Bootstrap-Admin,代碼行數:15,代碼來源:CFilterWidget.php

示例12: filterAccessControl

 /**
  * User permissions filter.
  * 
  * @param CFilterChain $filterChain
  */
 public function filterAccessControl($filterChain)
 {
     $user = Yii::app()->user;
     if ($user->isGuest) {
         $this->redirect(array('profile/login'));
     } else {
         $filterChain->run();
     }
 }
開發者ID:vchimishuk,項目名稱:itquotes,代碼行數:14,代碼來源:QuoteController.php

示例13: filterAuthCheck

 /**
  * 進行權限檢查的內聯過濾器
  * 當權限檢查失敗時拋出全局異常
  * 
  * @param CFilterChain $filterChains
  */
 public function filterAuthCheck($filterChains)
 {
     // 未登錄用戶直接調轉到首頁,強製重新登錄
     if (Yii::app()->user->isGuest) {
         $this->redirect(Yii::app()->createAbsoluteUrl('adminlogin/index'));
     }
     KefuRbacTool::getInstance()->checkAccess();
     $filterChains->run();
 }
開發者ID:a707937337,項目名稱:bscy,代碼行數:15,代碼來源:AdminSet.php

示例14: filterAuthCheck

 /**
  * 進行權限檢查的內聯過濾器
  * 當權限檢查失敗時拋出全局異常
  *
  * @param CFilterChain $filterChains
  */
 public function filterAuthCheck($filterChains)
 {
     if (empty(Yii::app()->session['info'])) {
         $this->redirect(Yii::app()->createAbsoluteUrl('passport/index'));
     } else {
         if (Yii::app()->session['info']['logintime'] + 86400 < time()) {
             $this->redirect(Yii::app()->createAbsoluteUrl('passport/index'));
         }
     }
     $filterChains->run();
 }
開發者ID:a707937337,項目名稱:bscy,代碼行數:17,代碼來源:UserSet.php

示例15: filterMaintananceModeAccessControl

 /**
  * Allow access to all upgrade actions only to Super Administrators.
  * @param CFilterChain $filterChain
  */
 public function filterMaintananceModeAccessControl($filterChain)
 {
     if (!Yii::app()->isApplicationInMaintenanceMode()) {
         $message = Zurmo::t('InstallModule', 'Please set $maintenanceMode = true in perInstance.php config file.');
         $messageView = new AccessFailureView($message);
         $view = new AccessFailurePageView($messageView);
         echo $view->render();
         Yii::app()->end(0, false);
     }
     $filterChain->run();
 }
開發者ID:maruthisivaprasad,項目名稱:zurmo,代碼行數:15,代碼來源:UpgradeController.php


注:本文中的CFilterChain類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。