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


PHP AppController::checkSecurity方法代码示例

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


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

示例1: isAuthorized

 function isAuthorized()
 {
     $parent = parent::isAuthorized();
     if (!is_null($parent)) {
         return $parent;
     }
     // get global settings
     $settings = $this->CommonTasks->getGlobalSettings();
     // deny according to global setting
     if ($settings['locadmin_manage_users'] != "true") {
         return false;
     }
     if (in_array($this->action, array('admin_view', 'admin_edit', 'admin_delete'))) {
         $user = $this->User->read(null, $this->passedArgs['0']);
         $locId = $user['Location']['id'];
         if (!parent::checkSecurity($locId)) {
             $this->Tracker->back();
         }
         return true;
     }
     if (in_array($this->action, array('admin_index', 'admin_add'))) {
         // rest of security check in function
         return true;
     }
     return false;
 }
开发者ID:vovchik09,项目名称:proximus-admin,代码行数:26,代码来源:users_controller.php

示例2: isAuthorized

 function isAuthorized()
 {
     $parent = parent::isAuthorized();
     if (!is_null($parent)) {
         return $parent;
     }
     if ($this->action == 'admin_start') {
         return true;
     }
     if ($this->action == 'admin_view') {
         $locs = parent::getAdminLocationIds();
         array_push($locs, 1);
         $locId = $this->params['pass'][0];
         if (!parent::checkSecurity($locId, $locs)) {
             $this->Tracker->back();
         }
         return true;
     }
     return false;
 }
开发者ID:vovchik09,项目名称:proximus-admin,代码行数:20,代码来源:locations_controller.php

示例3: isAuthorized

 function isAuthorized()
 {
     $parent = parent::isAuthorized();
     if (!is_null($parent)) {
         return $parent;
     }
     $locs = parent::getAdminLocationIds();
     if (in_array($this->action, array('admin_delete', 'admin_view'))) {
         $log = $this->Log->read(null, $this->passedArgs['0']);
         $locId = $log['Location']['id'];
         if (!parent::checkSecurity($locId)) {
             $this->Tracker->back();
         }
         return true;
     }
     if (in_array($this->action, array('admin_searchlist'))) {
         if (isset($this->data)) {
             $proxy = $this->ProxySetting->read(null, $this->data['Log']['proxyId']);
             $locId = $proxy['Location']['id'];
             if (!parent::checkSecurity($locId)) {
                 $this->Tracker->back();
             }
         }
         return true;
     }
     if (in_array($this->action, array('admin_createRule'))) {
         // security check in action
         return true;
     }
     return false;
 }
开发者ID:vovchik09,项目名称:proximus-admin,代码行数:31,代码来源:logs_controller.php

示例4: isAuthorized

 function isAuthorized()
 {
     $parent = parent::isAuthorized();
     if (!is_null($parent)) {
         return $parent;
     }
     if (in_array($this->action, array('admin_view', 'admin_edit', 'admin_delete'))) {
         $rule = $this->Rule->read(null, $this->passedArgs['0']);
         $locId = $rule['Location']['id'];
         if (!parent::checkSecurity($locId)) {
             $this->Tracker->back();
         }
         return true;
     }
     if ($this->action == 'admin_search') {
         return true;
     }
     if ($this->action == 'admin_add') {
         // permission check within the function
         return true;
     }
     return false;
 }
开发者ID:vovchik09,项目名称:proximus-admin,代码行数:23,代码来源:rules_controller.php

示例5: isAuthorized

 function isAuthorized($id = null)
 {
     $parent = parent::isAuthorized();
     if (!is_null($parent)) {
         return $parent;
     }
     if (in_array($this->action, array('admin_view', 'admin_edit', 'admin_delete'))) {
         $group = $this->Group->read(null, $this->passedArgs['0']);
         $locId = $group['Location']['id'];
         if (!parent::checkSecurity($locId)) {
             $this->Tracker->back();
         }
         return true;
     }
     if (in_array($this->action, array('admin_add'))) {
         // security check in function
         return true;
     }
     return false;
 }
开发者ID:vovchik09,项目名称:proximus-admin,代码行数:20,代码来源:groups_controller.php


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