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


PHP auth::acl_getf_global方法代码示例

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


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

示例1: get_template_center

 /**
  * {@inheritdoc}
  */
 public function get_template_center($module_id)
 {
     if (!function_exists('display_forums')) {
         include $this->phpbb_root_path . 'includes/functions_display.' . $this->php_ext;
     }
     \display_forums('', $this->config['load_moderators'], false);
     $this->template->assign_vars(array('FORUM_IMG' => $this->user->img('forum_read', 'NO_NEW_POSTS'), 'FORUM_NEW_IMG' => $this->user->img('forum_unread', 'NEW_POSTS'), 'FORUM_LOCKED_IMG' => $this->user->img('forum_read_locked', 'NO_NEW_POSTS_LOCKED'), 'FORUM_NEW_LOCKED_IMG' => $this->user->img('forum_unread_locked', 'NO_NEW_POSTS_LOCKED'), 'U_MARK_FORUMS' => $this->user->data['is_registered'] || $this->config['load_anon_lastread'] ? append_sid("{$this->phpbb_root_path}index.{$this->php_ext}", 'hash=' . generate_link_hash('global') . '&mark=forums') : '', 'U_MCP' => $this->auth->acl_get('m_') || $this->auth->acl_getf_global('m_') ? append_sid("{$this->phpbb_root_path}mcp.{$this->php_ext}", 'i=main&mode=front', true, $this->user->session_id) : ''));
     return 'forumlist.html';
 }
开发者ID:alhitary,项目名称:Board3-Portal,代码行数:12,代码来源:forumlist.php

示例2: submit_cp_field

    /**
     * Submit profile field for validation
     */
    public function submit_cp_field($mode, $lang_id, &$cp_data, &$cp_error)
    {
        $sql_where = '';
        switch ($mode) {
            case 'register':
                // If the field is required we show it on the registration page
                $sql_where .= ' AND f.field_show_on_reg = 1';
                break;
            case 'profile':
                // Show hidden fields to moderators/admins
                if (!$this->auth->acl_gets('a_', 'm_') && !$this->auth->acl_getf_global('m_')) {
                    $sql_where .= ' AND f.field_show_profile = 1';
                }
                break;
            default:
                trigger_error('Wrong profile mode specified', E_USER_ERROR);
                break;
        }
        $sql = 'SELECT l.*, f.*
			FROM ' . $this->fields_language_table . ' l, ' . $this->fields_table . ' f
			WHERE l.lang_id = ' . (int) $lang_id . "\n\t\t\t\tAND f.field_active = 1\n\t\t\t\t{$sql_where}\n\t\t\t\tAND l.field_id = f.field_id\n\t\t\tORDER BY f.field_order";
        $result = $this->db->sql_query($sql);
        while ($row = $this->db->sql_fetchrow($result)) {
            $profile_field = $this->type_collection[$row['field_type']];
            $cp_data['pf_' . $row['field_ident']] = $profile_field->get_profile_field($row);
            $check_value = $cp_data['pf_' . $row['field_ident']];
            if (($cp_result = $profile_field->validate_profile_field($check_value, $row)) !== false) {
                // If the result is not false, it's an error message
                $cp_error[] = $cp_result;
            }
        }
        $this->db->sql_freeresult($result);
    }
开发者ID:Tarendai,项目名称:spring-website,代码行数:36,代码来源:manager.php

