Version Notes
stable release
Download this release
Release Info
Developer | Magento Core Team |
Extension | ET_IpSecurity |
Version | 1.2.0 |
Comparing to | |
See all releases |
Version 1.2.0
- app/code/community/ET/ET_IpSecurity_ChangeLog.txt +34 -0
- app/code/community/ET/ET_IpSecurity_Description.txt +55 -0
- app/code/community/ET/ET_IpSecurity_LICENSE.txt +48 -0
- app/code/community/ET/IpSecurity/Helper/Data.php +24 -0
- app/code/community/ET/IpSecurity/Model/Observer.php +217 -0
- app/code/community/ET/IpSecurity/etc/config.xml +178 -0
- app/code/community/ET/IpSecurity/etc/system.xml +235 -0
- app/etc/modules/ET_IpSecurity.xml +30 -0
- app/locale/en_US/ET_IpSecurity.csv +24 -0
- app/locale/en_US/template/email/et_ipsecurity.html +7 -0
- app/locale/en_US/template/email/et_ipsecurity_admin.html +7 -0
- app/locale/ru_RU/ET_IpSecurity.csv +24 -0
- app/locale/ru_RU/template/email/et_ipsecurity.html +7 -0
- app/locale/ru_RU/template/email/et_ipsecurity_admin.html +7 -0
- package.xml +21 -0
app/code/community/ET/ET_IpSecurity_ChangeLog.txt
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
This file describes changes between versions of module ET_IpSecurity for Magento.
|
2 |
+
|
3 |
+
Legend:
|
4 |
+
* bug fix
|
5 |
+
+ added functionality
|
6 |
+
- removed functionality
|
7 |
+
|
8 |
+
TODO � �����:
|
9 |
+
+ add table to store log (or store it in a file)
|
10 |
+
+ add anti spam protection (to avoid a large number of e-mail|log entrys)
|
11 |
+
+ integrate anti spam serviss http://www.projecthoneypot.org/
|
12 |
+
|
13 |
+
=====================================
|
14 |
+
ver. 1.2.0
|
15 |
+
+ changed code pool from local to community
|
16 |
+
+ changed settings section
|
17 |
+
+ added maintenance page function
|
18 |
+
|
19 |
+
|
20 |
+
ver. 1.1.0
|
21 |
+
* added Helper (��� ���� �� �������� Transactional mails - ���������� ������ �������) - actual for Magento ver. 1.4.�
|
22 |
+
|
23 |
+
|
24 |
+
ver. 1.0.9
|
25 |
+
+ can add comments to IP's
|
26 |
+
+ notify by e-mail if block rule happens (e-mail templates editable)
|
27 |
+
+ http response status 403
|
28 |
+
* rule templates processing error
|
29 |
+
|
30 |
+
|
31 |
+
ver. 0.1.0
|
32 |
+
+ stable release
|
33 |
+
|
34 |
+
|
app/code/community/ET/ET_IpSecurity_Description.txt
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
==== Description / ��� ���� ���� ������? ====
|
2 |
+
|
3 |
+
EN:
|
4 |
+
Extension allows to restrict access to website for visitors by IP or IP mask.
|
5 |
+
When blocking rule is applied user is redirected to selected CMS page or blank page. Also extension can notify website owner about blocked visitor by email.
|
6 |
+
|
7 |
+
Second function: Allows to turn off frontend during maintenance operations.
|
8 |
+
|
9 |
+
RU:
|
10 |
+
������ ��������� ������������ ������ � ����� ����������� �� IP ��� �� IP ������.
|
11 |
+
��� ������������ ������� �������������� ���������� �� ��������� CMS �������� ��� ������ �� ������ ��������. ����� ����� ���������� ��������� ����� � ����������� ������� �� �-����.
|
12 |
+
|
13 |
+
�������� ������� ���������� ����� �� ����������� ������������.
|
14 |
+
|
15 |
+
|
16 |
+
====Features / ����������� ������====
|
17 |
+
|
18 |
+
EN:
|
19 |
+
* Open Source
|
20 |
+
* Separate white/black IP lists for frontend and admin panel
|
21 |
+
* Website owner notification by e-mail about rejected attempt to access frontend or admin panel
|
22 |
+
* 2 types of action when blocking rule is applied (Redirect to blank page or Redirect to selected CMS page)
|
23 |
+
* HTTP response code when blocking - HTTP Error 403 - Forbidden: Access is denied
|
24 |
+
* Editable templates for notification letters
|
25 |
+
* Available languages for admin panel (en_US, ru_RU)
|
26 |
+
* You can enter IP addresses or IP masks. You can add comment to each rule.
|
27 |
+
127.0.0.1|My address
|
28 |
+
10.*.*.*|internal company IPs
|
29 |
+
* Editable message (is shown ti visitors during maintenance operations.)
|
30 |
+
|
31 |
+
|
32 |
+
RU:
|
33 |
+
* Open Source
|
34 |
+
* ��������� �����/������ ������ IP ��� ���������������� ����� � ������ �����������������
|
35 |
+
* ���������� ��������� �������� �� �-���� � ����������� ������� ����������
|
36 |
+
* ��� ���� ������� ��� ������������ ������� (����� ������ �������� � ��������������� �� ��������� CMS ��������)
|
37 |
+
* ������ ������ �� ������������ �������� ��� ���������� - HTTP Error 403 - Forbidden: Access is denied
|
38 |
+
* ������������� ������� ����� ����������
|
39 |
+
* ��������� ����� ��� ������ ����������������� (en_US, ru_RU)
|
40 |
+
* ����� ��������� ��� IP ������, ��� � ����� �������. � ������� ������� ����� �������� �����������.
|
41 |
+
127.0.0.1|My address
|
42 |
+
10.*.*.*|internal company IPs
|
43 |
+
* ������������� ��������� (������������ ����������� �� ����� ����������� �����).
|
44 |
+
|
45 |
+
|
46 |
+
|
47 |
+
|
48 |
+
====Version Compatibility / ������������� ������====
|
49 |
+
1.3.� (tested in 1.3.2.4.)
|
50 |
+
1.4.x (tested in 1.4.1.1.)
|
51 |
+
1.5.x (tested in 1.5.0.1.)
|
52 |
+
|
53 |
+
====Module tags:====
|
54 |
+
ip security, disable access, maintenance, administration
|
55 |
+
|
app/code/community/ET/ET_IpSecurity_LICENSE.txt
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
http://opensource.org/licenses/afl-3.0.php
|
2 |
+
|
3 |
+
Academic Free License ("AFL") v. 3.0
|
4 |
+
This Academic Free License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work:
|
5 |
+
|
6 |
+
Licensed under the Academic Free License version 3.0
|
7 |
+
|
8 |
+
1) Grant of Copyright License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following:
|
9 |
+
|
10 |
+
a) to reproduce the Original Work in copies, either alone or as part of a collective work;
|
11 |
+
|
12 |
+
b) to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work;
|
13 |
+
|
14 |
+
c) to distribute or communicate copies of the Original Work and Derivative Works to the public, under any license of your choice that does not contradict the terms and conditions, including Licensor's reserved rights and remedies, in this Academic Free License;
|
15 |
+
|
16 |
+
d) to perform the Original Work publicly; and
|
17 |
+
|
18 |
+
e) to display the Original Work publicly.
|
19 |
+
|
20 |
+
2) Grant of Patent License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works.
|
21 |
+
|
22 |
+
3) Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work.
|
23 |
+
|
24 |
+
4) Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor's trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license.
|
25 |
+
|
26 |
+
5) External Deployment. The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c).
|
27 |
+
|
28 |
+
6) Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work.
|
29 |
+
|
30 |
+
7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer.
|
31 |
+
|
32 |
+
8) Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation.
|
33 |
+
|
34 |
+
9) Acceptance and Termination. If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including "fair use" or "fair dealing"). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c).
|
35 |
+
|
36 |
+
10) Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware.
|
37 |
+
|
38 |
+
11) Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License.
|
39 |
+
|
40 |
+
12) Attorneys' Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License.
|
41 |
+
|
42 |
+
13) Miscellaneous. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable.
|
43 |
+
|
44 |
+
14) Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
|
45 |
+
|
46 |
+
15) Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You.
|
47 |
+
|
48 |
+
16) Modification of This License. This License is Copyright © 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Academic Free License" or "AFL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under <insert your license name here>" or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process.
|
app/code/community/ET/IpSecurity/Helper/Data.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ET Web Solutions
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
*
|
9 |
+
* DISCLAIMER
|
10 |
+
*
|
11 |
+
* Do not edit or add to this file if you wish to upgrade to newer
|
12 |
+
* versions in the future.
|
13 |
+
*
|
14 |
+
* @category ET
|
15 |
+
* @package ET_IpSecurity
|
16 |
+
* @copyright Copyright (c) 2010 ET Web Solutions (http://etwebsolutions.com)
|
17 |
+
* @contacts support@etwebsolutions.com
|
18 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
19 |
+
*/
|
20 |
+
|
21 |
+
class ET_IpSecurity_Helper_Data extends Mage_Core_Helper_Abstract
|
22 |
+
{
|
23 |
+
|
24 |
+
}
|
app/code/community/ET/IpSecurity/Model/Observer.php
ADDED
@@ -0,0 +1,217 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ET Web Solutions
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
*
|
9 |
+
* DISCLAIMER
|
10 |
+
*
|
11 |
+
* Do not edit or add to this file if you wish to upgrade to newer
|
12 |
+
* versions in the future.
|
13 |
+
*
|
14 |
+
* @category ET
|
15 |
+
* @package ET_IpSecurity
|
16 |
+
* @copyright Copyright (c) 2010 ET Web Solutions (http://etwebsolutions.com)
|
17 |
+
* @contacts support@etwebsolutions.com
|
18 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
19 |
+
*/
|
20 |
+
|
21 |
+
class ET_IpSecurity_Model_Observer
|
22 |
+
{
|
23 |
+
private $redirect_page = null;
|
24 |
+
private $redirect_blank = null;
|
25 |
+
private $raw_allow_ip_data = null;
|
26 |
+
private $raw_block_ip_data = null;
|
27 |
+
private $raw_except_ip_data = null;
|
28 |
+
private $event_email = "";
|
29 |
+
private $email_template = 0;
|
30 |
+
private $email_identity = null;
|
31 |
+
private $storetype = null;
|
32 |
+
private $last_found_ip = null;
|
33 |
+
private $isFrontend = false;
|
34 |
+
|
35 |
+
|
36 |
+
public function __construct()
|
37 |
+
{
|
38 |
+
}
|
39 |
+
|
40 |
+
public function apply_ip_check_frontend($observer)
|
41 |
+
{
|
42 |
+
$this->redirect_page = $this->trim_slashes(Mage::getStoreConfig('etipsecurity/ipsecurityfront/redirect_page'));
|
43 |
+
$this->redirect_blank = Mage::getStoreConfig('etipsecurity/ipsecurityfront/redirect_blank');
|
44 |
+
$this->raw_allow_ip_data = Mage::getStoreConfig('etipsecurity/ipsecurityfront/allow');
|
45 |
+
$this->raw_block_ip_data = Mage::getStoreConfig('etipsecurity/ipsecurityfront/block');
|
46 |
+
|
47 |
+
$this->raw_except_ip_data = Mage::getStoreConfig('etipsecurity/ipsecuritymaintetance/except');
|
48 |
+
|
49 |
+
$this->event_email = Mage::getStoreConfig('etipsecurity/ipsecurityfront/email_event');
|
50 |
+
$this->email_template = Mage::getStoreConfig('etipsecurity/ipsecurityfront/email_template');
|
51 |
+
$this->email_identity = Mage::getStoreConfig('etipsecurity/ipsecurityfront/email_identity');
|
52 |
+
$this->storetype = Mage::helper("catalog")->__("Frontend");
|
53 |
+
$this->isFrontend = true;
|
54 |
+
$this->apply_ip_check($observer);
|
55 |
+
}
|
56 |
+
|
57 |
+
public function apply_ip_check_admin($observer)
|
58 |
+
{
|
59 |
+
$this->redirect_page = $this->trim_slashes(Mage::getStoreConfig('etipsecurity/ipsecurityadmin/redirect_page'));
|
60 |
+
$this->redirect_blank = Mage::getStoreConfig('etipsecurity/ipsecurityadmin/redirect_blank');
|
61 |
+
$this->raw_allow_ip_data = Mage::getStoreConfig('etipsecurity/ipsecurityadmin/allow');
|
62 |
+
$this->raw_block_ip_data = Mage::getStoreConfig('etipsecurity/ipsecurityadmin/block');
|
63 |
+
$this->event_email = Mage::getStoreConfig('etipsecurity/ipsecurityadmin/email_event');
|
64 |
+
$this->email_template = Mage::getStoreConfig('etipsecurity/ipsecurityadmin/email_template');
|
65 |
+
$this->email_identity = Mage::getStoreConfig('etipsecurity/ipsecurityadmin/email_identity');
|
66 |
+
$this->storetype = Mage::helper("core")->__("Admin");
|
67 |
+
$this->isFrontend = false;
|
68 |
+
$this->apply_ip_check($observer);
|
69 |
+
}
|
70 |
+
|
71 |
+
public function apply_ip_check($observer)
|
72 |
+
{
|
73 |
+
$current_ip = $_SERVER['REMOTE_ADDR'];
|
74 |
+
# start by allow all
|
75 |
+
$allow = true;
|
76 |
+
$allow_ips = null;
|
77 |
+
$block_ips = null;
|
78 |
+
$current_page = $this->trim_slashes(Mage::helper('core/url')->getCurrentUrl());
|
79 |
+
$this->redirect_page = $this->trim_slashes(Mage::app()->getStore()->getBaseUrl())."/".$this->redirect_page;
|
80 |
+
|
81 |
+
if(strlen($this->redirect_page)){$this->trim_slashes(Mage::getUrl('no-route'));}
|
82 |
+
|
83 |
+
$allow_ips = $this->_ip_raw_to_array($this->raw_allow_ip_data);
|
84 |
+
$block_ips = $this->_ip_raw_to_array($this->raw_block_ip_data);
|
85 |
+
$except_ips = $this->_ip_raw_to_array($this->raw_except_ip_data);
|
86 |
+
|
87 |
+
# look for allowed
|
88 |
+
if(strlen(trim($this->raw_allow_ip_data)) > 0)
|
89 |
+
{
|
90 |
+
# block all except allowed
|
91 |
+
$allow = false;
|
92 |
+
|
93 |
+
# are there any allowed ips
|
94 |
+
if($this->find_ip($current_ip,$allow_ips))
|
95 |
+
{
|
96 |
+
$allow = true;
|
97 |
+
}
|
98 |
+
}
|
99 |
+
# look for blocked
|
100 |
+
if(strlen(trim($this->raw_block_ip_data)) > 0)
|
101 |
+
{
|
102 |
+
# are there any allowed ips
|
103 |
+
if($this->find_ip($current_ip,$block_ips))
|
104 |
+
{
|
105 |
+
$allow = false;
|
106 |
+
}
|
107 |
+
}
|
108 |
+
|
109 |
+
if($this->redirect_blank==1 && !$allow)
|
110 |
+
{
|
111 |
+
if(!$allow) $this->_send();
|
112 |
+
header("HTTP/1.1 403 Forbidden");
|
113 |
+
header("Status: 403 Forbidden");
|
114 |
+
header("Content-type: text/html");
|
115 |
+
exit("Access denied for IP:<b> ".$current_ip."</b>");
|
116 |
+
}
|
117 |
+
|
118 |
+
if($current_page!=$this->redirect_page && !$allow)
|
119 |
+
{
|
120 |
+
header('Location: '.$this->redirect_page);
|
121 |
+
if(!$allow)$this->_send();
|
122 |
+
exit();
|
123 |
+
}
|
124 |
+
|
125 |
+
$maintenancemode = Mage::getStoreConfig('etipsecurity/ipsecuritymaintetance/enabled');
|
126 |
+
if (($maintenancemode) && ($this->isFrontend))
|
127 |
+
{
|
128 |
+
$dontloadsite = true;
|
129 |
+
# look for except
|
130 |
+
if(strlen(trim($this->raw_except_ip_data)) > 0)
|
131 |
+
{
|
132 |
+
# are there any except ips
|
133 |
+
if($this->find_ip($current_ip,$except_ips))
|
134 |
+
{
|
135 |
+
Mage::app()->getResponse()->appendBody(html_entity_decode( Mage::getStoreConfig('etipsecurity/ipsecuritymaintetance/remindermessage') , ENT_QUOTES, "utf-8"));
|
136 |
+
$dontloadsite = false;
|
137 |
+
}
|
138 |
+
}
|
139 |
+
|
140 |
+
if ($dontloadsite)
|
141 |
+
{
|
142 |
+
// ������� �������
|
143 |
+
header('HTTP/1.1 503 Service Temporarily Unavailable');
|
144 |
+
header('Status: 503 Service Temporarily Unavailable');
|
145 |
+
header('Retry-After: 7200'); // in seconds
|
146 |
+
print html_entity_decode( Mage::getStoreConfig('etipsecurity/ipsecuritymaintetance/message'), ENT_QUOTES, "utf-8");
|
147 |
+
exit();
|
148 |
+
}
|
149 |
+
|
150 |
+
}
|
151 |
+
|
152 |
+
|
153 |
+
|
154 |
+
return $this;
|
155 |
+
}
|
156 |
+
|
157 |
+
private function find_ip($search_ip,$array)
|
158 |
+
{
|
159 |
+
$found = false;
|
160 |
+
if(count($array)>0)
|
161 |
+
{
|
162 |
+
foreach($array as $iptxt)
|
163 |
+
{
|
164 |
+
$ip=explode("|",$iptxt);
|
165 |
+
$ip=trim($ip[0]);
|
166 |
+
if(preg_match('/^'.str_replace(array('\*','\?'), array('(.*?)','[0-9]'), preg_quote($ip)).'$/',$search_ip))
|
167 |
+
{
|
168 |
+
$found = true;
|
169 |
+
$this->last_found_ip=$iptxt;
|
170 |
+
return $found;
|
171 |
+
}
|
172 |
+
}
|
173 |
+
}
|
174 |
+
return $found;
|
175 |
+
}
|
176 |
+
|
177 |
+
private function trim_slashes($str)
|
178 |
+
{
|
179 |
+
$str = trim($str);
|
180 |
+
return $str == '/' ? $str : rtrim($str, '/');
|
181 |
+
}
|
182 |
+
|
183 |
+
private function _send()
|
184 |
+
{
|
185 |
+
if(!$this->event_email)return ;
|
186 |
+
$current_ip = $_SERVER['REMOTE_ADDR'];
|
187 |
+
$storeId = 0;//admin
|
188 |
+
|
189 |
+
$recipients = explode(",",$this->event_email);
|
190 |
+
|
191 |
+
$emailTemplate = Mage::getModel('core/email_template');
|
192 |
+
foreach($recipients as $k => $recipient)
|
193 |
+
$sendresult = $emailTemplate->setDesignConfig(array('area' => 'backend'))
|
194 |
+
->sendTransactional(
|
195 |
+
$this->email_template,
|
196 |
+
$this->email_identity,
|
197 |
+
trim($recipient),
|
198 |
+
trim($recipient),
|
199 |
+
array(
|
200 |
+
'ip' => $current_ip,
|
201 |
+
'ip_rule' => $this->last_found_ip,
|
202 |
+
'date' => Mage::app()->getLocale()->date(date("Y-m-d H:i:s"), Mage::app()->getLocale()->getDateTimeFormat(Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM), null,true),//->toString('yyyy-MM-dd HH:ii:ss')
|
203 |
+
'storetype'=>$this->storetype,
|
204 |
+
'info'=>base64_encode(serialize(array($this->raw_allow_ip_data,$this->raw_block_ip_data))),
|
205 |
+
)
|
206 |
+
);
|
207 |
+
|
208 |
+
}
|
209 |
+
|
210 |
+
private function _ip_raw_to_array($text)
|
211 |
+
{
|
212 |
+
$ips = preg_split("/[\n\r]+/", $text);
|
213 |
+
foreach($ips as $ipsk=>$ipsv)
|
214 |
+
if(trim($ipsv)=="")unset($ips[$ipsk]);
|
215 |
+
return $ips;
|
216 |
+
}
|
217 |
+
}
|
app/code/community/ET/IpSecurity/etc/config.xml
ADDED
@@ -0,0 +1,178 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* ET Web Solutions
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
9 |
+
*
|
10 |
+
* DISCLAIMER
|
11 |
+
*
|
12 |
+
* Do not edit or add to this file if you wish to upgrade to newer
|
13 |
+
* versions in the future.
|
14 |
+
*
|
15 |
+
* @category ET
|
16 |
+
* @package ET_IpSecurity
|
17 |
+
* @copyright Copyright (c) 2010 ET Web Solutions (http://etwebsolutions.com)
|
18 |
+
* @contacts support@etwebsolutions.com
|
19 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
20 |
+
*/
|
21 |
+
-->
|
22 |
+
|
23 |
+
<config>
|
24 |
+
<modules>
|
25 |
+
<ET_IpSecurity>
|
26 |
+
<version>1.2.0</version>
|
27 |
+
<descr>
|
28 |
+
<ru_RU><![CDATA[
|
29 |
+
Модуль позволяет ограничивать доступ к сайту посетителям по IP или по IP маскам.
|
30 |
+
При срабатывании правила перенаправляет посетителя на указанную CMS страницу или просто на пустую страницу. Также может оповестить владельца сайта о сработавшем правиле по е-майл.
|
31 |
+
|
32 |
+
Доступна функция отключения сайта на техническое обслуживание.]]>
|
33 |
+
</ru_RU>
|
34 |
+
<en_US><![CDATA[
|
35 |
+
Extension allows to restrict access to website for visitors by IP or IP mask.
|
36 |
+
When blocking rule is applied user is redirected to selected CMS page or blank page. Also extension can notify website owner about blocked visitor by email.
|
37 |
+
|
38 |
+
Second function: Allows to turn off frontend during maintenance operations.]]>
|
39 |
+
</en_US>
|
40 |
+
</descr>
|
41 |
+
|
42 |
+
</ET_IpSecurity>
|
43 |
+
</modules>
|
44 |
+
<global>
|
45 |
+
<models>
|
46 |
+
<etipsecurity>
|
47 |
+
<class>ET_IpSecurity_Model</class>
|
48 |
+
</etipsecurity>
|
49 |
+
</models>
|
50 |
+
<helpers>
|
51 |
+
<etipsecurity>
|
52 |
+
<class>ET_IpSecurity_Helper</class>
|
53 |
+
</etipsecurity>
|
54 |
+
</helpers>
|
55 |
+
<template>
|
56 |
+
<email>
|
57 |
+
<etipsecurity_ipsecurityfront_email_template translate="label" module="etipsecurity">
|
58 |
+
<label>Security Violence to Frontend</label>
|
59 |
+
<file>et_ipsecurity.html</file>
|
60 |
+
<type>text</type>
|
61 |
+
</etipsecurity_ipsecurityfront_email_template>
|
62 |
+
<etipsecurity_ipsecurityadmin_email_template translate="label" module="etipsecurity">
|
63 |
+
<label>Security Violence to Admin</label>
|
64 |
+
<file>et_ipsecurity_admin.html</file>
|
65 |
+
<type>text</type>
|
66 |
+
</etipsecurity_ipsecurityadmin_email_template>
|
67 |
+
</email>
|
68 |
+
</template>
|
69 |
+
</global>
|
70 |
+
|
71 |
+
<default>
|
72 |
+
<etipsecurity>
|
73 |
+
<ipsecuritymaintetance>
|
74 |
+
<enabled>0</enabled>
|
75 |
+
<message><![CDATA[
|
76 |
+
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
77 |
+
<html>
|
78 |
+
<head>
|
79 |
+
<title>We're sorry, but our website is under maintenance.</title>
|
80 |
+
<style>
|
81 |
+
body {
|
82 |
+
background:#FFF none repeat scroll 0 0;
|
83 |
+
color:#000;
|
84 |
+
font-family:Helvetica,Arial,Verdana,sans-serif;
|
85 |
+
font-size:12px;
|
86 |
+
|
87 |
+
margin:0;
|
88 |
+
padding:0;
|
89 |
+
text-align:center;
|
90 |
+
}
|
91 |
+
h1
|
92 |
+
{
|
93 |
+
margin:0px;
|
94 |
+
padding:0px;
|
95 |
+
margin-top:30%;
|
96 |
+
font-size: 25pt;
|
97 |
+
display:block;
|
98 |
+
}
|
99 |
+
h2
|
100 |
+
{
|
101 |
+
padding:0px;
|
102 |
+
margin-top: 5px;
|
103 |
+
font-size: 18pt;
|
104 |
+
}
|
105 |
+
|
106 |
+
</style>
|
107 |
+
</head>
|
108 |
+
|
109 |
+
<body>
|
110 |
+
<h1>We're sorry, but our website is under maintenance.</h1>
|
111 |
+
<h2>Please try refreshing this page later.</h2>
|
112 |
+
</body>
|
113 |
+
|
114 |
+
</html>
|
115 |
+
]]>
|
116 |
+
</message>
|
117 |
+
<remindermessage><![CDATA[<p style="margin:0; padding:6px 10px; background:#d75f07; font-size:12px; line-height:1.15; text-align:center; color:#fff;">This store is under maintenance. Yo can see this page because your IP is in exception list.</p>]]></remindermessage>
|
118 |
+
</ipsecuritymaintetance>
|
119 |
+
</etipsecurity>
|
120 |
+
</default>
|
121 |
+
|
122 |
+
|
123 |
+
<frontend>
|
124 |
+
<events>
|
125 |
+
<controller_action_predispatch>
|
126 |
+
<observers>
|
127 |
+
<ET_IpSecurity_observer>
|
128 |
+
<type>singleton</type>
|
129 |
+
<class>etipsecurity/observer</class>
|
130 |
+
<method>apply_ip_check_frontend</method>
|
131 |
+
</ET_IpSecurity_observer>
|
132 |
+
</observers>
|
133 |
+
</controller_action_predispatch>
|
134 |
+
</events>
|
135 |
+
</frontend>
|
136 |
+
<adminhtml>
|
137 |
+
<events>
|
138 |
+
<controller_action_predispatch>
|
139 |
+
<observers>
|
140 |
+
<ET_IpSecurity_observer>
|
141 |
+
<type>singleton</type>
|
142 |
+
<class>etipsecurity/observer</class>
|
143 |
+
<method>apply_ip_check_admin</method>
|
144 |
+
</ET_IpSecurity_observer>
|
145 |
+
</observers>
|
146 |
+
</controller_action_predispatch>
|
147 |
+
</events>
|
148 |
+
<acl>
|
149 |
+
<resources>
|
150 |
+
<admin>
|
151 |
+
<children>
|
152 |
+
<system>
|
153 |
+
<children>
|
154 |
+
<config>
|
155 |
+
<children>
|
156 |
+
<etipsecurity translate="title" module="etipsecurity">
|
157 |
+
<title>ET IP Security Section</title>
|
158 |
+
<sort_order>300</sort_order>
|
159 |
+
</etipsecurity>
|
160 |
+
</children>
|
161 |
+
</config>
|
162 |
+
</children>
|
163 |
+
</system>
|
164 |
+
</children>
|
165 |
+
</admin>
|
166 |
+
</resources>
|
167 |
+
</acl>
|
168 |
+
<translate>
|
169 |
+
<modules>
|
170 |
+
<ET_IpSecurity>
|
171 |
+
<files>
|
172 |
+
<default>ET_IpSecurity.csv</default>
|
173 |
+
</files>
|
174 |
+
</ET_IpSecurity>
|
175 |
+
</modules>
|
176 |
+
</translate>
|
177 |
+
</adminhtml>
|
178 |
+
</config>
|
app/code/community/ET/IpSecurity/etc/system.xml
ADDED
@@ -0,0 +1,235 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* ET Web Solutions
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
9 |
+
*
|
10 |
+
* DISCLAIMER
|
11 |
+
*
|
12 |
+
* Do not edit or add to this file if you wish to upgrade to newer
|
13 |
+
* versions in the future.
|
14 |
+
*
|
15 |
+
* @category ET
|
16 |
+
* @package ET_IpSecurity
|
17 |
+
* @copyright Copyright (c) 2010 ET Web Solutions (http://etwebsolutions.com)
|
18 |
+
* @contacts support@etwebsolutions.com
|
19 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
20 |
+
*/
|
21 |
+
-->
|
22 |
+
|
23 |
+
<config>
|
24 |
+
<tabs>
|
25 |
+
<etall translate="label">
|
26 |
+
<label>ET Extensions</label>
|
27 |
+
<sort_order>400</sort_order>
|
28 |
+
</etall>
|
29 |
+
</tabs>
|
30 |
+
|
31 |
+
<sections>
|
32 |
+
<etipsecurity translate="label" module="etipsecurity">
|
33 |
+
<label>IP Security</label>
|
34 |
+
<tab>etall</tab>
|
35 |
+
<frontend_type>text</frontend_type>
|
36 |
+
<sort_order>300</sort_order>
|
37 |
+
<show_in_default>1</show_in_default>
|
38 |
+
<show_in_website>1</show_in_website>
|
39 |
+
<show_in_store>1</show_in_store>
|
40 |
+
<groups>
|
41 |
+
<ipsecurityfront translate="label comment">
|
42 |
+
<label>IP Security - Frontend</label>
|
43 |
+
<sort_order>10</sort_order>
|
44 |
+
<show_in_default>1</show_in_default>
|
45 |
+
<show_in_website>1</show_in_website>
|
46 |
+
<show_in_store>1</show_in_store>
|
47 |
+
<fields>
|
48 |
+
<allow translate="label comment">
|
49 |
+
<label>Allow these IPs</label>
|
50 |
+
<comment>Visitors with other IPs will be blocked.</comment>
|
51 |
+
<frontend_type>textarea</frontend_type>
|
52 |
+
<sort_order>10</sort_order>
|
53 |
+
<show_in_default>1</show_in_default>
|
54 |
+
<show_in_website>1</show_in_website>
|
55 |
+
<show_in_store>1</show_in_store>
|
56 |
+
</allow>
|
57 |
+
<block translate="label">
|
58 |
+
<label>Block these IPs</label>
|
59 |
+
<frontend_type>textarea</frontend_type>
|
60 |
+
<sort_order>20</sort_order>
|
61 |
+
<show_in_default>1</show_in_default>
|
62 |
+
<show_in_website>1</show_in_website>
|
63 |
+
<show_in_store>1</show_in_store>
|
64 |
+
</block>
|
65 |
+
<redirect_blank translate="label comment">
|
66 |
+
<label>Redirect to blank page</label>
|
67 |
+
<comment>When blocking rule is applied visitor will be redirected to a blank page with blocking rule description.</comment>
|
68 |
+
<frontend_type>select</frontend_type>
|
69 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
70 |
+
<sort_order>30</sort_order>
|
71 |
+
<show_in_default>1</show_in_default>
|
72 |
+
<show_in_website>1</show_in_website>
|
73 |
+
<show_in_store>1</show_in_store>
|
74 |
+
</redirect_blank>
|
75 |
+
<redirect_page translate="label comment">
|
76 |
+
<label>Redirect to CMS page</label>
|
77 |
+
<comment>Visitor will not be notified about blocking rule redirection.</comment>
|
78 |
+
<frontend_type>select</frontend_type>
|
79 |
+
<source_model>adminhtml/system_config_source_cms_page</source_model>
|
80 |
+
<sort_order>40</sort_order>
|
81 |
+
<show_in_default>1</show_in_default>
|
82 |
+
<show_in_website>1</show_in_website>
|
83 |
+
<show_in_store>1</show_in_store>
|
84 |
+
</redirect_page>
|
85 |
+
<email_event translate="label comment">
|
86 |
+
<label>Mail block events to</label>
|
87 |
+
<comment>You can specify multiple recipients. Comma separated. For example: admin1@example.com, admin2@example.com</comment>
|
88 |
+
<frontend_type>text</frontend_type>
|
89 |
+
<sort_order>50</sort_order>
|
90 |
+
<show_in_default>1</show_in_default>
|
91 |
+
<show_in_website>1</show_in_website>
|
92 |
+
<show_in_store>1</show_in_store>
|
93 |
+
</email_event>
|
94 |
+
<email_template translate="label">
|
95 |
+
<label>Email Template</label>
|
96 |
+
<frontend_type>select</frontend_type>
|
97 |
+
<source_model>adminhtml/system_config_source_email_template</source_model>
|
98 |
+
<sort_order>60</sort_order>
|
99 |
+
<show_in_default>1</show_in_default>
|
100 |
+
<show_in_website>1</show_in_website>
|
101 |
+
<show_in_store>1</show_in_store>
|
102 |
+
</email_template>
|
103 |
+
<email_identity translate="label">
|
104 |
+
<label>Store email</label>
|
105 |
+
<frontend_type>select</frontend_type>
|
106 |
+
<source_model>adminhtml/system_config_source_email_identity</source_model>
|
107 |
+
<sort_order>70</sort_order>
|
108 |
+
<show_in_default>1</show_in_default>
|
109 |
+
<show_in_website>1</show_in_website>
|
110 |
+
<show_in_store>1</show_in_store>
|
111 |
+
</email_identity>
|
112 |
+
</fields>
|
113 |
+
</ipsecurityfront>
|
114 |
+
<ipsecurityadmin translate="label comment">
|
115 |
+
<label>IP Security - Admin</label>
|
116 |
+
<sort_order>20</sort_order>
|
117 |
+
<show_in_default>1</show_in_default>
|
118 |
+
<show_in_website>1</show_in_website>
|
119 |
+
<show_in_store>1</show_in_store>
|
120 |
+
<fields>
|
121 |
+
<allow translate="label comment">
|
122 |
+
<label>Allow these IPs</label>
|
123 |
+
<frontend_type>textarea</frontend_type>
|
124 |
+
<comment>Be careful not to lock yourself out!</comment>
|
125 |
+
<sort_order>10</sort_order>
|
126 |
+
<show_in_default>1</show_in_default>
|
127 |
+
<show_in_website>1</show_in_website>
|
128 |
+
<show_in_store>1</show_in_store>
|
129 |
+
</allow>
|
130 |
+
<block translate="label">
|
131 |
+
<label>Block these IPs</label>
|
132 |
+
<frontend_type>textarea</frontend_type>
|
133 |
+
<sort_order>20</sort_order>
|
134 |
+
<show_in_default>1</show_in_default>
|
135 |
+
<show_in_website>1</show_in_website>
|
136 |
+
<show_in_store>1</show_in_store>
|
137 |
+
</block>
|
138 |
+
<redirect_blank translate="label comment">
|
139 |
+
<label>Redirect to blank page</label>
|
140 |
+
<comment>When blocking rule is applied visitor will be redirected to a blank page with blocking rule description.</comment>
|
141 |
+
<frontend_type>select</frontend_type>
|
142 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
143 |
+
<sort_order>30</sort_order>
|
144 |
+
<show_in_default>1</show_in_default>
|
145 |
+
<show_in_website>1</show_in_website>
|
146 |
+
<show_in_store>1</show_in_store>
|
147 |
+
</redirect_blank>
|
148 |
+
<redirect_page translate="label">
|
149 |
+
<label>Redirect to CMS page</label>
|
150 |
+
<frontend_type>select</frontend_type>
|
151 |
+
<source_model>adminhtml/system_config_source_cms_page</source_model>
|
152 |
+
<sort_order>40</sort_order>
|
153 |
+
<show_in_default>1</show_in_default>
|
154 |
+
<show_in_website>1</show_in_website>
|
155 |
+
<show_in_store>1</show_in_store>
|
156 |
+
</redirect_page>
|
157 |
+
<email_event translate="label comment">
|
158 |
+
<label>Mail block events to</label>
|
159 |
+
<comment>You can specify multiple recipients. Comma separated. For example: admin1@example.com, admin2@example.com</comment>
|
160 |
+
<frontend_type>text</frontend_type>
|
161 |
+
<sort_order>50</sort_order>
|
162 |
+
<show_in_default>1</show_in_default>
|
163 |
+
<show_in_website>1</show_in_website>
|
164 |
+
<show_in_store>1</show_in_store>
|
165 |
+
</email_event>
|
166 |
+
<email_template translate="label">
|
167 |
+
<label>Email Template</label>
|
168 |
+
<frontend_type>select</frontend_type>
|
169 |
+
<source_model>adminhtml/system_config_source_email_template</source_model>
|
170 |
+
<sort_order>60</sort_order>
|
171 |
+
<show_in_default>1</show_in_default>
|
172 |
+
<show_in_website>1</show_in_website>
|
173 |
+
<show_in_store>1</show_in_store>
|
174 |
+
</email_template>
|
175 |
+
<email_identity translate="label">
|
176 |
+
<label>Store email</label>
|
177 |
+
<frontend_type>select</frontend_type>
|
178 |
+
<source_model>adminhtml/system_config_source_email_identity</source_model>
|
179 |
+
<sort_order>70</sort_order>
|
180 |
+
<show_in_default>1</show_in_default>
|
181 |
+
<show_in_website>1</show_in_website>
|
182 |
+
<show_in_store>1</show_in_store>
|
183 |
+
</email_identity>
|
184 |
+
</fields>
|
185 |
+
</ipsecurityadmin>
|
186 |
+
|
187 |
+
<ipsecuritymaintetance translate="label comment">
|
188 |
+
<label>IP Security - Maintenance page</label>
|
189 |
+
<sort_order>30</sort_order>
|
190 |
+
<show_in_default>1</show_in_default>
|
191 |
+
<show_in_website>1</show_in_website>
|
192 |
+
<show_in_store>1</show_in_store>
|
193 |
+
<fields>
|
194 |
+
<enabled translate="label comment">
|
195 |
+
<label>Store Offline</label>
|
196 |
+
<comment>For frontend only.</comment>
|
197 |
+
<frontend_type>select</frontend_type>
|
198 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
199 |
+
<sort_order>10</sort_order>
|
200 |
+
<show_in_default>1</show_in_default>
|
201 |
+
<show_in_website>1</show_in_website>
|
202 |
+
<show_in_store>1</show_in_store>
|
203 |
+
</enabled>
|
204 |
+
<except translate="label comment">
|
205 |
+
<label>Except these IPs</label>
|
206 |
+
<frontend_type>textarea</frontend_type>
|
207 |
+
<comment>Visitors with these IPs will not be redirected to maintenance page.</comment>
|
208 |
+
<sort_order>20</sort_order>
|
209 |
+
<show_in_default>1</show_in_default>
|
210 |
+
<show_in_website>1</show_in_website>
|
211 |
+
<show_in_store>1</show_in_store>
|
212 |
+
</except>
|
213 |
+
<message translate="label">
|
214 |
+
<label>Message</label>
|
215 |
+
<frontend_type>textarea</frontend_type>
|
216 |
+
<sort_order>30</sort_order>
|
217 |
+
<show_in_default>1</show_in_default>
|
218 |
+
<show_in_website>1</show_in_website>
|
219 |
+
<show_in_store>1</show_in_store>
|
220 |
+
</message>
|
221 |
+
<remindermessage translate="label">
|
222 |
+
<label>Reminder message</label>
|
223 |
+
<comment>This message will be shown on frontend for visitors with IP adresses from exception list while maintenance mode is on.</comment>
|
224 |
+
<frontend_type>textarea</frontend_type>
|
225 |
+
<sort_order>40</sort_order>
|
226 |
+
<show_in_default>1</show_in_default>
|
227 |
+
<show_in_website>1</show_in_website>
|
228 |
+
<show_in_store>1</show_in_store>
|
229 |
+
</remindermessage>
|
230 |
+
</fields>
|
231 |
+
</ipsecuritymaintetance>
|
232 |
+
</groups>
|
233 |
+
</etipsecurity>
|
234 |
+
</sections>
|
235 |
+
</config>
|
app/etc/modules/ET_IpSecurity.xml
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* ET Web Solutions
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
9 |
+
*
|
10 |
+
* DISCLAIMER
|
11 |
+
*
|
12 |
+
* Do not edit or add to this file if you wish to upgrade to newer
|
13 |
+
* versions in the future.
|
14 |
+
*
|
15 |
+
* @category ET
|
16 |
+
* @package ET_IpSecurity
|
17 |
+
* @copyright Copyright (c) 2010 ET Web Solutions (http://etwebsolutions.com)
|
18 |
+
* @contacts support@etwebsolutions.com
|
19 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
20 |
+
*/
|
21 |
+
-->
|
22 |
+
|
23 |
+
<config>
|
24 |
+
<modules>
|
25 |
+
<ET_IpSecurity>
|
26 |
+
<active>true</active>
|
27 |
+
<codePool>community</codePool>
|
28 |
+
</ET_IpSecurity>
|
29 |
+
</modules>
|
30 |
+
</config>
|
app/locale/en_US/ET_IpSecurity.csv
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"Security Violence to Frontend","Security Violence to Frontend"
|
2 |
+
"Security Violence to Admin","Security Violence to Admin"
|
3 |
+
"IP Security - Frontend","IP Security - Frontend"
|
4 |
+
"IP Security - Admin","IP Security - Admin"
|
5 |
+
"Allow these IPs","Allow this IPs"
|
6 |
+
"Visitors with other IPs will be blocked.","Visitors with other IPs will be blocked."
|
7 |
+
"Block these IPs","Block this IPs"
|
8 |
+
"Redirect to blank page","Redirect to blank page"
|
9 |
+
"When blocking rule is applied visitor will be redirected to a blank page with blocking rule description.","When blocking rule applies then visitor will be redirected to a blank page with blocking rule description."
|
10 |
+
"Redirect to CMS page","Redirect to CMS page"
|
11 |
+
"Mail block events to","Mail block events to"
|
12 |
+
"You can specify multiple recipients. Comma separated. For example: admin1@example.com, admin2@example.com","You can specify multiple recipients. Comma separated. For example: admin1@example.com, admin2@example.com"
|
13 |
+
"Email Template","Email Template"
|
14 |
+
"Store email","Store email"
|
15 |
+
"Be careful not to lock yourself out!","Be careful not to lock yourself out!"
|
16 |
+
"Visitor will not be notified about blocking rule redirection.","Visitor will not be notified about blocking rule redirection."
|
17 |
+
"IP Security - Maintenance page","IP Security - Maintenance page"
|
18 |
+
"Store Offline","Store Offline"
|
19 |
+
"Except these IPs","Except these IPs"
|
20 |
+
"Visitors with these IPs will not be redirected to maintenance page.","Visitors with these IPs will not be redirected to maintenance page."
|
21 |
+
"Message","Message"
|
22 |
+
"Reminder message","Reminder message"
|
23 |
+
"This message will be shown on frontend for visitors with IP adresses from exception list while maintenance mode is on.","This message will be shown on frontend for visitors with IP adresses from exception list while maintenance mode is on."
|
24 |
+
"For frontend only.","For frontend only."
|
app/locale/en_US/template/email/et_ipsecurity.html
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!--@subject IP Security - Security Violence @-->
|
2 |
+
Rejected access to {{var storetype}} from
|
3 |
+
|
4 |
+
ip: {{var ip}}
|
5 |
+
ip rules: {{var ip_rule}}
|
6 |
+
|
7 |
+
time: {{var date}}
|
app/locale/en_US/template/email/et_ipsecurity_admin.html
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!--@subject IP Security - Security Violence @-->
|
2 |
+
Rejected access to {{var storetype}} from
|
3 |
+
|
4 |
+
ip: {{var ip}}
|
5 |
+
ip rules: {{var ip_rule}}
|
6 |
+
|
7 |
+
time: {{var date}}
|
app/locale/ru_RU/ET_IpSecurity.csv
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"Security Violence to Frontend","Правило блокировки. Пользовательская часть"
|
2 |
+
"Security Violence to Admin","Правило блокировки. Панель администрирования"
|
3 |
+
"IP Security - Frontend","IP Security - Пользовательская часть"
|
4 |
+
"IP Security - Admin","IP Security - Панель администрирования"
|
5 |
+
"Allow these IPs","Разрешённые IP"
|
6 |
+
"Visitors with other IPs will be blocked.","Посетители с другими IP адресами будут заблокированы."
|
7 |
+
"Block these IPs","Заблокированные IP"
|
8 |
+
"Redirect to blank page","Перенаправить на пустую страницу"
|
9 |
+
"When blocking rule is applied visitor will be redirected to a blank page with blocking rule description.","При сработавшем правиле блокировки посетитель будет перенаправлен на пустую страницу с указанием причины блокировки."
|
10 |
+
"Redirect to CMS page","Перенаправить на CMS страницу"
|
11 |
+
"Mail block events to","Оповестить при блокировке"
|
12 |
+
"You can specify multiple recipients. Comma separated. For example: admin1@example.com, admin2@example.com","Можно указывать несколько получателей. Разделитель запятая. Например: admin1@example.com,admin2@example.com"
|
13 |
+
"Email Template","Email. Шаблон"
|
14 |
+
"Store email","Email. Отправитель"
|
15 |
+
"Be careful not to lock yourself out!","Будьте осторожны: не заблокируйте себя!"
|
16 |
+
"Visitor will not be notified about blocking rule redirection.","Посетитель не будет предупреждён о срабатывании правила блокировки."
|
17 |
+
"IP Security - Maintenance page","IP Security - Техническое обслуживание"
|
18 |
+
"Store Offline","Технические работы"
|
19 |
+
"Except these IPs","IP - исключения"
|
20 |
+
"Visitors with these IPs will not be redirected to maintenance page.","Посетители с этими IP адресами не будут перенаправлены на страницу с сообщением о техническом обслуживании."
|
21 |
+
"Message","Сообщение о тех. обслуживании"
|
22 |
+
"Reminder message","Напоминание"
|
23 |
+
"This message will be shown on frontend for visitors with IP adresses from exception list while maintenance mode is on.","Это сообщение будет показываться в пользовательской части для посетителей с IP адресами из списка исключений во время технического обслуживания."
|
24 |
+
"For frontend only.","Только для пользовательской части."
|
app/locale/ru_RU/template/email/et_ipsecurity.html
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!--@subject IP Security - сработало правило блокировки @-->
|
2 |
+
Запрещён доступ к {{var storetype}} с
|
3 |
+
|
4 |
+
ip: {{var ip}}
|
5 |
+
ip маски: {{var ip_rule}}
|
6 |
+
|
7 |
+
время: {{var date}}
|
app/locale/ru_RU/template/email/et_ipsecurity_admin.html
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!--@subject IP Security - сработало правило блокировки @-->
|
2 |
+
Запрещён доступ к {{var storetype}} c
|
3 |
+
|
4 |
+
ip: {{var ip}}
|
5 |
+
ip маски: {{var ip_rule}}
|
6 |
+
|
7 |
+
время: {{var date}}
|
package.xml
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>ET_IpSecurity</name>
|
4 |
+
<version>1.2.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="http://opensource.org/licenses/afl-3.0.php">AFL v3.0</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>Extension allows to restrict access to website for visitors by IP or IP mask. Also allows to turn off frontend during maintenance operations.</summary>
|
10 |
+
<description>Extension allows to restrict access to website for visitors by IP or IP mask.
|
11 |
+
When blocking rule is applied user is redirected to selected CMS page or blank page. Also extension can notify website owner about blocked visitor by email.
|
12 |
+
|
13 |
+
Second function: Allows to turn off frontend during maintenance operations.</description>
|
14 |
+
<notes>stable release</notes>
|
15 |
+
<authors><author><name>Jurij</name><user>auto-converted</user><email>support@etwebsolutions.com</email></author><author><name>Andrej</name><user>auto-converted</user><email>support@etwebsolutions.com</email></author></authors>
|
16 |
+
<date>2011-03-16</date>
|
17 |
+
<time>09:33:28</time>
|
18 |
+
<contents><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><file name="et_ipsecurity.html" hash="2b67f7f1bc21e003da6246fe76462af4"/><file name="et_ipsecurity_admin.html" hash="2b67f7f1bc21e003da6246fe76462af4"/></dir></dir><file name="ET_IpSecurity.csv" hash="8b4fc0cd956bf8b0a53a3c5e0f536a99"/></dir><dir name="ru_RU"><dir name="template"><dir name="email"><file name="et_ipsecurity.html" hash="a6f731a6903375bfc06edc6a31d67865"/><file name="et_ipsecurity_admin.html" hash="5961f9ae7d71f843d96d70c18c223222"/></dir></dir><file name="ET_IpSecurity.csv" hash="2c020f5252df9609612958614859f52f"/></dir></target><target name="magecommunity"><dir name="ET"><dir name="IpSecurity"><dir name="etc"><file name="config.xml" hash="a30097388a5505bc545d455f109de245"/><file name="system.xml" hash="9f060a7b91e000fcc6ce8afd24ba3e9c"/></dir><dir name="Helper"><file name="Data.php" hash="08c557cd26157c317c1049d5f1366eab"/></dir><dir name="Model"><file name="Observer.php" hash="26397e406077cd3d02daf411b5848c6d"/></dir></dir><file name="ET_IpSecurity_ChangeLog.txt" hash="c1daa09a4a31370a48376e31777f886d"/><file name="ET_IpSecurity_Description.txt" hash="0661ec492df75d81adbbadeb37aec9cd"/><file name="ET_IpSecurity_LICENSE.txt" hash="b799504264c23c11a941473d7a3e3ab7"/></dir></target><target name="mageetc"><dir name="modules"><file name="ET_IpSecurity.xml" hash="d191fe14ed772c4515519e1445af2229"/></dir></target></contents>
|
19 |
+
<compatible/>
|
20 |
+
<dependencies/>
|
21 |
+
</package>
|