PluginProbe ʕ •ᴥ•ʔ
CloudSecure WP Security / 1.4.13
CloudSecure WP Security v1.4.13
1.4.14 1.4.13 1.4.12 1.4.11 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 weeks ago common.php 2 years ago dashboard.php 1 month ago disable-access-system-file.php 9 months ago disable-author-query.php 2 years ago disable-login.php 2 years ago disable-restapi.php 2 weeks ago disable-xmlrpc.php 2 years ago login-log-table.php 4 months ago login-log.php 2 years ago login-notification.php 3 months ago rename-login-page.php 1 month ago restrict-admin-page.php 3 months ago server-error-notification.php 4 months ago server-error-table.php 1 year ago two-factor-authentication-registration.php 3 months ago two-factor-authentication.php 4 months ago unify-messages.php 2 years ago update-notice.php 1 month ago waf-table.php 1 year ago waf.php 1 month ago
login-log.php
104 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 <nav>
72 <ul class="breadcrumb">
73 <li class="breadcrumb__list"><a href="?page=cloudsecurewp">ダッシュボード</a></li>
74 <li class="breadcrumb__list">ログイン履歴</li>
75 </ul>
76 </nav>
77 <div class="title-block mb-12">
78 <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>
79 <h1 class="title-block-title">ログイン履歴</h1>
80 </div>
81 <div class="title-bottom-text">
82 管理画面にログインした履歴を表示します。
83 </div>
84 <?php
85 }
86
87 /**
88 * ページコンテンツ
89 */
90 protected function page(): void {
91 ?>
92
93 <form name="frm" method="POST">
94 <div id="login-log">
95
96 <?php $this->login_log_table->display(); ?>
97 </div>
98 </form>
99
100 <?php
101 }
102 }
103
104