ET_IpSecurity - Version 1.5.1

Version Notes

stable release

Download this release

Release Info

Developer Magento Core Team
Extension ET_IpSecurity
Version 1.5.1
Comparing to
See all releases


Code changes from version 1.5.0 to 1.5.1

app/code/community/ET/ET_IpSecurity_ChangeLog.txt CHANGED
@@ -9,12 +9,14 @@ TODO and some thoughts:
9
  + integrate anti spam service http://www.projecthoneypot.org/
10
 
11
  =====================================
 
 
 
12
  ver. 1.5.0
13
  + added table to database to store blocked ip's
14
  + added log grid in admin
15
  + added option: send notification every time on block or only on first
16
 
17
-
18
  ver. 1.2.0
19
  + changed code pool from local to community
20
  + changed settings section
9
  + integrate anti spam service http://www.projecthoneypot.org/
10
 
11
  =====================================
12
+ ver. 1.5.1
13
+ * resolved infinite loop when admin block rule happens and option "Add Store Code to Urls" = Yes and redirect to CMS page is on.
14
+
15
  ver. 1.5.0
16
  + added table to database to store blocked ip's
17
  + added log grid in admin
18
  + added option: send notification every time on block or only on first
19
 
 
20
  ver. 1.2.0
21
  + changed code pool from local to community
22
  + changed settings section
app/code/community/ET/IpSecurity/Model/Observer.php CHANGED
@@ -80,7 +80,32 @@ class ET_IpSecurity_Model_Observer
80
  $block_ips = null;
81
  $except_ips = null;
82
  $current_page = $this->trim_slashes(Mage::helper('core/url')->getCurrentUrl());
83
- $this->redirect_page = $this->trim_slashes(Mage::app()->getStore()->getBaseUrl())."/".$this->redirect_page;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
  $neednotify = true;
85
  $scope = $this->isFrontend?'frontend':'admin';
86
 
80
  $block_ips = null;
81
  $except_ips = null;
82
  $current_page = $this->trim_slashes(Mage::helper('core/url')->getCurrentUrl());
83
+
84
+ // searching for CMS page storeId
85
+ // if we don't do it - we have loop in redirect with setting Add Store Code to Urls = Yes (block access to admin redirects to admin)
86
+ $stores = array();
87
+ foreach (Mage::app()->getStores() as $store)
88
+ {
89
+ $stores[] = $store->getId();
90
+ $pageId = Mage::getModel('cms/page')->checkIdentifier($this->redirect_page,$store->getId());
91
+ if($pageId===false) continue;
92
+ $pageStoreIds = Mage::getResourceModel('cms/page')->lookupStoreIds($pageId);
93
+ if (count($pageStoreIds)) // found page
94
+ break;
95
+ }
96
+
97
+ if (!count($pageStoreIds)) // no found in any store
98
+ $pageStoreIds[] = 0;
99
+
100
+ foreach ($pageStoreIds as $pageStoreId)
101
+ {
102
+ if ($pageStoreId > 0)
103
+ break;
104
+ }
105
+ if ($pageStoreId == 0)
106
+ $pageStoreId = $stores[0]; // first available store
107
+
108
+ $this->redirect_page = $this->trim_slashes(Mage::app()->getStore($pageStoreId)->getBaseUrl())."/".$this->redirect_page;
109
  $neednotify = true;
110
  $scope = $this->isFrontend?'frontend':'admin';
111
 
app/code/community/ET/IpSecurity/etc/config.xml CHANGED
@@ -23,7 +23,7 @@
23
  <config>
24
  <modules>
25
  <ET_IpSecurity>
26
- <version>1.5.0</version>
27
  <descr>
