示例#1
0
 private static function add_network_brute_force_signup()
 {
     if (!in_array('network-brute-force', self::$available_modules)) {
         return;
     }
     $settings = ITSEC_Modules::get_settings('network-brute-force');
     if (!empty($settings['api_key']) && !empty($settings['api_secret'])) {
         self::enforce_activation('network-brute-force', __('Network Brute Force Protection', 'better-wp-security'));
         return;
     }
     require_once ITSEC_Core::get_core_dir() . '/lib/form.php';
     $form = new ITSEC_Form();
     $form->add_input_group('security-check');
     ob_start();
     self::open_container('incomplete', 'itsec-security-check-network-brute-force-container');
     echo '<p>' . __('With Network Brute Force Protection, your site is protected against attackers found by other sites running iThemes Security. If your site identifies a new attacker, it automatically notifies the network so that other sites are protected as well. To join this site to the network and enable the protection, click the button below.', 'better-wp-security') . '</p>';
     ob_start();
     $form->add_text('email', array('class' => 'regular-text', 'value' => get_option('admin_email')));
     $email_input = ob_get_clean();
     /* translators: 1: email text input */
     echo '<p><label for="itsec-security-check-email">' . sprintf(__('Email Address: %1$s', 'better-wp-security'), $email_input) . '</p>';
     ob_start();
     $form->add_select('updates_optin', array('true' => __('Yes', 'better-wp-security'), 'false' => __('No', 'better-wp-security')));
     $optin_input = ob_get_clean();
     /* translators: 1: opt-in input */
     echo '<p><label for="itsec-security-check-updates_optin">' . sprintf(__('Receive email updates about WordPress Security from iThemes: %1$s', 'better-wp-security'), $optin_input) . '</p>';
     ob_start();
     $form->add_button('enable_network_brute_force', array('class' => 'button-primary', 'value' => __('Activate Network Brute Force Protection', 'better-wp-security')));
     echo '<p>' . ob_get_clean() . '</p>';
     echo '<div id="itsec-security-check-network-brute-force-errors"></div>';
     echo '</div>';
     self::$calls_to_action[] = ob_get_clean();
 }
示例#2
0
    private function show_settings_page()
    {
        require_once ITSEC_Core::get_core_dir() . '/lib/class-itsec-wp-list-table.php';
        if (isset($_GET['filter'])) {
            $filter = $_GET['filter'];
        } else {
            $filter = 'all';
        }
        $form = new ITSEC_Form();
        $filters = array('all' => __('All Log Data', 'better-wp-security'));
        foreach ($this->logger_displays as $log_provider) {
            $filters[$log_provider['module']] = $log_provider['title'];
        }
        $form->set_option('filter', $filter);
        ?>
	<div class="wrap">
		<h1>
			<?php 
        _e('iThemes Security', 'better-wp-security');
        ?>
			<a href="<?php 
        echo esc_url(ITSEC_Core::get_settings_page_url());
        ?>
" class="page-title-action"><?php 
        _e('Manage Settings', 'better-wp-security');
        ?>
</a>
			<a href="<?php 
        echo esc_url(apply_filters('itsec_support_url', 'https://wordpress.org/support/plugin/better-wp-security'));
        ?>
" 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">
					<?php 
        if ('file' === ITSEC_Modules::get_setting('global', 'log_type')) {
            ?>
						<p><?php 
            _e('To view logs within the plugin you must enable database logging in the Global Settings. File logging is not available for access within the plugin itself.', 'better-wp-security');
            ?>
</p>
					<?php 
        } else {
            ?>
						<div class="itsec-module-cards-container list">
							<p><?php 
            _e('Below are various logs of information collected by iThemes Security Pro. This information can help you get a picture of what is happening with your site and the level of success you have achieved in your security efforts.', 'better-wp-security');
            ?>
</p>
							<p><?php 
            _e('Logging settings can be managed in the Global Settings.', 'better-wp-security');
            ?>
</p>


							<?php 
            $form->start_form('itsec-module-settings-form');
            ?>
								<?php 
            $form->add_nonce('itsec-settings-page');
            ?>
								<p><?php 
            $form->add_select('filter', $filters);
            ?>
</p>
							<?php 
            $form->end_form();
            ?>

							<?php 
            $this->show_filtered_logs($filter);
            ?>
						</div>
					<?php 
        }
        ?>
				</div>
				<div class="itsec-modal-background"></div>

				<div id="postbox-container-1" class="postbox-container">
					<?php 
        foreach ($this->widgets as $id => $widget) {
            ?>
						<?php 
            $form->start_form("itsec-sidebar-widget-form-{$id}");
            ?>
							<?php 
            $form->add_nonce('itsec-logs-page');
            ?>
							<?php 
            $form->add_hidden('widget-id', $id);
            ?>
							<div id="itsec-sidebar-widget-<?php 
            echo $id;
            ?>
" class="postbox itsec-sidebar-widget">
								<h3 class="hndle ui-sortable-handle"><span><?php 
            echo esc_html($widget->title);
            ?>
</span></h3>
								<div class="inside">
									<?php 
            $this->get_widget_settings($id, $form, true);
            ?>
								</div>
							</div>
						<?php 
            $form->end_form();
            ?>
					<?php 
        }
        ?>
				</div>
			</div>

			<div class="hide-if-js">
				<p class="itsec-warning-message"><?php 
        _e('iThemes Security requires Javascript in order for the settings to be modified. Please enable Javascript to configure the settings.', 'better-wp-security');
        ?>
</p>
			</div>
		</div>
	</div>
<?php 
    }