Version Description
- Fix bug that can not save "Login Alert" settings
- Add the "Login Alert" notification variables, IP Address, User-Agent and Referer
Download this release
Release Info
Developer | jp-secure |
Plugin | SiteGuard WP Plugin |
Version | 1.1.1 |
Comparing to | |
See all releases |
Code changes from version 1.1.0 to 1.1.1
- admin/siteguard-menu-login-alert.php +5 -15
- classes/siteguard-admin-filter.php +1 -1
- classes/siteguard-login-alert.php +12 -2
- languages/siteguard-ja.mo +0 -0
- languages/siteguard-ja.po +4 -4
- readme.txt +5 -2
- siteguard.php +3 -3
admin/siteguard-menu-login-alert.php
CHANGED
@@ -4,23 +4,13 @@ class SiteGuard_Menu_Login_Alert extends SiteGuard_Base {
|
|
4 |
function __construct( ) {
|
5 |
$this->render_page( );
|
6 |
}
|
7 |
-
function check_recipient( $recipient ) {
|
8 |
-
switch ( $recipient ) {
|
9 |
-
case '1':
|
10 |
-
case '2':
|
11 |
-
case '3':
|
12 |
-
return true;
|
13 |
-
default:
|
14 |
-
return false;
|
15 |
-
}
|
16 |
-
}
|
17 |
function render_page( ) {
|
18 |
global $config;
|
19 |
|
20 |
-
$opt_name_feature
|
21 |
-
$opt_name_subject
|
22 |
-
$opt_name_body
|
23 |
-
$opt_name_admin
|
24 |
|
25 |
$opt_val_feature = $config->get( $opt_name_feature );
|
26 |
$opt_val_subject = $config->get( $opt_name_subject );
|
@@ -93,7 +83,7 @@ class SiteGuard_Menu_Login_Alert extends SiteGuard_Base {
|
|
93 |
</table>
|
94 |
<input type="hidden" name="update" value="Y">
|
95 |
<div class="siteguard-description">
|
96 |
-
<?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%)', 'siteguard' ) ?>
|
97 |
</div>
|
98 |
<hr />
|
99 |
<?php
|
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 );
|
83 |
</table>
|
84 |
<input type="hidden" name="update" value="Y">
|
85 |
<div class="siteguard-description">
|
86 |
+
<?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%)', 'siteguard' ) ?>
|
87 |
</div>
|
88 |
<hr />
|
89 |
<?php
|
classes/siteguard-admin-filter.php
CHANGED
@@ -104,7 +104,7 @@ class SiteGuard_AdminFilter extends SiteGuard_Base {
|
|
104 |
global $htaccess, $config;
|
105 |
$mark = $this->get_mark( );
|
106 |
$data = $this->update_settings( $ip_addres );
|
107 |
-
$htaccess->update_settings( $mark, $data );
|
108 |
}
|
109 |
static function feature_off( ) {
|
110 |
$mark = SiteGuard_AdminFilter::get_mark( );
|
104 |
global $htaccess, $config;
|
105 |
$mark = $this->get_mark( );
|
106 |
$data = $this->update_settings( $ip_addres );
|
107 |
+
return $htaccess->update_settings( $mark, $data );
|
108 |
}
|
109 |
static function feature_off( ) {
|
110 |
$mark = SiteGuard_AdminFilter::get_mark( );
|
classes/siteguard-login-alert.php
CHANGED
@@ -12,11 +12,21 @@ class SiteGuard_LoginAlert extends SiteGuard_Base {
|
|
12 |
$config->set( 'loginalert_enable', '1' );
|
13 |
$config->set( 'loginalert_admin_only', '1' );
|
14 |
$config->set( 'loginalert_subject', __( 'New login at %SITENAME%', 'siteguard' ) );
|
15 |
-
$config->set( 'loginalert_body', __( "%USERNAME% logged in at %DATE% %TIME%\n\n--\nSiteGuard WP Plugin", 'siteguard' ) );
|
16 |
$config->update( );
|
17 |
}
|
18 |
function replace_valuable( $string, $username ) {
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
}
|
21 |
function handler_wp_login( $username, $user ) {
|
22 |
global $config;
|
12 |
$config->set( 'loginalert_enable', '1' );
|
13 |
$config->set( 'loginalert_admin_only', '1' );
|
14 |
$config->set( 'loginalert_subject', __( 'New login at %SITENAME%', 'siteguard' ) );
|
15 |
+
$config->set( 'loginalert_body', __( "%USERNAME% logged in at %DATE% %TIME%\n\n== Login information ==\nIP Address: %IPADDRESS%\nReferer: %REFERER%\nUser-Agent: %USERAGENT%\n\n--\nSiteGuard WP Plugin", 'siteguard' ) );
|
16 |
$config->update( );
|
17 |
}
|
18 |
function replace_valuable( $string, $username ) {
|
19 |
+
$search = array( '%SITENAME%', '%USERNAME%', '%DATE%', '%TIME%', '%IPADDRESS%', '%USERAGENT%', '%REFERER%' );
|
20 |
+
$replace = array(
|
21 |
+
get_option('blogname'),
|
22 |
+
$username,
|
23 |
+
date( 'Y-m-d', current_time('timestamp') ),
|
24 |
+
date( 'H:i:s', current_time('timestamp') ),
|
25 |
+
isset( $_SERVER['REMOTE_ADDR'] ) ? $_SERVER['REMOTE_ADDR'] : '-',
|
26 |
+
isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : '-',
|
27 |
+
isset( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : '-'
|
28 |
+
);
|
29 |
+
return str_replace( $search, $replace, $string);
|
30 |
}
|
31 |
function handler_wp_login( $username, $user ) {
|
32 |
global $config;
|
languages/siteguard-ja.mo
CHANGED
Binary file
|
languages/siteguard-ja.po
CHANGED
@@ -335,16 +335,16 @@ msgid "Recipients"
|
|
335 |
msgstr "受信者"
|
336 |
|
337 |
msgid ""
|
338 |
-
"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%)"
|
339 |
|
340 |
msgstr ""
|
341 |
-
"不正なログインに気づきやすくするための機能です。ログインすると、ログインユーザーにメールが送信されます。ログインした心当たりがないのにメールを受信した場合は、不正なログインを疑ってください。サブジェクトとメール本文には、次の変数が使用できます。(サイト名:%SITENAME%、ユーザ名:%USERNAME%、日付:%DATE%、時刻:%TIME%)"
|
342 |
|
343 |
msgid "New login at %SITENAME%"
|
344 |
msgstr "%SITENAME%にログインがありました"
|
345 |
|
346 |
-
msgid "%USERNAME% logged in at %DATE% %TIME%\n\n--\nSiteGuard WP Plugin"
|
347 |
-
msgstr "%DATE% %TIME%に%USERNAME%がログインしました。\n\n--\nSiteGuard WP Plugin"
|
348 |
|
349 |
#: admin/siteguard-menu-rename-login.php:51
|
350 |
msgid "New Login Path"
|
335 |
msgstr "受信者"
|
336 |
|
337 |
msgid ""
|
338 |
+
"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%)"
|
339 |
|
340 |
msgstr ""
|
341 |
+
"不正なログインに気づきやすくするための機能です。ログインすると、ログインユーザーにメールが送信されます。ログインした心当たりがないのにメールを受信した場合は、不正なログインを疑ってください。サブジェクトとメール本文には、次の変数が使用できます。(サイト名:%SITENAME%、ユーザ名:%USERNAME%、日付:%DATE%、時刻:%TIME%、IPアドレス:%IPADDRESS%、ユーザーエージェント:%USERAGENT%、リファラー:%REFERER%)"
|
342 |
|
343 |
msgid "New login at %SITENAME%"
|
344 |
msgstr "%SITENAME%にログインがありました"
|
345 |
|
346 |
+
msgid "%USERNAME% logged in at %DATE% %TIME%\n\n== Login information ==\nIP Address: %IPADDRESS%\nReferer: %REFERER%\nUser-Agent: %USERAGENT%\n\n--\nSiteGuard WP Plugin"
|
347 |
+
msgstr "%DATE% %TIME%に%USERNAME%がログインしました。\n\n== ログイン情報 ==\nIPアドレス:%IPADDRESS%\nリファラー:%REFERER%\nユーザーエージェント:%USERAGENT%\n\n--\nSiteGuard WP Plugin"
|
348 |
|
349 |
#: admin/siteguard-menu-rename-login.php:51
|
350 |
msgid "New Login Path"
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: -
|
|
4 |
Tags: security, waf, brute force, password list, login lock, login alert, captcha, pingback, fail once
|
5 |
Requires at least: 3.9
|
6 |
Tested up to: 4.0
|
7 |
-
Stable tag: 1.1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -73,7 +73,7 @@ By creating the WAF exclude rule, the WAF protection function can be activated w
|
|
73 |
|
74 |
= Translate =
|
75 |
|
76 |
-
If you have created your own language pack, or have an update of an existing one, you can send [gettext PO and MO files](http://codex.wordpress.org/Translating_WordPress) to
|
77 |
|
78 |
== Installation ==
|
79 |
|
@@ -95,6 +95,9 @@ If you have created your own language pack, or have an update of an existing one
|
|
95 |
http://www.jp-secure.com/cont/products/siteguard_wp_plugin/faq_en.html
|
96 |
|
97 |
== Changelog ==
|
|
|
|
|
|
|
98 |
= 1.1.0 =
|
99 |
* Add the "Login Alert" feature
|
100 |
* Add the function of inform the new Login page URL by e-mail
|
4 |
Tags: security, waf, brute force, password list, login lock, login alert, captcha, pingback, fail once
|
5 |
Requires at least: 3.9
|
6 |
Tested up to: 4.0
|
7 |
+
Stable tag: 1.1.1
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
73 |
|
74 |
= Translate =
|
75 |
|
76 |
+
If you have created your own language pack, or have an update of an existing one, you can send [gettext PO and MO files](http://codex.wordpress.org/Translating_WordPress) to sgdev@jp-secure.com so that We can bundle it into SiteGuard WP Plugin. You can download the latest [POT file](http://plugins.svn.wordpress.org/siteguard/trunk/languages/siteguard.pot), and [PO files in each language](http://plugins.svn.wordpress.org/siteguard/branches/languages/).
|
77 |
|
78 |
== Installation ==
|
79 |
|
95 |
http://www.jp-secure.com/cont/products/siteguard_wp_plugin/faq_en.html
|
96 |
|
97 |
== Changelog ==
|
98 |
+
= 1.1.1 =
|
99 |
+
* Fix bug that can not save "Login Alert" settings
|
100 |
+
* Add the "Login Alert" notification variables, IP Address, User-Agent and Referer
|
101 |
= 1.1.0 =
|
102 |
* Add the "Login Alert" feature
|
103 |
* Add the function of inform the new Login page URL by e-mail
|
siteguard.php
CHANGED
@@ -7,7 +7,7 @@ Author: JP-Secure
|
|
7 |
Author URI: http://www.jp-secure.com/eng/
|
8 |
Text Domain: siteguard
|
9 |
Domain Path: /languages/
|
10 |
-
Version: 1.1.
|
11 |
*/
|
12 |
|
13 |
/* Copyright 2014 JP-Secure Inc
|
@@ -30,7 +30,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
30 |
exit;
|
31 |
}
|
32 |
|
33 |
-
define( 'SITEGUARD_VERSION', '1.1.
|
34 |
|
35 |
define( 'SITEGUARD_PATH', plugin_dir_path( __FILE__ ) );
|
36 |
define( 'SITEGUARD_URL_PATH', plugin_dir_url( __FILE__ ) );
|
@@ -162,7 +162,7 @@ class SiteGuard extends SiteGuard_Base {
|
|
162 |
}
|
163 |
}
|
164 |
}
|
165 |
-
if ( version_compare( $old_version, '1.1.
|
166 |
$loginalert->init();
|
167 |
}
|
168 |
if ( $upgrade_ok && $old_version != SITEGUARD_VERSION ) {
|
7 |
Author URI: http://www.jp-secure.com/eng/
|
8 |
Text Domain: siteguard
|
9 |
Domain Path: /languages/
|
10 |
+
Version: 1.1.1
|
11 |
*/
|
12 |
|
13 |
/* Copyright 2014 JP-Secure Inc
|
30 |
exit;
|
31 |
}
|
32 |
|
33 |
+
define( 'SITEGUARD_VERSION', '1.1.1' );
|
34 |
|
35 |
define( 'SITEGUARD_PATH', plugin_dir_path( __FILE__ ) );
|
36 |
define( 'SITEGUARD_URL_PATH', plugin_dir_url( __FILE__ ) );
|
162 |
}
|
163 |
}
|
164 |
}
|
165 |
+
if ( version_compare( $old_version, '1.1.1' ) < 0 ) {
|
166 |
$loginalert->init();
|
167 |
}
|
168 |
if ( $upgrade_ok && $old_version != SITEGUARD_VERSION ) {
|