示例3: get_template_side

    /**
     * {@inheritdoc}
     */
    public function get_template_side($module_id)
    {
        if (!function_exists('get_user_rank')) {
            include $this->phpbb_root_path . 'includes/functions_display.' . $this->php_ext;
        }
        if ($this->user->data['is_registered']) {
            //
            // + new posts since last visit & you post number
            //
            $ex_fid_ary = array_unique(array_merge(array_keys($this->auth->acl_getf('!f_read', true)), array_keys($this->auth->acl_getf('!f_search', true))));
            if ($this->auth->acl_get('m_approve')) {
                $m_approve_fid_sql = '';
            } else {
                if ($this->auth->acl_getf_global('m_approve')) {
                    $m_approve_fid_ary = array_diff(array_keys($this->auth->acl_getf('!m_approve', true)), $ex_fid_ary);
                    $m_approve_fid_sql = ' AND (p.post_visibility = 1' . (sizeof($m_approve_fid_ary) ? ' OR ' . $this->db->sql_in_set('p.forum_id', $m_approve_fid_ary, true) : '') . ')';
                } else {
                    $m_approve_fid_sql = ' AND p.post_visibility = 1';
                }
            }
            $sql = 'SELECT COUNT(DISTINCT t.topic_id) as total
						FROM ' . TOPICS_TABLE . ' t
						WHERE t.topic_last_post_time > ' . (int) $this->user->data['user_lastvisit'] . '
							AND t.topic_moved_id = 0
							' . str_replace(array('p.', 'post_'), array('t.', 'topic_'), $m_approve_fid_sql) . '
							' . (sizeof($ex_fid_ary) ? 'AND ' . $this->db->sql_in_set('t.forum_id', $ex_fid_ary, true) : '');
            $result = $this->db->sql_query($sql, 600);
            $new_posts_count = (int) $this->db->sql_fetchfield('total');
            $this->db->sql_freeresult($result);
            // unread posts
            $sql_where = 'AND t.topic_moved_id = 0
							' . str_replace(array('p.', 'post_'), array('t.', 'topic_'), $m_approve_fid_sql) . '
							' . (sizeof($ex_fid_ary) ? 'AND ' . $this->db->sql_in_set('t.forum_id', $ex_fid_ary, true) : '');
            $unread_list = get_unread_topics($this->user->data['user_id'], $sql_where, 'ORDER BY t.topic_id DESC');
            $unread_posts_count = sizeof($unread_list);
            // Get user avatar and rank
            $user_id = $this->user->data['user_id'];
            $username = $this->user->data['username'];
            $colour = $this->user->data['user_colour'];
            $avatar_img = phpbb_get_avatar(\phpbb\avatar\manager::clean_row($this->user->data, 'user'), 'USER_AVATAR');
            $rank_title = $rank_img = $rank_img_src = '';
            \get_user_rank($this->user->data['user_rank'], $this->user->data['user_posts'], $rank_title, $rank_img, $rank_img_src);
            // Assign specific vars
            $this->template->assign_vars(array('L_NEW_POSTS' => $this->user->lang['SEARCH_NEW'] . ' (' . $new_posts_count . ')', 'L_SELF_POSTS' => $this->user->lang['SEARCH_SELF'] . ' (' . $this->user->data['user_posts'] . ')', 'L_UNREAD_POSTS' => $this->user->lang['SEARCH_UNREAD'] . ' (' . $unread_posts_count . ')', 'B3P_AVATAR_IMG' => $avatar_img, 'B3P_RANK_TITLE' => $rank_title, 'B3P_RANK_IMG' => $rank_img, 'RANK_IMG_SRC' => $rank_img_src, 'USERNAME_FULL' => get_username_string('full', $user_id, $username, $colour), 'U_VIEW_PROFILE' => get_username_string('profile', $user_id, $username, $colour), 'U_NEW_POSTS' => append_sid("{$this->phpbb_root_path}search.{$this->php_ext}", 'search_id=newposts'), 'U_SELF_POSTS' => append_sid("{$this->phpbb_root_path}search.{$this->php_ext}", 'search_id=egosearch'), 'U_UNREAD_POSTS' => append_sid("{$this->phpbb_root_path}search.{$this->php_ext}", 'search_id=unreadposts'), 'U_UM_BOOKMARKS' => $this->config['allow_bookmarks'] ? append_sid("{$this->phpbb_root_path}ucp.{$this->php_ext}", 'i=main&mode=bookmarks') : '', 'U_UM_MAIN_SUBSCRIBED' => append_sid("{$this->phpbb_root_path}ucp.{$this->php_ext}", 'i=main&mode=subscribed'), 'U_UM_MCP' => $this->auth->acl_get('m_') || $this->auth->acl_getf_global('m_') ? append_sid("{$this->phpbb_root_path}mcp.{$this->php_ext}", 'i=main&mode=front', true, $this->user->session_id) : '', 'S_DISPLAY_SUBSCRIPTIONS' => $this->config['allow_topic_notify'] || $this->config['allow_forum_notify'] ? true : false));
            return 'user_menu_side.html';
        } else {
            /*
             * Assign specific vars
             * Need to remove web root path as ucp.php will do the
             * redirect
             */
            $this->template->assign_vars(array('U_PORTAL_REDIRECT' => $this->path_helper->remove_web_root_path($this->controller_helper->route('board3_portal_controller')), 'S_DISPLAY_FULL_LOGIN' => true, 'S_AUTOLOGIN_ENABLED' => $this->config['allow_autologin'] ? true : false, 'S_LOGIN_ACTION' => append_sid("{$this->phpbb_root_path}ucp.{$this->php_ext}", 'mode=login'), 'S_SHOW_REGISTER' => $this->config['board3_user_menu_register_' . $module_id] ? true : false));
            return 'login_box_side.html';
        }
    }