28
  <ru_RU><![CDATA[
29
  Модуль позволяет ограничивать доступ к сайту посетителям по IP или по IP маскам.
23
  <config>
24
  <modules>
25
  <ET_IpSecurity>
26
+ <version>1.5.1</version>
27
  <descr>
28
  <ru_RU><![CDATA[
29
  Модуль позволяет ограничивать доступ к сайту посетителям по IP или по IP маскам.
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>ET_IpSecurity</name>
4
- <version>1.5.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>
@@ -13,9 +13,9 @@ When blocking rule is applied user is redirected to selected CMS page or blank p
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-04-04</date>
17
- <time>08:42:03</time>
18
- <contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="et_ipsecurity.xml" hash="3e677b0e6fffcfb90d1d03dd7bc8daa8"/></dir></dir></dir></dir></target><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="26e22ba736a937422cfc1755670e71a8"/></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="7f1e9f9b92e96f45fc45b13d0ca4e5e6"/></dir></target><target name="magecommunity"><dir name="ET"><dir name="IpSecurity"><dir name="Block"><dir name="Adminhtml"><dir name="Log"><file name="Grid.php" hash="baef872daeaa6a195b4bab090244b16f"/></dir><file name="Log.php" hash="17f11639de5af08019be9577fd01e733"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="LogController.php" hash="cfc12c6a05fcb0486bb9f3b4c2eae4d0"/></dir></dir><dir name="etc"><file name="config.xml" hash="9193293cdf069c8d881d10f85de826f2"/><file name="system.xml" hash="462b9b4d2e802a63cdeaca5448b6bc47"/></dir><dir name="Helper"><file name="Data.php" hash="08c557cd26157c317c1049d5f1366eab"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Ipsecuritylog"><file name="Collection.php" hash="929fd786020e26b87f900caf0f2996f1"/></dir><file name="Ipsecuritylog.php" hash="4ec2037e5a52eaa4278ddd7ad2929dfc"/></dir><file name="Ipsecuritylog.php" hash="bb8a6ad3b612c46ef8b2fa36d2fac709"/><file name="Observer.php" hash="b64a18f85103c98da7599cedcb733521"/></dir><dir name="sql"><dir name="ipsecurity_setup"><file name="mysql4-install-1.5.php" hash="c2524c78dbb7db294d53983ca588c5bb"/></dir></dir></dir><file name="ET_IpSecurity_ChangeLog.txt" hash="b136ccc44d48b89820b617824b9a1da0"/><file name="ET_IpSecurity_Description.txt" hash="2adebaae43df777165b2ea3c9589ee73"/><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>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>ET_IpSecurity</name>
4
+ <version>1.5.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/afl-3.0.php">AFL v3.0</license>
7
  <channel>community</channel>
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-04-18</date>
17
+ <time>12:38:11</time>
18
+ <contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="et_ipsecurity.xml" hash="3e677b0e6fffcfb90d1d03dd7bc8daa8"/></dir></dir></dir></dir></target><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="26e22ba736a937422cfc1755670e71a8"/></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="7f1e9f9b92e96f45fc45b13d0ca4e5e6"/></dir></target><target name="magecommunity"><dir name="ET"><dir name="IpSecurity"><dir name="Block"><dir name="Adminhtml"><dir name="Log"><file name="Grid.php" hash="baef872daeaa6a195b4bab090244b16f"/></dir><file name="Log.php" hash="17f11639de5af08019be9577fd01e733"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="LogController.php" hash="cfc12c6a05fcb0486bb9f3b4c2eae4d0"/></dir></dir><dir name="etc"><file name="config.xml" hash="14fbd228ce29fc6ea0bd70e7612f9b84"/><file name="system.xml" hash="462b9b4d2e802a63cdeaca5448b6bc47"/></dir><dir name="Helper"><file name="Data.php" hash="08c557cd26157c317c1049d5f1366eab"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Ipsecuritylog"><file name="Collection.php" hash="929fd786020e26b87f900caf0f2996f1"/></dir><file name="Ipsecuritylog.php" hash="4ec2037e5a52eaa4278ddd7ad2929dfc"/></dir><file name="Ipsecuritylog.php" hash="bb8a6ad3b612c46ef8b2fa36d2fac709"/><file name="Observer.php" hash="91802ab18c3f30487781679334aa8f63"/></dir><dir name="sql"><dir name="ipsecurity_setup"><file name="mysql4-install-1.5.php" hash="c2524c78dbb7db294d53983ca588c5bb"/></dir></dir></dir><file name="ET_IpSecurity_ChangeLog.txt" hash="28fc7096051fea187631a1ba45c7e427"/><file name="ET_IpSecurity_Description.txt" hash="2adebaae43df777165b2ea3c9589ee73"/><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>