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-login-alert.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-login-alert.php
122 lines
1 <?php
2
3 class SiteGuard_Menu_Login_Alert extends SiteGuard_Base {
4 function __construct( ) {
5 $this->render_page( );
6 }
7 function render_page( ) {
8 global $config;
9
10 $opt_name_feature = 'loginalert_enable';
11 $opt_name_subject = 'loginalert_subject';
12 $opt_name_body = 'loginalert_body';
13 $opt_name_admin = 'loginalert_admin_only';
14
15 $opt_val_feature = $config->get( $opt_name_feature );
16 $opt_val_subject = $config->get( $opt_name_subject );
17 $opt_val_body = $config->get( $opt_name_body );
18 $opt_val_admin = $config->get( $opt_name_admin );
19 if ( isset( $_POST['update'] ) && check_admin_referer( 'siteguard-menu-login-alert-submit' ) ) {
20 $error = false;
21 $errors = check_multisite( );
22 if ( is_wp_error( $errors ) ) {
23 echo '<div class="error settings-error"><p><strong>';
24 esc_html_e( $errors->get_error_message( ), 'siteguard' );
25 echo '</strong></p></div>';
26 $error = true;
27 }
28 if ( false == $error && false == $this->is_switch_value( $_POST[ $opt_name_feature ] ) ) {
29 echo '<div class="error settings-error"><p><strong>';
30 esc_html_e( 'ERROR: Invalid input value.', 'siteguard' );
31 echo '</strong></p></div>';
32 $error = true;
33 }
34 if ( false == $error ) {
35 $opt_val_feature = $_POST[ $opt_name_feature ];
36 $opt_val_subject = $_POST[ $opt_name_subject ];
37 $opt_val_body = $_POST[ $opt_name_body ];
38 if ( isset( $_POST[ $opt_name_admin ] ) ) {
39 $opt_val_admin = $_POST[ $opt_name_admin ];
40 } else {
41 $opt_val_admin = '0';
42 }
43 $config->set( $opt_name_feature, $opt_val_feature );
44 $config->set( $opt_name_subject, $opt_val_subject );
45 $config->set( $opt_name_body, $opt_val_body );
46 $config->set( $opt_name_admin, $opt_val_admin );
47 $config->update( );
48 ?>
49 <div class="updated"><p><strong><?php esc_html_e( 'Options saved.', 'siteguard' ); ?></strong></p></div>
50 <?php
51 }
52 }
53
54 echo '<div class="wrap">';
55 echo '<img src="' . SITEGUARD_URL_PATH . 'images/sg_wp_plugin_logo_40.png" alt="SiteGuard Logo" />';
56 echo '<h2>' . esc_html__( 'Login Alert', 'siteguard' ) . '</h2>';
57 echo '<div class="siteguard-description">'
58 . esc_html__( 'You can find docs about this function on ', 'siteguard' )
59 . '<a href="' . esc_html__( 'http://www.jp-secure.com/cont/products/siteguard_wp_plugin/login_alert_en.html', 'siteguard' )
60 . '" target="_blank">'
61 . esc_html__( 'here', 'siteguard' )
62 . '</a>'
63 . esc_html__( '.', 'siteguard' )
64 . '</div>';
65 ?>
66 <form name="form1" method="post" action="">
67 <table class="form-table">
68 <tr>
69 <th scope="row" colspan="2">
70 <ul class="siteguard-radios">
71 <li>
72 <input type="radio" name="<?php echo $opt_name_feature ?>" id="<?php echo $opt_name_feature.'_on' ?>" value="1" <?php echo ( '1' == $opt_val_feature ? 'checked' : '') ?> >
73 <label for="<?php echo $opt_name_feature.'_on' ?>"><?php echo esc_html_e( 'ON', 'siteguard' ) ?></label>
74 </li><li>
75 <input type="radio" name="<?php echo $opt_name_feature ?>" id="<?php echo $opt_name_feature.'_off' ?>" value="0" <?php echo ( '0' == $opt_val_feature ? 'checked' : '') ?> >
76 <label for="<?php echo $opt_name_feature.'_off' ?>"><?php echo esc_html_e( 'OFF', 'siteguard' ) ?></label>
77 </li>
78 </ul>
79 <?php
80 $error = check_multisite( );
81 if ( is_wp_error( $error ) ) {
82 echo '<p class="description">';
83 echo $error->get_error_message( );
84 echo '</p>';
85 }
86 ?>
87 </th>
88 </tr><tr>
89 <th scope="row"><label for="<?php echo $opt_name_subject ?>"><?php esc_html_e( 'Subject', 'siteguard' ); ?></label></th>
90 <td>
91 <input type="text" name="<?php echo $opt_name_subject ?>" id="<?php echo $opt_name_subject ?>" size="50" value="<?php echo esc_attr( $opt_val_subject ) ?>" >
92 </td>
93 </tr><tr>
94 <th scope="row"><label for="<?php echo $opt_name_body ?>"><?php esc_html_e( 'Body', 'siteguard' ); ?></label></th>
95 <td>
96 <textarea name="<?php echo $opt_name_body ?>" id="<?php echo $opt_name_body ?>" cols="50" rows="5" ><?php echo esc_textarea( $opt_val_body ) ?></textarea>
97 </td>
98 </tr><tr>
99 <th scope="row"><?php esc_html_e( 'Recipients', 'siteguard' ) ?></th>
100 <td>
101 <input type="checkbox" name="<?php echo $opt_name_admin ?>" id="<?php echo $opt_name_admin ?>" value="1" <?php echo ( '1' == $opt_val_admin ? 'checked' : '' ) ?> >
102 <label for="<?php echo $opt_name_admin ?>"><?php esc_html_e( 'Admin only', 'siteguard' ) ?></label>
103 </td>
104 </tr>
105 </table>
106 <input type="hidden" name="update" value="Y">
107 <div class="siteguard-description">
108 <?php esc_html_e( 'It is the function to make it easier to notice unauthorized login. E-mail will be sent to a login user when logged in. If you receive an e-mail to there is no logged-in idea, please suspect unauthorized login. The subject and the mail body, the following variables can be used. (Site Name:%SITENAME%, User Name:%USERNAME%, DATE:%DATE%, Time:%TIME%, IP Address:%IPADDRESS%, User-Agent:%USERAGENT%, Referer:%REFERER%) Access by the XML-RPC will not be notified.', 'siteguard' ) ?>
109 </div>
110 <hr />
111 <?php
112 wp_nonce_field( 'siteguard-menu-login-alert-submit' );
113 submit_button( );
114 ?>
115 </form>
116 </div>
117 <?php
118 }
119 }
120
121 ?>
122