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


PHP ACL::get_group_token_access方法代码示例

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


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

示例1: get_group

 /**
  * Handles GET requests for a group's page.
  */
 public function get_group()
 {
     $group = UserGroup::get_by_id($this->handler_vars['id']);
     if (null == $group) {
         Utils::redirect(URL::get('admin', 'page=groups'));
     } else {
         $tokens = ACL::all_tokens('id');
         $access_names = ACL::$access_names;
         $access_names[] = 'deny';
         // attach access bitmasks to the tokens
         foreach ($tokens as $token) {
             $token->access = ACL::get_group_token_access($group->id, $token->id);
         }
         // separate tokens into groups
         $grouped_tokens = array();
         foreach ($tokens as $token) {
             $grouped_tokens[$token->token_group][$token->token_type ? 'crud' : 'bool'][] = $token;
         }
         $group = UserGroup::get_by_id($this->handler_vars['id']);
         $potentials = array();
         $users = Users::get_all();
         $users[] = User::anonymous();
         $members = $group->members;
         $jsusers = array();
         foreach ($users as $user) {
             $jsuser = new StdClass();
             $jsuser->id = $user->id;
             $jsuser->username = $user->username;
             $jsuser->member = in_array($user->id, $members);
             $jsusers[$user->id] = $jsuser;
         }
         $this->theme->potentials = $potentials;
         $this->theme->users = $users;
         $this->theme->members = $members;
         $js = '$(function(){groupManage.init(' . json_encode($jsusers) . ');});';
         Stack::add('admin_header_javascript', $js, 'groupmanage', 'admin');
         $this->theme->access_names = $access_names;
         $this->theme->grouped_tokens = $grouped_tokens;
         $this->theme->groups = UserGroups::get_all();
         $this->theme->group = $group;
         $this->theme->id = $group->id;
         $this->theme->wsse = Utils::WSSE();
         $this->display('group');
     }
 }
开发者ID:ringmaster,项目名称:system,代码行数:48,代码来源:admingroupshandler.php

示例2: get_group

 /**
  * Handles GET requests for a group's page.
  */
 public function get_group()
 {
     $group = UserGroup::get_by_id(Controller::get_var('id'));
     if (null == $group) {
         Utils::redirect(URL::get('display_groups', 'page=groups'));
     } else {
         $tokens = ACL::all_tokens('id');
         $tokens = Plugins::filter('token_list_display', $tokens);
         array_walk($tokens, function (&$value, $key) {
             $value->description = Plugins::filter('token_description_display', $value->name);
             $value->token_group = Plugins::filter('token_group_display', $value->token_group);
         });
         $access_names = ACL::access_names();
         $access_names[] = 'deny';
         $access_display = array();
         foreach ($access_names as $name) {
             $access_display[$name] = Plugins::filter('permission_display', $name);
         }
         $bool_access_display['allow'] = Plugins::filter('permission_display', 'allow');
         $bool_access_display['deny'] = Plugins::filter('permission_display', 'deny');
         // attach access bitmasks to the tokens
         foreach ($tokens as $token) {
             $token->access = ACL::get_group_token_access($group->id, $token->id);
         }
         // separate tokens into groups
         $grouped_tokens = array();
         foreach ($tokens as $token) {
             $grouped_tokens[$token->token_group][$token->token_type ? 'crud' : 'bool'][] = $token;
         }
         $potentials = array();
         $users = Users::get_all();
         $users[] = User::anonymous();
         $members = $group->members;
         $jsusers = array();
         foreach ($users as $user) {
             $jsuser = new \StdClass();
             $jsuser->id = $user->id;
             $jsuser->username = $user->username;
             $jsuser->member = in_array($user->id, $members);
             $jsusers[$user->id] = $jsuser;
         }
         $this->theme->potentials = $potentials;
         $this->theme->users = $users;
         $this->theme->members = $members;
         $js = '$(function(){groupManage.init(' . json_encode($jsusers) . ');});';
         Stack::add('admin_header_javascript', $js, 'groupmanage', 'admin-js');
         $this->theme->access_names = $access_names;
         $this->theme->grouped_tokens = $grouped_tokens;
         $this->theme->access_display = $access_display;
         $this->theme->bool_access_display = $bool_access_display;
         $this->theme->groups = UserGroups::get_all();
         $this->theme->group = $group;
         $this->theme->id = $group->id;
         $this->theme->wsse = Utils::WSSE();
         $this->display('group');
     }
 }
开发者ID:habari,项目名称:system,代码行数:60,代码来源:admingroupshandler.php


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