本文整理汇总了PHP中ITSEC_Modules::get_available_modules方法的典型用法代码示例。如果您正苦于以下问题:PHP ITSEC_Modules::get_available_modules方法的具体用法?PHP ITSEC_Modules::get_available_modules怎么用?PHP ITSEC_Modules::get_available_modules使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITSEC_Modules
的用法示例。
在下文中一共展示了ITSEC_Modules::get_available_modules方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render_settings
protected function render_settings($form)
{
$available_modules = ITSEC_Modules::get_available_modules();
$modules_to_activate = array('ban-users' => __('Banned Users', 'better-wp-security'), 'backup' => __('Database Backups', 'better-wp-security'), 'brute-force' => __('Local Brute Force Protection', 'better-wp-security'), 'malware-scheduling' => __('Malware Scan Scheduling', 'better-wp-security'), 'network-brute-force' => __('Network Brute Force Protection', 'better-wp-security'), 'strong-passwords' => __('Strong Passwords', 'better-wp-security'), 'two-factor' => __('Two-Factor Authentication', 'better-wp-security'), 'user-logging' => __('User Logging', 'better-wp-security'), 'wordpress-tweaks' => __('WordPress Tweaks', 'better-wp-security'));
foreach ($modules_to_activate as $module => $val) {
if (!in_array($module, $available_modules)) {
unset($modules_to_activate[$module]);
}
}
?>
<div id="itsec-security-check-details-container">
<p><?php
_e('Some features and settings are recommended for every site to run. This tool will ensure that your site is using these recommendations.', 'better-wp-security');
?>
</p>
<p><?php
_e('When the button below is clicked the following modules will be enabled and configured:', 'better-wp-security');
?>
</p>
<ul class="itsec-security-check-list">
<?php
foreach ($modules_to_activate as $name) {
?>
<li><p><?php
echo $name;
?>
</p></li>
<?php
}
?>
</ul>
</div>
<p><?php
$form->add_button('secure_site', array('value' => 'Secure Site', 'class' => 'button-primary'));
?>
</p>
<?php
}
示例2: run
public static function run()
{
self::$available_modules = ITSEC_Modules::get_available_modules();
self::enforce_activation('ban-users', __('Banned Users', 'better-wp-security'));
self::enforce_setting('ban-users', 'enable_ban_lists', true, __('Enabled the Enable Ban Lists setting in Banned Users.', 'better-wp-security'));
self::enforce_activation('backup', __('Database Backups', 'better-wp-security'));
self::enforce_activation('brute-force', __('Local Brute Force Protection', 'better-wp-security'));
self::enforce_activation('malware-scheduling', __('Malware Scan Scheduling', 'better-wp-security'));
self::enforce_setting('malware-scheduling', 'email_notifications', true, __('Enabled the Email Notifications setting in Malware Scan Scheduling.', 'better-wp-security'));
self::add_network_brute_force_signup();
self::enforce_activation('strong-passwords', __('Strong Password Enforcement', 'better-wp-security'));
self::enforce_activation('two-factor', __('Two-Factor Authentication', 'better-wp-security'));
self::enable_all_two_factor_providers();
self::enforce_activation('user-logging', __('User Logging', 'better-wp-security'));
self::enforce_activation('wordpress-tweaks', __('WordPress Tweaks', 'better-wp-security'));
self::enforce_setting('wordpress-tweaks', 'file_editor', true, __('Disabled the File Editor in WordPress Tweaks.', 'better-wp-security'));
self::enforce_setting('wordpress-tweaks', 'allow_xmlrpc_multiauth', false, __('Changed the Multiple Authentication Attempts per XML-RPC Request setting in WordPress Tweaks to "Block".', 'better-wp-security'));
self::enforce_setting('global', 'write_files', true, __('Enabled the Write to Files setting in Global Settings.', 'better-wp-security'));
ob_start();
echo implode("\n", self::$calls_to_action);
echo implode("\n", self::$actions_taken);
echo implode("\n", self::$confirmations);
ITSEC_Response::set_response(ob_get_clean());
}