当前位置: 首页>>代码示例>>PHP>>正文


PHP MyController::beforeFilter方法代码示例

本文整理汇总了PHP中MyController::beforeFilter方法的典型用法代码示例。如果您正苦于以下问题:PHP MyController::beforeFilter方法的具体用法?PHP MyController::beforeFilter怎么用?PHP MyController::beforeFilter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MyController的用法示例。


在下文中一共展示了MyController::beforeFilter方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: beforeFilter

 function beforeFilter()
 {
     $this->name = 'groups';
     // required for admin controllers
     # Call beforeFilter of MyAdminController parent class
     parent::beforeFilter();
 }
开发者ID:atikahmed,项目名称:joomla-probid,代码行数:7,代码来源:groups_controller.php

示例2: beforeFilter

 function beforeFilter()
 {
     parent::beforeFilter();
     if (Sanitize::getInt($this->data, 'OwnerReply')) {
         $this->review_id = Sanitize::getInt($this->data['OwnerReply'], 'id');
     } else {
         $this->review_id = Sanitize::getInt($this->params, 'review_id');
     }
     if (!$this->Config->owner_replies || $this->review_id == 0 || $this->_user->id == 0) {
         $this->denyAccess = true;
         return;
     }
     // Get the listing id and extension
     $this->_db->setQuery("\n            SELECT \n                Review.pid AS listing_id, Review.`mode` AS extension\n            FROM \n                #__jreviews_comments AS Review\n            WHERE \n                Review.id = " . $this->review_id);
     // Get listing owner id and check if it matches the current user
     if ($listing = current($this->_db->loadAssocList())) {
         // Automagically load and initialize Everywhere Model to check if user is listing owner
         App::import('Model', 'everywhere_' . $listing['extension'], 'jreviews');
         $class_name = inflector::camelize('everywhere_' . $listing['extension']) . 'Model';
         if (class_exists($class_name)) {
             $this->Listing = new $class_name();
             $owner = $this->Listing->getListingOwner($listing['listing_id']);
             if ($this->_user->id != $owner['user_id']) {
                 $this->denyAccess = true;
                 return;
             }
             $this->data['Listing']['created_by'] = $owner['user_id'];
             // Used in the Activities component
             $this->data['Listing']['listing_id'] = $listing['listing_id'];
             // Used in the Activities component
             $this->data['Listing']['extension'] = $listing['extension'];
             // Used in the Activities component
         }
     }
 }
开发者ID:atikahmed,项目名称:joomla-probid,代码行数:35,代码来源:owner_replies_controller.php

示例3: beforeFilter

 function beforeFilter()
 {
     # Call beforeFilter of MyController parent class
     parent::beforeFilter();
     # Make configuration available in models
     $this->Listing->Config =& $this->Config;
 }
开发者ID:bizanto,项目名称:Hooked,代码行数:7,代码来源:listings_controller.php

示例4: beforeFilter

 function beforeFilter()
 {
     # Call beforeFilter of MyController parent class
     parent::beforeFilter();
     $this->jr_lat = Sanitize::getString($this->Config, 'geomaps.latitude');
     $this->jr_lon = Sanitize::getString($this->Config, 'geomaps.longitude');
 }
开发者ID:atikahmed,项目名称:joomla-probid,代码行数:7,代码来源:module_geomaps_controller.php

示例5: beforeFilter

 function beforeFilter()
 {
     # Call beforeFilter of MyController parent class
     parent::beforeFilter();
     # Stop AfterFind actions in Review model
     $this->Review->rankList = false;
 }
开发者ID:atikahmed,项目名称:joomla-probid,代码行数:7,代码来源:community_reviews_controller.php

示例6: beforeFilter

 function beforeFilter()
 {
     Configure::write('ListingEdit', false);
     # Call beforeFilter of MyController parent class
     parent::beforeFilter();
     # Stop AfterFind actions in Review model
     $this->Review->rankList = false;
 }
开发者ID:atikahmed,项目名称:joomla-probid,代码行数:8,代码来源:module_reviews_controller.php

示例7: beforeFilter

 function beforeFilter()
 {
     parent::beforeFilter();
     $this->viewSuffix = Sanitize::getString($this->params['module'], 'tmpl_suffix');
     # Set Theme
     $this->viewTheme = $this->Config->template;
     $this->viewImages = S2Paths::get($this->app, 'S2_THEMES_URL') . $this->viewTheme . _DS . 'theme_images' . _DS;
 }
开发者ID:atikahmed,项目名称:joomla-probid,代码行数:8,代码来源:module_fields_controller.php

示例8: beforeFilter

 function beforeFilter()
 {
     # Call beforeFilter of MyController parent class
     parent::beforeFilter();
     $this->Directory->Config =& $this->Config;
     # Change render controller/view
     $this->viewSuffix = Sanitize::getString($this->params['module'], 'tmpl_suffix');
 }
开发者ID:bizanto,项目名称:Hooked,代码行数:8,代码来源:module_directories_controller.php