开发者ID:sgtevmckay,项目名称:Board3-Portal,代码行数:58,代码来源:user_menu.php

示例4: assign_messages

 /**
  * Assigns all message rows to the template
  *
  * @param $rows array
  */
 protected function assign_messages($rows)
 {
     if (empty($rows)) {
         return;
     }
     // Reverse the array if messages appear at the bottom
     if (!$this->config['mchat_message_top']) {
         $rows = array_reverse($rows);
     }
     $foes = $this->functions_mchat->mchat_foes();
     $this->template->destroy_block_vars('mchatrow');
     $user_avatars = array();
     foreach ($rows as $i => $row) {
         if (!isset($user_avatars[$row['user_id']])) {
             $display_avatar = $this->display_avatars() && $row['user_avatar'];
             $user_avatars[$row['user_id']] = !$display_avatar ? '' : phpbb_get_user_avatar(array('avatar' => $row['user_avatar'], 'avatar_type' => $row['user_avatar_type'], 'avatar_width' => $row['user_avatar_width'] > $row['user_avatar_height'] ? 40 : 40 / $row['user_avatar_height'] * $row['user_avatar_width'], 'avatar_height' => $row['user_avatar_height'] > $row['user_avatar_width'] ? 40 : 40 / $row['user_avatar_width'] * $row['user_avatar_height']));
         }
     }
     foreach ($rows as $i => $row) {
         // Auth checks
         if ($row['forum_id'] != 0 && !$this->auth->acl_get('f_read', $row['forum_id'])) {
             continue;
         }
         $message_edit = $row['message'];
         decode_message($message_edit, $row['bbcode_uid']);
         $message_edit = str_replace('"', '"', $message_edit);
         $message_edit = mb_ereg_replace("'", '’', $message_edit);
         if (in_array($row['user_id'], $foes)) {
             $row['message'] = sprintf($this->user->lang('MCHAT_FOE'), get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], $this->user->lang('GUEST')));
         }
         $row['username'] = mb_ereg_replace("'", "’", $row['username']);
         $message = str_replace("'", '’', $row['message']);
         $username_full = get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], $this->user->lang('GUEST'));
         // Remove root path if we render messages for the index page
         if (strpos($this->user->data['session_page'], 'app.' . $this->php_ext) === false) {
             $username_full = str_replace('.' . $this->root_path, '', $username_full);
         }
         $this->template->assign_block_vars('mchatrow', array('S_ROW_COUNT' => $i, 'MCHAT_ALLOW_BAN' => $this->auth->acl_get('a_authusers'), 'MCHAT_ALLOW_EDIT' => $this->auth_message('u_mchat_edit', $row['user_id'], $row['message_time']), 'MCHAT_ALLOW_DEL' => $this->auth_message('u_mchat_delete', $row['user_id'], $row['message_time']), 'MCHAT_USER_AVATAR' => $user_avatars[$row['user_id']], 'U_VIEWPROFILE' => $row['user_id'] != ANONYMOUS ? generate_board_url() . append_sid("/{$this->root_path}memberlist.{$this->php_ext}", 'mode=viewprofile&u=' . $row['user_id']) : '', 'MCHAT_IS_POSTER' => $row['user_id'] != ANONYMOUS && $this->user->data['user_id'] == $row['user_id'], 'MCHAT_PM' => $row['user_id'] != ANONYMOUS && $this->user->data['user_id'] != $row['user_id'] && $this->config['allow_privmsg'] && $this->auth->acl_get('u_sendpm') && ($row['user_allow_pm'] || $this->auth->acl_gets('a_', 'm_') || $this->auth->acl_getf_global('m_')) ? generate_board_url() . append_sid("/{$this->root_path}ucp.{$this->php_ext}", 'i=pm&mode=compose&u=' . $row['user_id']) : '', 'MCHAT_MESSAGE_EDIT' => $message_edit, 'MCHAT_MESSAGE_ID' => $row['message_id'], 'MCHAT_USERNAME_FULL' => $username_full, 'MCHAT_USERNAME' => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour'], $this->user->lang('GUEST')), 'MCHAT_USERNAME_COLOR' => get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour'], $this->user->lang('GUEST')), 'MCHAT_USER_IP' => $row['user_ip'], 'MCHAT_U_IP' => $this->helper->route('dmzx_mchat_page_controller', array('page' => 'whois', 'ip' => $row['user_ip'])), 'MCHAT_U_BAN' => generate_board_url() . append_sid("/{$this->root_path}adm/index.{$this->php_ext}", 'i=permissions&mode=setting_user_global&user_id[0]=' . $row['user_id'], true, $this->user->session_id), 'MCHAT_MESSAGE' => censor_text(generate_text_for_display($row['message'], $row['bbcode_uid'], $row['bbcode_bitfield'], $row['bbcode_options'])), 'MCHAT_TIME' => $this->user->format_date($row['message_time'], $this->config['mchat_date']), 'MCHAT_MESSAGE_TIME' => $row['message_time'], 'MCHAT_EDIT_TIME' => $row['edit_time']));
     }
 }
