Version Notes
1.0.3
Download this release
Release Info
Developer | EcomwiseTeam |
Extension | Ecomwise_Forcelogin |
Version | 1.0.3 |
Comparing to | |
See all releases |
Code changes from version 1.0.2 to 1.0.3
app/code/community/Ecomwise/Forcelogin/Model/Observer.php
CHANGED
@@ -3,28 +3,30 @@ class Ecomwise_Forcelogin_Model_Observer extends Varien_Object{
|
|
3 |
|
4 |
public function forceLogin($observer){
|
5 |
|
6 |
-
|
7 |
-
//echo Mage::app()->getRequest()->getActionName(); exit;
|
8 |
-
//echo Mage::app()->getRequest()->getRouteName(); exit;
|
9 |
|
10 |
-
|
11 |
-
|
12 |
-
if ( ! Mage::getSingleton('customer/session')->isLoggedIn()
|
13 |
-
&& ! Mage::getSingleton('admin/session')->isLoggedIn()
|
14 |
-
&& Mage::app()->getRequest()->getModuleName() !== 'admin'
|
15 |
-
&& Mage::app()->getRequest()->getModuleName() !== 'api'
|
16 |
-
&& Mage::app()->getRequest()->getControllerName() !== 'account') {
|
17 |
-
$session = Mage::getSingleton("customer/session");
|
18 |
-
|
19 |
-
$session->setBeforeAuthUrl(Mage::helper('customer')->getLoginUrl());
|
20 |
-
|
21 |
-
Mage::app()->getResponse()
|
22 |
-
->setRedirect(Mage::helper('adminhtml')
|
23 |
-
->getUrl("customer/account/login", array('_type' => 'direct_link')));
|
24 |
-
|
25 |
-
}
|
26 |
|
27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
}
|
29 |
|
30 |
}
|
3 |
|
4 |
public function forceLogin($observer){
|
5 |
|
6 |
+
$adminPath = Mage::getStoreConfig('admin/url/custom_path');
|
|
|
|
|
7 |
|
8 |
+
$url = Mage::getConfig()->getNode('admin/routers/adminhtml/args/frontName');
|
9 |
+
$adminUrl = $url->asArray();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
+
|
12 |
+
$forceLogin = (bool) Mage::getStoreConfig('forcelogin/forcelogin/disable_ext', Mage::app()->getStore());
|
13 |
+
if(!$forceLogin){
|
14 |
+
if ( ! Mage::getSingleton('customer/session')->isLoggedIn()
|
15 |
+
&& ! Mage::getSingleton('admin/session')->isLoggedIn()
|
16 |
+
&& Mage::app()->getRequest()->getModuleName() !== $adminUrl
|
17 |
+
&& Mage::app()->getRequest()->getModuleName() !== $adminPath
|
18 |
+
&& Mage::app()->getRequest()->getModuleName() !== 'api'
|
19 |
+
&& Mage::app()->getRequest()->getControllerName() !== 'account') {
|
20 |
+
$session = Mage::getSingleton("customer/session");
|
21 |
+
|
22 |
+
$session->setBeforeAuthUrl(Mage::helper('customer')->getLoginUrl());
|
23 |
+
|
24 |
+
Mage::app()->getResponse()
|
25 |
+
->setRedirect(Mage::helper('adminhtml')
|
26 |
+
->getUrl("customer/account/login", array('_type' => 'direct_link')));
|
27 |
+
|
28 |
+
}
|
29 |
+
}
|
30 |
}
|
31 |
|
32 |
}
|
app/code/community/Ecomwise/Forcelogin/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Ecomwise_Forcelogin>
|
5 |
-
<version>1.0.
|
6 |
</Ecomwise_Forcelogin>
|
7 |
|
8 |
</modules>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Ecomwise_Forcelogin>
|
5 |
+
<version>1.0.3</version>
|
6 |
</Ecomwise_Forcelogin>
|
7 |
|
8 |
</modules>
|
package.xml
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Ecomwise_Forcelogin</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
<license>OSL-3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Ecomwise_Forcelogin</summary>
|
10 |
<description>Ecomwise_Forcelogin</description>
|
11 |
-
<notes>1.0.
|
12 |
<authors><author><name>EcomwiseTeam</name><user>EcomwiseTeam</user><email>info@ecomwise.com</email></author></authors>
|
13 |
<date>2014-11-19</date>
|
14 |
-
<time>
|
15 |
-
<contents><target name="magecommunity"><dir><dir name="Ecomwise"><dir name="Base"><dir name="Block"><dir name="NotificationsNotifier"><dir name="System"><dir name="Config"><dir name="Form"><dir name="Fieldset"><dir name="Ecomwise"><file name="Extensions.php" hash="bd35aca3be511e975d9f52200b61793a"/></dir></dir></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="7b4c6e200a7c96d8b636057efad0cc1e"/></dir><dir name="Model"><dir name="ExtensionsLicencer"><file name="Observer.php" hash="e5ce78f2d1de491159194d5c26fa8338"/></dir><dir name="NotificationsNotifier"><file name="Observer.php" hash="d7717cc44d954eb771a26160ea6206ae"/><dir name="Source"><dir name="Updates"><file name="Type.php" hash="9dc2b16665b60c4334a5e9b75bbcd1fd"/></dir></dir></dir></dir><dir name="etc"><file name="config.xml" hash="4233a2cbfb1c2b8a5de6ca8911955195"/><file name="system.xml" hash="89d092ed5df73b846826e6032d741885"/></dir></dir><dir name="Forcelogin"><dir name="Block"><dir name="System"><dir name="Config"><file name="Version.php" hash="e5ea1ca5d03c0d3fce4f91144c35c05c"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="529c0c5b3186eae81d6ee9a3fb900214"/></dir><dir name="Model"><file name="Observer.php" hash="
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.0.0</min><max>5.9.9</max></php></required></dependencies>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Ecomwise_Forcelogin</name>
|
4 |
+
<version>1.0.3</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>OSL-3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Ecomwise_Forcelogin</summary>
|
10 |
<description>Ecomwise_Forcelogin</description>
|
11 |
+
<notes>1.0.3</notes>
|
12 |
<authors><author><name>EcomwiseTeam</name><user>EcomwiseTeam</user><email>info@ecomwise.com</email></author></authors>
|
13 |
<date>2014-11-19</date>
|
14 |
+
<time>15:46:09</time>
|
15 |
+
<contents><target name="magecommunity"><dir><dir name="Ecomwise"><dir name="Base"><dir name="Block"><dir name="NotificationsNotifier"><dir name="System"><dir name="Config"><dir name="Form"><dir name="Fieldset"><dir name="Ecomwise"><file name="Extensions.php" hash="bd35aca3be511e975d9f52200b61793a"/></dir></dir></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="7b4c6e200a7c96d8b636057efad0cc1e"/></dir><dir name="Model"><dir name="ExtensionsLicencer"><file name="Observer.php" hash="e5ce78f2d1de491159194d5c26fa8338"/></dir><dir name="NotificationsNotifier"><file name="Observer.php" hash="d7717cc44d954eb771a26160ea6206ae"/><dir name="Source"><dir name="Updates"><file name="Type.php" hash="9dc2b16665b60c4334a5e9b75bbcd1fd"/></dir></dir></dir></dir><dir name="etc"><file name="config.xml" hash="4233a2cbfb1c2b8a5de6ca8911955195"/><file name="system.xml" hash="89d092ed5df73b846826e6032d741885"/></dir></dir><dir name="Forcelogin"><dir name="Block"><dir name="System"><dir name="Config"><file name="Version.php" hash="e5ea1ca5d03c0d3fce4f91144c35c05c"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="529c0c5b3186eae81d6ee9a3fb900214"/></dir><dir name="Model"><file name="Observer.php" hash="39be4b737fbe65d6e45d42200e2039c9"/></dir><dir name="etc"><file name="config.xml" hash="4c1caa89a37a56d3c18ce498f9155b98"/><file name="system.xml" hash="b82e942c9a5283d127120cd558753a9e"/></dir></dir></dir></dir></target><target name="mageetc"><dir><dir name="modules"><file name="Ecomwise_Base.xml" hash=""/><file name="Ecomwise_Forcelogin.xml" hash=""/></dir></dir></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.0.0</min><max>5.9.9</max></php></required></dependencies>
|
18 |
</package>
|