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


PHP auth::acl_clear_prefetch方法代码示例

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


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

示例1: execute

 /**
  * Executes the command cache:purge.
  *
  * Purge the cache (including permissions) and increment the asset_version number
  *
  * @param InputInterface  $input  An InputInterface instance
  * @param OutputInterface $output An OutputInterface instance
  *
  * @return null
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $this->config->increment('assets_version', 1);
     $this->cache->purge();
     // Clear permissions
     $this->auth->acl_clear_prefetch();
     phpbb_cache_moderators($this->db, $this->cache, $this->auth);
     $this->log->add('admin', ANONYMOUS, '', 'LOG_PURGE_CACHE', time(), array());
     $output->writeln($this->user->lang('PURGE_CACHE_SUCCESS'));
 }
开发者ID:Tarendai,项目名称:spring-website,代码行数:20,代码来源:purge.php

示例2: add

 public function add(&$forum_data, $forum_perm_from = 0)
 {
     $forum_data += array('parent_id' => $this->config['sitemaker_parent_forum_id'], 'forum_type' => FORUM_POST, 'type_action' => '', 'forum_status' => ITEM_UNLOCKED, 'forum_parents' => '', 'forum_name' => '', 'forum_link' => '', 'forum_link_track' => false, 'forum_desc' => '', 'forum_desc_uid' => '', 'forum_desc_options' => 7, 'forum_desc_bitfield' => '', 'forum_rules' => '', 'forum_rules_uid' => '', 'forum_rules_options' => 7, 'forum_rules_bitfield' => '', 'forum_rules_link' => '', 'forum_image' => '', 'forum_style' => 0, 'display_subforum_list' => false, 'display_on_index' => false, 'forum_topics_per_page' => 0, 'enable_indexing' => true, 'enable_icons' => false, 'enable_prune' => false, 'enable_post_review' => true, 'enable_quick_reply' => false, 'prune_days' => 7, 'prune_viewed' => 7, 'prune_freq' => 1, 'prune_old_polls' => false, 'prune_announce' => false, 'prune_sticky' => false, 'show_active' => false, 'forum_password' => '', 'forum_password_confirm' => '', 'forum_password_unset' => false);
     $errors = $this->forum->update_forum_data($forum_data);
     if (!sizeof($errors)) {
         $forum_data['forum_id'] = (int) $forum_data['forum_id'];
         // Copy permissions?
         if ($forum_perm_from && $forum_perm_from != $forum_data['forum_id']) {
             copy_forum_permissions($forum_perm_from, $forum_data['forum_id'], false, false);
             phpbb_cache_moderators($this->db, $this->cache, $this->auth);
         }
         $this->auth->acl_clear_prefetch();
         $this->cache->destroy('sql', FORUMS_TABLE);
     }
     return $errors;
 }
开发者ID:BogusCurry,项目名称:phpBB-ext-sitemaker,代码行数:16,代码来源:manager.php

示例3: add

 public function add(array &$forum_data, $forum_perm_from = 0)
 {
     $forum_data += array('parent_id' => $this->config['sitemaker_parent_forum_id']);
     $errors = admin::save($forum_data);
     if (!sizeof($errors)) {
         $forum_data['forum_id'] = (int) $forum_data['forum_id'];
         // Copy permissions?
         if ($forum_perm_from && $forum_perm_from != $forum_data['forum_id']) {
             copy_forum_permissions($forum_perm_from, $forum_data['forum_id'], false, false);
             phpbb_cache_moderators($this->db, $this->cache, $this->auth);
         }
         $this->auth->acl_clear_prefetch();
         $this->cache->destroy('sql', FORUMS_TABLE);
     }
     return $errors;
 }
开发者ID:3D-I,项目名称:phpBB-ext-sitemaker,代码行数:16,代码来源:manager.php

示例4: permission_unset

    /**
     * Permission Unset
     *
     * Allows you to unset (remove) permissions for a certain group/role
     *
     * @param string $name The name of the role/group
     * @param string|array $auth_option The auth_option or array of
     * 	auth_options you would like to set
     * @param string $type The type (role|group)
     * @return null
     * @throws \phpbb\db\migration\exception
     */
    public function permission_unset($name, $auth_option, $type = 'role')
    {
        if (!is_array($auth_option)) {
            $auth_option = array($auth_option);
        }
        $to_remove = array();
        $sql = 'SELECT auth_option_id
			FROM ' . ACL_OPTIONS_TABLE . '
			WHERE ' . $this->db->sql_in_set('auth_option', $auth_option);
        $result = $this->db->sql_query($sql);
        while ($row = $this->db->sql_fetchrow($result)) {
            $to_remove[] = (int) $row['auth_option_id'];
        }
        $this->db->sql_freeresult($result);
        if (empty($to_remove)) {
            return;
        }
        $type = (string) $type;
        // Prevent PHP bug.
        switch ($type) {
            case 'role':
                $sql = 'SELECT role_id
					FROM ' . ACL_ROLES_TABLE . "\n\t\t\t\t\tWHERE role_name = '" . $this->db->sql_escape($name) . "'";
                $this->db->sql_query($sql);
                $role_id = (int) $this->db->sql_fetchfield('role_id');
                if (!$role_id) {
                    throw new \phpbb\db\migration\exception('ROLE_NOT_EXIST', $name);
                }
                $sql = 'DELETE FROM ' . ACL_ROLES_DATA_TABLE . '
					WHERE ' . $this->db->sql_in_set('auth_option_id', $to_remove) . '
						AND role_id = ' . (int) $role_id;
                $this->db->sql_query($sql);
                break;
            case 'group':
                $sql = 'SELECT group_id
					FROM ' . GROUPS_TABLE . "\n\t\t\t\t\tWHERE group_name = '" . $this->db->sql_escape($name) . "'";
                $this->db->sql_query($sql);
                $group_id = (int) $this->db->sql_fetchfield('group_id');
                if (!$group_id) {
                    throw new \phpbb\db\migration\exception('GROUP_NOT_EXIST', $name);
                }
                // If the group has a role set for them we will remove the requested permissions from that role.
                $sql = 'SELECT auth_role_id
					FROM ' . ACL_GROUPS_TABLE . '
					WHERE group_id = ' . $group_id . '
						AND auth_role_id <> 0';
                $this->db->sql_query($sql);
                $role_id = (int) $this->db->sql_fetchfield('auth_role_id');
                if ($role_id) {
                    $sql = 'SELECT role_name
						FROM ' . ACL_ROLES_TABLE . '
						WHERE role_id = ' . $role_id;
                    $this->db->sql_query($sql);
                    $role_name = $this->db->sql_fetchfield('role_name');
                    return $this->permission_unset($role_name, $auth_option, 'role');
                }
                $sql = 'DELETE FROM ' . ACL_GROUPS_TABLE . '
					WHERE ' . $this->db->sql_in_set('auth_option_id', $to_remove);
                $this->db->sql_query($sql);
                break;
        }
        $this->auth->acl_clear_prefetch();
    }
开发者ID:phpbb,项目名称:phpbb-core,代码行数:75,代码来源:permission.php


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