示例9: beforeFilter

 function beforeFilter()
 {
     parent::beforeFilter();
     $this->viewSuffix = Sanitize::getString($this->params['module'], 'tmpl_suffix');
     # Set Theme
     $this->viewTheme = $this->Config->template;
     $this->viewImages = S2Paths::get('jreviews', 'S2_THEMES_URL') . $this->viewTheme . _DS . 'theme_images' . _DS;
     # Set Theme Vars
     $search_itemid = Sanitize::getInt($this->params['module'], 'search_itemid');
     if ($search_itemid) {
         $this->set('search_itemid', $search_itemid);
     }
 }
开发者ID:atikahmed,项目名称:joomla-probid,代码行数:13,代码来源:module_advanced_search_controller.php

示例10: beforeFilter

 function beforeFilter()
 {
     # Call beforeFilter of MyController parent class
     parent::beforeFilter();
     $this->Listing->controller = $this->name;
     $this->Listing->action = $this->action;
     # Make configuration available in models
     $this->Listing->Config =& $this->Config;
     /** HTGMOD **/
     $click2searchpage = isset($this->params['tag']);
     // change click2search view suffix for Flytying patterns
     if ($click2searchpage && JRequest::getVar('Itemid') == 352) {
         $this->viewSuffix = '_flies';
     }
     /** END HTGMOD **/
 }
开发者ID:bizanto,项目名称:Hooked,代码行数:16,代码来源:categories_controller.php

示例11: beforeFilter

 /**
  * AppController::beforeFilter()
  *
  * @return void
  */
 public function beforeFilter()
 {
     parent::beforeFilter();
     $this->Auth->authenticate = array('Authenticate.MultiColumn' => array('fields' => array('username' => 'login', 'password' => 'password'), 'columns' => array('username', 'email'), 'userModel' => 'User'));
     $this->Auth->authorize = array('Tools.Tiny' => array());
     $this->Auth->logoutRedirect = array('plugin' => false, 'admin' => false, 'controller' => 'overview', 'action' => 'index');
     $this->Auth->loginRedirect = array('plugin' => false, 'admin' => false, 'controller' => 'overview', 'action' => 'index');
     $this->Auth->loginAction = array('plugin' => false, 'admin' => false, 'controller' => 'account', 'action' => 'login');
     // Do not allow access to these public actions when already logged in
     $allowed = array('Account' => array('login', 'lost_password', 'register'));
     if (!Auth::id()) {
         return;
     }
     foreach ($allowed as $controller => $actions) {
         if ($this->name === $controller && in_array($this->request->action, $actions)) {
             $this->Common->flashMessage('The page you tried to access is not relevant if you are already logged in. Redirected to main page.', 'info');
             return $this->redirect($this->Auth->loginRedirect);
         }
     }
     $this->paginate['paramType'] = 'querystring';
 }
开发者ID:dereuromark,项目名称:cakefest,代码行数:26,代码来源:AppController.php

示例12: beforeFilter

 /**
  * AppController::beforeFilter()
  *
  * @return void
  */
 public function beforeFilter()
 {
     parent::beforeFilter();
     $this->Auth->authenticate = array('Authenticate.MultiColumn' => array('passwordHasher' => Configure::read('Passwordable.authType'), 'fields' => array('username' => 'login', 'password' => 'password'), 'columns' => array('username', 'email'), 'userModel' => 'User'));
     $this->Auth->authorize = array('Tools.Tiny' => array());
     $this->Auth->logoutRedirect = array('plugin' => false, 'admin' => false, 'controller' => 'overview', 'action' => 'index');
     $this->Auth->loginRedirect = array('plugin' => false, 'admin' => false, 'controller' => 'account', 'action' => 'index');
     $this->Auth->loginAction = array('plugin' => false, 'admin' => false, 'controller' => 'account', 'action' => 'login');
     if (in_array($this->viewPath, array('Pages'))) {
         $this->Auth->allow();
     }
     $allowed = array('Account' => array('login', 'lost_password', 'register'));
     if (!Auth::id()) {
         return;
     }
     foreach ($allowed as $controller => $actions) {
         if ($this->name === $controller && in_array($this->request->action, $actions)) {
             $this->Flash->message('The page you tried to access is not relevant if you are already logged in. Redirected to main page.', 'info');
             return $this->redirect($this->Auth->loginRedirect);
         }
     }
 }
开发者ID:dereuromark,项目名称:cakephp-sandbox,代码行数:27,代码来源:AppController.php

示例13: beforeFilter

 function beforeFilter()
 {
     # Call beforeFilter of MyController parent class
     parent::beforeFilter();
 }
开发者ID:bizanto,项目名称:Hooked,代码行数:5,代码来源:inquiry_controller.php

示例14: beforeFilter

 function beforeFilter()
 {
     parent::beforeFilter();
 }
开发者ID:atikahmed,项目名称:joomla-probid,代码行数:4,代码来源:admin_reports_controller.php

示例15: beforeFilter

 function beforeFilter()
 {
     # Call beforeFilter of MyController parent class
     parent::beforeFilter();
     $this->Directory->Config =& $this->Config;
 }
开发者ID:atikahmed,项目名称:joomla-probid,代码行数:6,代码来源:directories_controller.php


注:本文中的MyController::beforeFilter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。