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


PHP ITSEC_Lib::get_whitelisted_ips方法代码示例

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


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

示例1: show_settings_page

    private function show_settings_page()
    {
        $form = new ITSEC_Form();
        $module_filters = array('all' => array(_x('All', 'List all modules', 'better-wp-security'), 0), 'recommended' => array(_x('Recommended', 'List recommended modules', 'better-wp-security'), 0), 'advanced' => array(_x('Advanced', 'List advanced modules', 'better-wp-security'), 0));
        $current_type = isset($_REQUEST['module_type']) ? $_REQUEST['module_type'] : 'recommended';
        $visible_modules = array();
        foreach ($this->modules as $id => $module) {
            $module_filters['all'][1]++;
            if ('all' === $current_type) {
                $visible_modules[] = $id;
            }
            if (isset($module_filters[$module->type])) {
                $module_filters[$module->type][1]++;
                if ($module->type === $current_type) {
                    $visible_modules[] = $id;
                }
            }
            $module->enabled = ITSEC_Modules::is_active($id);
            $module->always_active = ITSEC_Modules::is_always_active($id);
        }
        $feature_tabs = array();
        foreach ($module_filters as $type => $data) {
            if ($current_type === $type) {
                $class = 'current';
            } else {
                $class = '';
            }
            $feature_tabs[] = "<li class='itsec-module-filter' id='itsec-module-filter-{$type}'><a href='" . esc_url(add_query_arg('module_type', $type, $this->self_url)) . "' class='{$class}'>{$data[0]} <span class='count'>({$data[1]})</span></a>";
        }
        $whitelisted_ips = ITSEC_Lib::get_whitelisted_ips();
        $blacklisted_ips = ITSEC_Lib::get_blacklisted_ips();
        // Get user's view preference
        $view = get_user_meta(get_current_user_id(), 'itsec-settings-view', true);
        // Default to grid view for users that have an invalid or unspecified view
        if (!in_array($view, array('grid', 'list'))) {
            $view = 'grid';
        }
        ?>
	<div class="wrap">
		<h1>
			<?php 
        _e('iThemes Security', 'better-wp-security');
        ?>
			<a href="<?php 
        echo esc_url(ITSEC_Core::get_logs_page_url());
        ?>
" class="page-title-action"><?php 
        _e('View Logs', 'better-wp-security');
        ?>
</a>
			<a href="<?php 
        echo esc_url(apply_filters('itsec_support_url', 'https://wordpress.org/support/plugin/better-wp-security'));
        ?>
" target="_blank" class="page-title-action"><?php 
        _e('Support', 'better-wp-security');
        ?>
</a>
		</h1>

		<div id="itsec-settings-messages-container">
			<?php 
        foreach (ITSEC_Response::get_errors() as $error) {
            ITSEC_Lib::show_error_message($error);
        }
        foreach (ITSEC_Response::get_messages() as $message) {
            ITSEC_Lib::show_status_message($message);
        }
        ?>
		</div>

		<div id="poststuff">
			<div id="post-body" class="metabox-holder columns-2 hide-if-no-js">
				<div id="postbox-container-2" class="postbox-container">
					<div class="itsec-module-section-heading">
						<div class="itsec-settings-view-toggle hide-if-no-js" data-nonce="<?php 
        echo esc_attr(wp_create_nonce('set-user-setting-itsec-settings-view'));
        ?>
">
							<a class="itsec-grid<?php 
        if ('grid' === $view) {
            echo ' itsec-selected';
        }
        ?>
"><span class="dashicons dashicons-grid-view"></span></a>
							<a class="itsec-list<?php 
        if ('list' === $view) {
            echo ' itsec-selected';
        }
        ?>
"><span class="dashicons dashicons-list-view"></span></a>
						</div>
						<ul class="subsubsub itsec-feature-tabs hide-if-no-js">
							<?php 
        echo implode($feature_tabs, " |</li>\n") . "</li>\n";
        ?>
						</ul>
					</div>
					<div class="itsec-module-cards-container <?php 
        echo $view;
        ?>
//.........这里部分代码省略.........
开发者ID:AcademicTechnologyCenter,项目名称:ATC-Quality-Tracking,代码行数:101,代码来源:page-settings.php


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