CP_LoginSecurity - Version 0.0.1

Version Notes

Customer Login Security

Download this release

Release Info

Developer Commerce Pundit
Extension CP_LoginSecurity
Version 0.0.1
Comparing to
See all releases


Version 0.0.1

app/code/community/CP/LoginSecurity/Helper/Data.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * @category Commerce Pundit Technologies
16
+ * @package CP_LoginSecurity
17
+ * @copyright Copyright (c) 2015 Commerce Pundit Technologies. (http://www.commercepundit.com)
18
+ * @author <<Dharmesh Hariyani>>
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ class CP_LoginSecurity_Helper_Data extends Mage_Core_Helper_Abstract
22
+ {
23
+
24
+ }
app/code/community/CP/LoginSecurity/Model/Observer.php ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * @category Commerce Pundit Technologies
16
+ * @package CP_LoginSecurity
17
+ * @copyright Copyright (c) 2015 Commerce Pundit Technologies. (http://www.commercepundit.com)
18
+ * @author <<Dharmesh Hariyani>>
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ class CP_LoginSecurity_Model_Observer extends Mage_Core_Model_Abstract
22
+ {
23
+ //When customer request new password and after changing new password, cutomer will loginsecurity from all other browser.
24
+ public function loginsecurityOnPasswordChange($observer)
25
+ {
26
+ if(Mage::getStoreConfig('loginsecuritysetting/login/enable',Mage::app()->getStore()) == '1')
27
+ {
28
+ $session = Mage::getSingleton('customer/session');
29
+ if ($session->isLoggedIn()) {
30
+ // Load the customer's data
31
+ $newHashPasswrd = $session->getCustomer()->getPasswordHash();
32
+ $oldHashPasswrd = $session->getCurrentPasswordHash();
33
+
34
+ if($newHashPasswrd!=$oldHashPasswrd && $oldHashPasswrd!="")
35
+ {
36
+ $session->logout();
37
+ $session->setCurrentPasswordHash('');
38
+ Mage::getSingleton('core/session')->addError('This account password is just changed from another device/browser. We recommend to login again.');
39
+ $url = Mage::getUrl('customer/account/login/passwordchanged/true');
40
+ $observer->getEvent()->getResponse()->setRedirect($url);
41
+ }
42
+ }
43
+ }
44
+ }
45
+
46
+ //Set Current password on session
47
+ public function setCurrentPassword($observer)
48
+ {
49
+ if(Mage::getStoreConfig('loginsecuritysetting/login/enable',Mage::app()->getStore()) == '1')
50
+ {
51
+ $currentHashPassword = $observer->getCustomer()->getPasswordHash();
52
+ Mage::getSingleton('customer/session')->setCurrentPasswordHash($currentHashPassword);
53
+ }
54
+
55
+ }
56
+
57
+ protected function _getHelper($path)
58
+ {
59
+ return Mage::helper($path);
60
+ }
61
+ protected function _getUrl($url, $params = array())
62
+ {
63
+ return Mage::getUrl($url, $params);
64
+ }
65
+ public function setErrorMessage($observer){
66
+ if(Mage::getStoreConfig('loginsecuritysetting/login/enable',Mage::app()->getStore()) == '1')
67
+ {
68
+ $msg = Mage::app()->getFrontController()->getRequest()->getParam('passwordchanged');
69
+ if($msg==true)
70
+ Mage::getSingleton('customer/session')->addError('This account password is just changed from another device/browser. We recommend to login again.');
71
+ }
72
+ }
73
+ }
app/code/community/CP/LoginSecurity/etc/adminhtml.xml ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * @category Commerce Pundit Technologies
17
+ * @package CP_LoginSecurity
18
+ * @copyright Copyright (c) 2015 Commerce Pundit Technologies. (http://www.commercepundit.com)
19
+ * @author <<Dharmesh Hariyani>>
20
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
21
+ */
22
+ -->
23
+ <config>
24
+ <acl>
25
+ <resources>
26
+ <admin>
27
+ <children>
28
+ <system>
29
+ <children>
30
+ <config>
31
+ <children>
32
+ <loginsecuritysetting>
33
+ <title>Login Security Settings</title>
34
+ </loginsecuritysetting>
35
+ </children>
36
+ </config>
37
+ </children>
38
+ </system>
39
+ </children>
40
+ </admin>
41
+ </resources>
42
+ </acl>
43
+ </config>
app/code/community/CP/LoginSecurity/etc/config.xml ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * @category Commerce Pundit Technologies
17
+ * @package CP_LoginSecurity
18
+ * @copyright Copyright (c) 2015 Commerce Pundit Technologies. (http://www.commercepundit.com)
19
+ * @author <<Dharmesh Hariyani>>
20
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
21
+ */
22
+ -->
23
+ <config>
24
+ <modules>
25
+ <CP_LoginSecurity>
26
+ <version>1.0.0</version>
27
+ </CP_LoginSecurity>
28
+ </modules>
29
+ <global>
30
+ <helpers>
31
+ <cp_loginsecurity>
32
+ <class>CP_LoginSecurity_Helper</class>
33
+ </cp_loginsecurity>
34
+ </helpers>
35
+ <models>
36
+ <cp_loginsecurity>
37
+ <class>CP_LoginSecurity_Model</class>
38
+ </cp_loginsecurity>
39
+ </models>
40
+ <events>
41
+ <http_response_send_before>
42
+ <observers>
43
+ <cp_loginsecurity_on_forgot_password>
44
+ <type>singleton</type>
45
+ <class>cp_loginsecurity/observer</class>
46
+ <method>loginsecurityOnPasswordChange</method>
47
+ </cp_loginsecurity_on_forgot_password>
48
+ </observers>
49
+ </http_response_send_before>
50
+
51
+ <customer_login>
52
+ <observers>
53
+ <cp_set_current_password>
54
+ <type>singleton</type>
55
+ <class>cp_loginsecurity/observer</class>
56
+ <method>setCurrentPassword</method>
57
+ </cp_set_current_password>
58
+ </observers>
59
+ </customer_login>
60
+
61
+ <controller_action_predispatch>
62
+ <observers>
63
+ <cp_error_message_print>
64
+ <type>singleton</type>
65
+ <class>cp_loginsecurity/observer</class>
66
+ <method>setErrorMessage</method>
67
+ </cp_error_message_print>
68
+ </observers>
69
+ </controller_action_predispatch>
70
+
71
+ </events>
72
+ </global>
73
+ </config>
app/code/community/CP/LoginSecurity/etc/system.xml ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * @category Commerce Pundit Technologies
17
+ * @package CP_LoginSecurity
18
+ * @copyright Copyright (c) 2015 Commerce Pundit Technologies. (http://www.commercepundit.com)
19
+ * @author <<Dharmesh Hariyani>>
20
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
21
+ */
22
+ -->
23
+ <config>
24
+ <tabs>
25
+ <cp translate="label">
26
+ <label>cp Extensions</label>
27
+ <sort_order>111</sort_order>
28
+ </cp>
29
+ </tabs>
30
+ <sections>
31
+ <loginsecuritysetting translate="label" module="cp_loginsecurity">
32
+ <label>Login Security Settings</label>
33
+ <tab>cp</tab>
34
+ <frontend_type>text</frontend_type>
35
+ <sort_order>0</sort_order>
36
+ <show_in_default>1</show_in_default>
37
+ <show_in_website>1</show_in_website>
38
+ <show_in_store>1</show_in_store>
39
+ <groups>
40
+ <login translate="label">
41
+ <label>Login Security Settings</label>
42
+ <frontend_type>text</frontend_type>
43
+ <sort_order>0</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
+ <enable translate="label">
49
+ <label>Enable</label>
50
+ <frontend_type>select</frontend_type>
51
+ <source_model>adminhtml/system_config_source_yesno</source_model>
52
+ <sort_order>0</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
+ </enable>
57
+ </fields>
58
+ </login>
59
+ </groups>
60
+ </loginsecuritysetting>
61
+ </sections>
62
+ </config>
app/etc/modules/CP_LoginSecurity.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <CP_LoginSecurity>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ </CP_LoginSecurity>
8
+ </modules>
9
+ </config>
package.xml ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>CP_LoginSecurity</name>
4
+ <version>0.0.1</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Customer Login Security</summary>
10
+ <description>&lt;b&gt;About the extension :&lt;/b&gt;&lt;br/&gt;&lt;br /&gt;&#xD;
11
+ LoginSecurity extension developed by Commercepundit provides Login Security that checks password on every page with your set password.if user is login in lets say Firefox browser and he has sent request to reset password from chrome browser and reset password successfully from chrome now if he will access any page from Firefox he will be logged out and will ask to login again with new password.With this customer will be logged out from every browser if password has been changed.&#xD;
12
+ &lt;ul&gt;&#xD;
13
+ &lt;li&gt;Easy to use&lt;/li&gt;&#xD;
14
+ &lt;li&gt;Checks Password every time you refresh page&lt;/li&gt;&#xD;
15
+ &lt;li&gt;Enable and add Disable from admin&lt;/li&gt;&#xD;
16
+ &lt;li&gt;Easy to install and manage.&lt;/li&gt;&#xD;
17
+ &lt;/ul&gt;</description>
18
+ <notes>Customer Login Security</notes>
19
+ <authors><author><name>Commerce Pundit</name><user>CPExtensions</user><email>magento@commercepundit.com</email></author></authors>
20
+ <date>2015-10-01</date>
21
+ <time>06:11:37</time>
22
+ <contents><target name="magecommunity"><dir name="CP"><dir name="LoginSecurity"><dir name="Helper"><file name="Data.php" hash="78b8225c957c0568ae561db21b5f0a34"/></dir><dir name="Model"><file name="Observer.php" hash="844834ef4e436ccb2ab5aeef505565e6"/></dir><dir name="etc"><file name="adminhtml.xml" hash="507861df98aee6c2f089526ddbe63954"/><file name="config.xml" hash="124979c89a7784470f6b34ae47a14235"/><file name="system.xml" hash="e567d94c90af668c942d728fdd351356"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="CP_LoginSecurity.xml" hash="ad97541daba24abc96f0596366dfad06"/></dir></target></contents>
23
+ <compatible/>
24
+ <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
25
+ </package>