PluginProbe ʕ •ᴥ•ʔ
CloudSecure WP Security / 1.2.4
CloudSecure WP Security v1.2.4
1.4.10 1.4.9 trunk 0.9.0 1.0.2 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.3.1 1.3.10 1.3.11 1.3.12 1.3.13 1.3.14 1.3.15 1.3.16 1.3.17 1.3.18 1.3.19 1.3.2 1.3.20 1.3.21 1.3.22 1.3.23 1.3.24 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8
cloudsecure-wp-security / modules / admin / login-log.php
cloudsecure-wp-security / modules / admin Last commit date
captcha.php 2 years ago common.php 2 years ago dashboard.php 2 years ago disable-author-query.php 2 years ago disable-login.php 2 years ago disable-restapi.php 2 years ago disable-xmlrpc.php 2 years ago login-log-table.php 2 years ago login-log.php 2 years ago login-notification.php 2 years ago rename-login-page.php 2 years ago restrict-admin-page.php 2 years ago server-error-notification.php 2 years ago server-error-table.php 2 years ago two-factor-authentication-registration.php 2 years ago two-factor-authentication.php 2 years ago unify-messages.php 2 years ago update-notice.php 2 years ago
login-log.php
98 lines
1 <?php
2
3 if ( ! defined( 'ABSPATH' ) ) {
4 exit;
5 }
6
7 class CloudSecureWP_Admin_Login_Log extends CloudSecureWP_Admin_Common {
8 private $login_log;
9 private $login_log_table;
10
11 function __construct( array $info, CloudSecureWP_Login_Log $login_log ) {
12 parent::__construct( $info );
13
14 $this->login_log = $login_log;
15 $this->login_log_table = new CloudSecureWP_Login_Log_Table( $login_log );
16
17 $this->prepare_view_data();
18 $this->render();
19 }
20
21 /**
22 * 画面表示用のデータを準備
23 */
24 public function prepare_view_data(): void {
25 $conditions = array();
26 $referer = wp_get_referer();
27
28 if ( empty( $referer ) ) {
29 if ( ! empty( $_POST ) && check_admin_referer( $this->login_log->get_feature_key() . '_csrf' ) ) {
30 if ( ! empty( $_POST['done'] ?? '' ) ) {
31
32 if ( isset( $_POST['condition_status'] ) && ! empty( $_POST['condition_status'] ) ) {
33 $conditions['condition_status'] = trim( sanitize_text_field( $_POST['condition_status'] ) );
34 }
35
36 if ( isset( $_POST['condition_ip'] ) && ! empty( $_POST['condition_ip'] ) ) {
37 $conditions['condition_ip'] = trim( sanitize_text_field( $_POST['condition_ip'] ) );
38 }
39
40 if ( isset( $_POST['condition_ip_other_than'] ) && ! empty( $_POST['condition_ip_other_than'] ) ) {
41 $conditions['condition_ip_other_than'] = trim( sanitize_text_field( $_POST['condition_ip_other_than'] ) );
42 }
43
44 if ( isset( $_POST['condition_method'] ) && ! empty( $_POST['condition_method'] ) ) {
45 $conditions['condition_method'] = trim( sanitize_text_field( $_POST['condition_method'] ) );
46 }
47
48 if ( isset( $_POST['condition_name'] ) && ! empty( $_POST['condition_name'] ) ) {
49 $conditions['condition_name'] = trim( sanitize_text_field( $_POST['condition_name'] ) );
50 }
51
52 if ( isset( $_POST['condition_name_other_than'] ) && ! empty( $_POST['condition_name_other_than'] ) ) {
53 $conditions['condition_name_other_than'] = trim( sanitize_text_field( $_POST['condition_name_other_than'] ) );
54 }
55 }
56 }
57 } elseif ( false !== strpos( $referer, 'page=cloudsecurewp_login_log' ) ) {
58 $conditions = $this->login_log_table->get_conditions();
59 }
60
61 $this->login_log_table->set_condition( $conditions );
62 $this->login_log_table->save_conditions();
63 $this->login_log_table->prepare_items();
64 }
65
66 /**
67 * デスクリプション
68 */
69 protected function admin_description(): void {
70 ?>
71 <div class="title-block mb-12">
72 <p class="title-block-small-text">この機能のマニュアルは<a class="title-block-link" target="_blank" href="https://wpplugin.cloudsecure.ne.jp/cloudsecure_wp_security/login_log.php">こちら</a></p>
73 <h1 class="title-block-title">ログイン履歴</h1>
74 </div>
75 <div class="title-bottom-text">
76 管理画面にログインした履歴を表示します。
77 </div>
78 <?php
79 }
80
81 /**
82 * ページコンテンツ
83 */
84 protected function page(): void {
85 ?>
86
87 <form name="frm" method="POST">
88 <div id="login-log">
89
90 <?php $this->login_log_table->display(); ?>
91 </div>
92 </form>
93
94 <?php
95 }
96 }
97
98