PluginProbe ʕ •ᴥ•ʔ
SiteGuard WP Plugin / 1.2.3
SiteGuard WP Plugin v1.2.3
1.8.9 1.8.8 1.8.7 1.8.6 1.8.6-beta1 1.8.6-beta2 1.8.4 1.8.5 1.8.3 1.8.2 1.8.1 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.1.0 1.1.1 1.1.2 1.2.0 1.2.1 1.2.2 1.2.3 1.4.3 1.5.0 1.5.1 1.5.2 1.6.0 1.6.1 1.7.0 1.7.1 1.7.10 1.7.11 1.7.12 1.7.2 1.7.3 1.7.4 1.7.5 1.7.6 1.7.7 1.7.8 1.7.9 1.8.0 1.8.0-beta1 1.8.0-beta2 1.8.0-beta3 1.8.0-beta4
siteguard / admin / siteguard-menu-fail-once.php
siteguard / admin Last commit date
siteguard-login-history-table.php 11 years ago siteguard-menu-admin-filter.php 11 years ago siteguard-menu-captcha.php 11 years ago siteguard-menu-dashboard.php 11 years ago siteguard-menu-disable-pingback.php 11 years ago siteguard-menu-fail-once.php 11 years ago siteguard-menu-init.php 11 years ago siteguard-menu-login-alert.php 11 years ago siteguard-menu-login-lock.php 11 years ago siteguard-menu-rename-login.php 11 years ago siteguard-menu-same-error.php 11 years ago siteguard-menu-updates-notify.php 11 years ago siteguard-menu-waf-tuning-support.php 11 years ago siteguard-waf-exclude-rule-table.php 11 years ago
siteguard-menu-fail-once.php
107 lines
1 <?php
2
3 class SiteGuard_Menu_Fail_Once extends SiteGuard_Base {
4 function __construct( ) {
5 $this->render_page( );
6 }
7 function render_page( ) {
8 global $config;
9
10 $opt_name_fail_once = 'loginlock_fail_once';
11 $opt_name_admin_only = 'fail_once_admin_only';
12
13 $opt_val_fail_once = $config->get( $opt_name_fail_once );
14 $opt_val_admin_only = $config->get( $opt_name_admin_only );
15 if ( isset( $_POST['update'] ) && check_admin_referer( 'siteguard-menu-fail-once-submit' ) ) {
16 $error = false;
17 $errors = check_multisite( );
18 if ( is_wp_error( $errors ) ) {
19 echo '<div class="error settings-error"><p><strong>';
20 esc_html_e( $errors->get_error_message( ), 'siteguard' );
21 echo '</strong></p></div>';
22 $error = true;
23 }
24 if ( false == $error && false == $this->is_switch_value( $_POST[ $opt_name_fail_once ] ) ) {
25 echo '<div class="error settings-error"><p><strong>';
26 esc_html_e( 'ERROR: Invalid input value.', 'siteguard' );
27 echo '</strong></p></div>';
28 $error = true;
29 }
30 if ( false == $error ) {
31 $opt_val_fail_once = $_POST[ $opt_name_fail_once ];
32 if ( isset( $_POST[ $opt_name_admin_only ] ) ) {
33 $opt_val_admin_only = $_POST[ $opt_name_admin_only ];
34 } else {
35 $opt_val_admin_only = '0';
36 }
37 $config->set( $opt_name_fail_once, $opt_val_fail_once );
38 $config->set( $opt_name_admin_only, $opt_val_admin_only );
39 $config->update( );
40 ?>
41 <div class="updated"><p><strong><?php esc_html_e( 'Options saved.', 'siteguard' ); ?></strong></p></div>
42 <?php
43 }
44 }
45
46 echo '<div class="wrap">';
47 echo '<img src="' . SITEGUARD_URL_PATH . 'images/sg_wp_plugin_logo_40.png" alt="SiteGuard Logo" />';
48 echo '<h2>' . esc_html__( 'Fail once', 'siteguard' ) . '</h2>';
49 echo '<div class="siteguard-description">'
50 . esc_html__( 'You can find docs about this function on ', 'siteguard' )
51 . '<a href="' . esc_html__( 'http://www.jp-secure.com/cont/products/siteguard_wp_plugin/fail_once_en.html', 'siteguard' )
52 . '" target="_blank">'
53 . esc_html__( 'here', 'siteguard' )
54 . '</a>'
55 . esc_html__( '.', 'siteguard' )
56 . '</div>';
57 ?>
58 <form name="form1" method="post" action="">
59 <table class="form-table">
60 <tr>
61 <th scope="row" colspan="2">
62 <ul class="siteguard-radios">
63 <li>
64 <input type="radio" name="<?php echo $opt_name_fail_once ?>" id="<?php echo $opt_name_fail_once.'_on' ?>" value="1" <?php echo ( '1' == $opt_val_fail_once ? 'checked' : '') ?> >
65 <label for="<?php echo $opt_name_fail_once.'_on' ?>"><?php esc_html_e( 'ON', 'siteguard' ) ?></label>
66 </li><li>
67 <input type="radio" name="<?php echo $opt_name_fail_once ?>" id="<?php echo $opt_name_fail_once.'_off' ?>" value="0" <?php echo ( '0' == $opt_val_fail_once ? 'checked' : '') ?> >
68 <label for="<?php echo $opt_name_fail_once.'_off' ?>"><?php esc_html_e( 'OFF', 'siteguard' ) ?></label>
69 </li>
70 </ul>
71 <?php
72 $error = check_multisite( );
73 if ( is_wp_error( $error ) ) {
74 echo '<p class="description">';
75 echo $error->get_error_message( );
76 echo '</p>';
77 }
78 ?>
79 </th>
80 <td>
81 </tr><tr>
82 <th scope="row"><?php esc_html_e( 'Target user', 'siteguard' ) ?></th>
83 <td>
84 <input type="checkbox" name="<?php echo $opt_name_admin_only ?>" id="<?php echo $opt_name_admin_only ?>" value="1" <?php echo ( '1' == $opt_val_admin_only ? 'checked' : '' ) ?> >
85 <label for="<?php echo $opt_name_admin_only ?>"><?php esc_html_e( 'Admin only', 'siteguard' ) ?></label>
86 </td>
87 </tr>
88 </table>
89 <input type="hidden" name="update" value="Y">
90 <div class="siteguard-description">
91 <?php esc_html_e( 'It is the function to decrease the vulnerability against a password list attack. Even is the login input is correct, the first login must fail. After 5 seconds and later within 60 seconds, another correct login input make login succeed. At the first login failure, the following error message is displayed.', 'siteguard' ); ?>
92 </div>
93 <hr />
94
95 <?php
96 wp_nonce_field( 'siteguard-menu-fail-once-submit' );
97 submit_button( );
98 ?>
99
100 </form>
101 </div>
102
103 <?php
104 }
105 }
106 ?>
107