开发者ID:EntropyRy,项目名称:mChat-Extension,代码行数:45,代码来源:mchat.php

示例5: render_data_for_page


//.........这里部分代码省略.........
                    }
                    // Reguest...
                    $mchat_archive_start = $this->request->variable('start', 0);
                    $sql_where = $this->user->data['user_mchat_topics'] ? '' : 'WHERE m.forum_id = 0';
                    // Message row
                    $sql = 'SELECT m.*, u.username, u.user_colour, u.user_avatar, u.user_avatar_type, u.user_avatar_width, u.user_avatar_height, u.user_allow_pm
						FROM ' . $this->mchat_table . ' m
							LEFT JOIN ' . USERS_TABLE . ' u ON m.user_id = u.user_id
						' . $sql_where . '
						ORDER BY m.message_id DESC';
                    $result = $this->db->sql_query_limit($sql, (int) $this->config_mchat['archive_limit'], $mchat_archive_start);
                    $rows = $this->db->sql_fetchrowset($result);
                    $this->db->sql_freeresult($result);
                    foreach ($rows as $row) {
                        // auth check
                        if ($row['forum_id'] != 0 && !$this->auth->acl_get('f_read', $row['forum_id'])) {
                            continue;
                        }
                        // edit, delete and permission auths
                        $mchat_ban = $this->auth->acl_get('a_authusers') && $this->user->data['user_id'] != $row['user_id'] ? true : false;
                        $mchat_edit = $this->auth->acl_get('u_mchat_edit') && ($this->auth->acl_get('m_') || $this->user->data['user_id'] == $row['user_id']) ? true : false;
                        $mchat_del = $this->auth->acl_get('u_mchat_delete') && ($this->auth->acl_get('m_') || $this->user->data['user_id'] == $row['user_id']) ? true : false;
                        $mchat_avatar = $row['user_avatar'] ? get_user_avatar($row['user_avatar'], $row['user_avatar_type'], $row['user_avatar_width'] > $row['user_avatar_height'] ? 40 : 40 / $row['user_avatar_height'] * $row['user_avatar_width'], $row['user_avatar_height'] > $row['user_avatar_width'] ? 40 : 40 / $row['user_avatar_width'] * $row['user_avatar_height']) : '';
                        $message_edit = $row['message'];
                        decode_message($message_edit, $row['bbcode_uid']);
                        $message_edit = str_replace('"', '"', $message_edit);
                        // Edit Fix ;)
                        if (sizeof($foes_array)) {
                            if (in_array($row['user_id'], $foes_array)) {
                                $row['message'] = sprintf($this->user->lang['MCHAT_FOE'], get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], $this->user->lang['GUEST']));
                            }
                        }
                        $row['username'] = mb_ereg_replace("'", "’", $row['username']);
                        $this->template->assign_block_vars('mchatrow', array('MCHAT_ALLOW_BAN' => $mchat_ban, 'MCHAT_ALLOW_EDIT' => $mchat_edit, 'MCHAT_ALLOW_DEL' => $mchat_del, 'MCHAT_USER_AVATAR' => $mchat_avatar, 'U_VIEWPROFILE' => $row['user_id'] != ANONYMOUS ? append_sid("{$this->phpbb_root_path}memberlist.{$this->phpEx}", 'mode=viewprofile&u=' . $row['user_id']) : '', 'U_USER_IDS' => $row['user_id'] != ANONYMOUS && $this->user->data['user_id'] != $row['user_id'] ? append_sid("{$this->phpbb_root_path}ucp.{$this->phpEx}", 'i=pm&mode=compose&u=' . $row['user_id']) : '', 'BOT_USER_ID' => $row['user_id'] != '1', 'U_USER_ID' => $row['user_id'] != ANONYMOUS && $this->config['allow_privmsg'] && $this->auth->acl_get('u_sendpm') && $this->user->data['user_id'] != $row['user_id'] && $row['user_id'] != '1' && ($row['user_allow_pm'] || $this->auth->acl_gets('a_', 'm_') || $this->auth->acl_getf_global('m_')) ? append_sid("{$this->phpbb_root_path}ucp.{$this->phpEx}", 'i=pm&mode=compose&u=' . $row['user_id']) : '', 'MCHAT_MESSAGE_EDIT' => $message_edit, 'MCHAT_MESSAGE_ID' => $row['message_id'], 'MCHAT_USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], $this->user->lang['GUEST']), 'MCHAT_USERNAME' => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour'], $this->user->lang['GUEST']), 'MCHAT_USERNAME_COLOR' => get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour'], $this->user->lang['GUEST']), 'MCHAT_USER_IP' => $row['user_ip'], 'MCHAT_U_WHOIS' => $this->helper->route('dmzx_mchat_controller', array('mode' => 'whois', 'ip' => $row['user_ip'])), 'MCHAT_U_BAN' => append_sid("{$this->phpbb_root_path}adm/index.{$this->phpEx}", 'i=permissions&mode=setting_user_global&user_id[0]=' . $row['user_id'], true, $this->user->session_id), 'MCHAT_MESSAGE' => generate_text_for_display($row['message'], $row['bbcode_uid'], $row['bbcode_bitfield'], $row['bbcode_options']), 'MCHAT_TIME' => $this->user->format_date($row['message_time'], $this->config_mchat['date']), 'MCHAT_CLASS' => $row['message_id'] % 2 ? 1 : 2));
                    }
                    // Write no message
                    if (empty($rows)) {
                        $mchat_no_message = true;
                    }
                }
                // Run query again to get the total message rows...
                $sql = 'SELECT COUNT(message_id) AS mess_id FROM ' . $this->mchat_table;
                $result = $this->db->sql_query($sql);
                $mchat_total_message = $this->db->sql_fetchfield('mess_id');
                $this->db->sql_freeresult($result);
                // Page list function...
                $pagination_url = $this->helper->route('dmzx_mchat_controller', array('mode' => 'archive'));
                $start = $this->request->variable('start', 0);
                $this->pagination->generate_template_pagination($pagination_url, 'pagination', 'start', $mchat_total_message, (int) $this->config_mchat['archive_limit'], $mchat_archive_start);
                $this->template->assign_vars(array('MCHAT_TOTAL_MESSAGES' => sprintf($this->user->lang['MCHAT_TOTALMESSAGES'], $mchat_total_message)));
                //add to navlinks
                $this->template->assign_block_vars('navlinks', array('FORUM_NAME' => $this->user->lang['MCHAT_ARCHIVE_PAGE'], 'U_VIEW_FORUM' => $this->helper->route('dmzx_mchat_controller', array('mode' => 'archive'))));
                // If archive mode request set true
                $mchat_archive_mode = true;
                $old_mode = 'archive';
                break;
                // Read function...
            // Read function...
            case 'read':
                // If mChat disabled or user can't view the chat
                if (!$this->config['mchat_enable'] || !$mchat_view) {
                    // Forbidden (for jQ AJAX request)
                    throw new \phpbb\exception\http_exception(403, 'MCHAT_ERROR_FORBIDDEN');
                }
                // if we're reading on the custom page, then we are chatting
                if ($mchat_custom_page) {
开发者ID:ezpz-cz,项目名称:web-plugins,代码行数:67,代码来源:render_helper.php

示例6: board_disabled

 /**
  * Check whether the board has been disabled and should not be shown
  *
  * @return bool True if board has been disabled, false if not
  */
 protected function board_disabled()
 {
     return $this->config['board_disable'] && !defined('SKIP_CHECK_DISABLED') && !$this->auth->acl_gets('a_', 'm_') && !$this->auth->acl_getf_global('m_');
 }
开发者ID:sgtevmckay,项目名称:Board3-Portal,代码行数:9,代码来源:listener.php


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