vdgmage_chromeloginfix - Version 1.0.0

Version Notes

- Support for session HTTP
- Support for session secure
- Support for session domain
- Support for session lifetime
- Ability to disable the whole module
- Ability to only enable if the request browser is Google Chrome

Download this release

Release Info

Developer Daniel van der Garde
Extension vdgmage_chromeloginfix
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

app/code/community/VDGMage/ChromeLoginFix/Helper/data.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+ class VDGMage_ChromeLoginFix_Helper_Data extends Mage_Core_Helper_Abstract
3
+ {
4
+ //just sitting here
5
+ }
app/code/community/VDGMage/ChromeLoginFix/Model/Cookie.php ADDED
@@ -0,0 +1,141 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class VDGMage_ChromeLoginFix_Model_Cookie extends Mage_Core_Model_Cookie
4
+ {
5
+ public $store;
6
+ public $requestBrowserIsChrome = false;
7
+
8
+ private $_fixEnabled = 0;
9
+ private $_fixEnabledDomain = 0;
10
+ private $_fixEnabledHttp = 0;
11
+ private $_fixEnabledSecure = 0;
12
+ private $_fixEnabledLifetime = 0;
13
+ private $_fixOnlyForChrome = 0;
14
+ private $_canRun = false;
15
+
16
+ public function __construct()
17
+ {
18
+ $this->store = $this->getStore();
19
+
20
+ $this->_fixEnabled = Mage::getStoreConfig(
21
+ 'chromeloginfix/chromeloginfix_general/chromeloginfix_enable',
22
+ $this->store
23
+ );
24
+
25
+ //don't get other settings if fix isn't enabled
26
+ if($this->_fixEnabled == 1){
27
+ $this->_fixEnabledDomain = Mage::getStoreConfig(
28
+ 'chromeloginfix/chromeloginfix_general/chromeloginfix_enable_domain',
29
+ $this->store
30
+ );
31
+
32
+ $this->_fixEnabledHttp = Mage::getStoreConfig(
33
+ 'chromeloginfix/chromeloginfix_general/chromeloginfix_enable_http',
34
+ $this->store
35
+ );
36
+
37
+ $this->_fixEnabledSecure = Mage::getStoreConfig(
38
+ 'chromeloginfix/chromeloginfix_general/chromeloginfix_enable_secure',
39
+ $this->store
40
+ );
41
+
42
+ $this->_fixEnabledLifetime = Mage::getStoreConfig(
43
+ 'chromeloginfix/chromeloginfix_general/chromeloginfix_enable_lifetime',
44
+ $this->store
45
+ );
46
+
47
+ $this->_fixOnlyForChrome = Mage::getStoreConfig(
48
+ 'chromeloginfix/chromeloginfix_general/chromeloginfix_enable_chrome_only',
49
+ $this->store
50
+ );
51
+
52
+ $this->requestBrowserIsChrome = $this->requestBrowserIsChrome();
53
+
54
+ //check if fix should be used
55
+ if($this->_fixEnabled){
56
+ if($this->_fixOnlyForChrome){
57
+ if($this->requestBrowserIsChrome){
58
+ //browser is chrome
59
+ $this->_canRun = true;
60
+ } else {
61
+ //browser is not chrome
62
+ $this->_canRun = false;
63
+ }
64
+ } else {
65
+ //fix is enabled without restrictions
66
+ $this->_canRun = true;
67
+ }
68
+ } else {
69
+ //fix is disabled
70
+ $this->_canRun = false;
71
+ }
72
+ }
73
+ }
74
+
75
+ /**
76
+ * Retrieve Config Domain for cookie
77
+ *
78
+ * @return string
79
+ */
80
+ public function getConfigDomain()
81
+ {
82
+ if($this->_canRun == true && $this->_fixEnabledDomain == 1){
83
+ return '';
84
+ }
85
+
86
+ return parent::getConfigDomain();
87
+ }
88
+
89
+ /**
90
+ * Retrieve use HTTP only flag
91
+ *
92
+ * @return bool
93
+ */
94
+ public function getHttponly()
95
+ {
96
+ if($this->_canRun == true && $this->_fixEnabledHttp == 1){
97
+ return false;
98
+ }
99
+
100
+ return parent::getHttponly();
101
+ }
102
+
103
+ /**
104
+ * Is https secure request
105
+ * Use secure on adminhtml only
106
+ *
107
+ * @return bool
108
+ */
109
+ public function isSecure()
110
+ {
111
+ if($this->_canRun == true && $this->_fixEnabledSecure == 1){
112
+ return false;
113
+ }
114
+
115
+ return parent::isSecure();
116
+ }
117
+
118
+ /**
119
+ * Retrieve cookie lifetime
120
+ *
121
+ * @return int
122
+ */
123
+ public function getLifetime()
124
+ {
125
+ if($this->_canRun == true && $this->_fixEnabledLifetime == 1){
126
+ return 86400;
127
+ }
128
+
129
+ return parent::getLifetime();
130
+ }
131
+
132
+ public function requestBrowserIsChrome()
133
+ {
134
+ $userAgent = $_SERVER['HTTP_USER_AGENT'];
135
+ if(preg_match('/Chrome/i', $userAgent)) {
136
+ return true;
137
+ } else {
138
+ return false;
139
+ }
140
+ }
141
+ }
app/code/community/VDGMage/ChromeLoginFix/etc/config.xml ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <VDGMage_ChromeLoginFix>
5
+ <version>1.0</version>
6
+ </VDGMage_ChromeLoginFix>
7
+ </modules>
8
+ <global>
9
+ <models>
10
+ <core>
11
+ <rewrite>
12
+ <cookie>VDGMage_ChromeLoginFix_Model_Cookie</cookie>
13
+ </rewrite>
14
+ </core>
15
+ </models>
16
+ <helpers>
17
+ <vdgmage_chromeloginfix>
18
+ <class>VDGMage_ChromeLoginFix_Helper</class>
19
+ </vdgmage_chromeloginfix>
20
+ </helpers>
21
+ </global>
22
+ <adminhtml>
23
+ <acl>
24
+ <resources>
25
+ <all>
26
+ <title>Allow Everything</title>
27
+ </all>
28
+ <admin>
29
+ <children>
30
+ <system>
31
+ <children>
32
+ <config>
33
+ <children>
34
+ <chromeloginfix>
35
+ <title>ChromeLoginFix - All</title>
36
+ </chromeloginfix>
37
+ </children>
38
+ </config>
39
+ </children>
40
+ </system>
41
+ </children>
42
+ </admin>
43
+ </resources>
44
+ </acl>
45
+ </adminhtml>
46
+ <default>
47
+ <chromeloginfix>
48
+ <chromeloginfix_general>
49
+ <chromeloginfix_enable>1</chromeloginfix_enable>
50
+ <chromeloginfix_enable_http>1</chromeloginfix_enable_http>
51
+ <chromeloginfix_enable_secure>0</chromeloginfix_enable_secure>
52
+ <chromeloginfix_enable_domain>0</chromeloginfix_enable_domain>
53
+ <chromeloginfix_enable_lifetime>0</chromeloginfix_enable_lifetime>
54
+ <chromeloginfix_enable_chrome_only>1</chromeloginfix_enable_chrome_only>
55
+ </chromeloginfix_general>
56
+ </chromeloginfix>
57
+ </default>
58
+ </config>
app/code/community/VDGMage/ChromeLoginFix/etc/system.xml ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <tabs>
4
+ <vdgmage translate="label" module="vdgmage_chromeloginfix">
5
+ <label>VDG Mage</label>
6
+ <sort_order>100</sort_order>
7
+ </vdgmage>
8
+ </tabs>
9
+ <sections>
10
+ <chromeloginfix translate="label" module="vdgmage_chromeloginfix">
11
+ <label>ChromeLoginFix</label>
12
+ <tab>vdgmage</tab>
13
+ <sort_order>1000</sort_order>
14
+ <show_in_default>1</show_in_default>
15
+ <show_in_website>1</show_in_website>
16
+ <show_in_store>1</show_in_store>
17
+
18
+ <groups>
19
+ <chromeloginfix_general translate="label" module="vdgmage_chromeloginfix">
20
+ <comment><![CDATA[
21
+ <div class="box">
22
+ <p>
23
+ <b>ChromeLoginFix v1.0 | provided by <a href="http://www.vdgmage.com">VDG Mage | Magento modules</a></b>
24
+ </p>
25
+ For documentation and support visit <a href="http://vdgmage.zendesk.com">vdgmage.zendesk.com</a> or contact: <a href="mailto:support@vdgmage.zendesk.com">support@vdgmage.zendesk.com</a>
26
+ </div>
27
+ ]]></comment>
28
+ <label>General</label>
29
+ <frontend_type>text</frontend_type>
30
+ <sort_order>1000</sort_order>
31
+ <show_in_default>1</show_in_default>
32
+ <show_in_website>1</show_in_website>
33
+ <show_in_store>1</show_in_store>
34
+
35
+ <fields>
36
+ <chromeloginfix_enable translate="label">
37
+ <label>Enable ChromeLoginFix</label>
38
+ <comment>Completely enable or disable ChromeLoginFix</comment>
39
+ <frontend_type>select</frontend_type>
40
+ <sort_order>10</sort_order>
41
+ <show_in_default>1</show_in_default>
42
+ <show_in_website>1</show_in_website>
43
+ <show_in_store>1</show_in_store>
44
+ <source_model>adminhtml/system_config_source_yesno</source_model>
45
+ </chromeloginfix_enable>
46
+ <chromeloginfix_enable_http translate="label">
47
+ <label>Enable 'HTTP' fix</label>
48
+ <comment>This wil probably already solve your problem</comment>
49
+ <frontend_type>select</frontend_type>
50
+ <sort_order>20</sort_order>
51
+ <show_in_default>1</show_in_default>
52
+ <show_in_website>1</show_in_website>
53
+ <show_in_store>1</show_in_store>
54
+ <source_model>adminhtml/system_config_source_yesno</source_model>
55
+ </chromeloginfix_enable_http>
56
+ <chromeloginfix_enable_secure translate="label">
57
+ <label>Enable 'secure' fix</label>
58
+ <comment>Enable if you have HTTPS</comment>
59
+ <frontend_type>select</frontend_type>
60
+ <sort_order>30</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
+ <source_model>adminhtml/system_config_source_yesno</source_model>
65
+ </chromeloginfix_enable_secure>
66
+ <chromeloginfix_enable_domain translate="label">
67
+ <label>Enable 'domain' fix</label>
68
+ <comment>Enable if you are not working on localhost</comment>
69
+ <frontend_type>select</frontend_type>
70
+ <sort_order>40</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
+ <source_model>adminhtml/system_config_source_yesno</source_model>
75
+ </chromeloginfix_enable_domain>
76
+ <chromeloginfix_enable_lifetime translate="label">
77
+ <label>Enable 'lifetime' fix</label>
78
+ <comment>Enable this when you customers can't add products to there carts</comment>
79
+ <frontend_type>select</frontend_type>
80
+ <sort_order>50</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
+ <source_model>adminhtml/system_config_source_yesno</source_model>
85
+ </chromeloginfix_enable_lifetime>
86
+ <chromeloginfix_enable_chrome_only translate="label">
87
+ <label>Only for Chrome</label>
88
+ <comment>Enable this to apply the selected fixes only on Chrome browsers</comment>
89
+ <frontend_type>select</frontend_type>
90
+ <sort_order>50</sort_order>
91
+ <show_in_default>1</show_in_default>
92
+ <show_in_website>1</show_in_website>
93
+ <show_in_store>1</show_in_store>
94
+ <source_model>adminhtml/system_config_source_yesno</source_model>
95
+ </chromeloginfix_enable_chrome_only>
96
+ </fields>
97
+ </chromeloginfix_general>
98
+ <chromeloginfix_other translate="label" module="vdgmage_chromeloginfix">
99
+ <comment><![CDATA[
100
+ <div class="box">
101
+ <p>
102
+ I'm getting married April 17th 2015, so if you can't thank me enough, feel this module is way more worth or you are just feeling generous, feel free to support me for my big day!
103
+ </p>
104
+ <img border="0" src="http://tickers.TickerFactory.com/ezt/d/4;10773;484/st/20150417/e/Our+Wedding/dt/6/k/12ed/event.png" />
105
+ <a target="_blank" href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=CD8WLZE5ZVWL6&lc=US&item_name=Marriage%20April%2017%2c%202015&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donate_LG%2egif%3aNonHosted">
106
+ <img alt="PayPal - The safer, easier way to pay online!" border="0" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif" style="margin-bottom: 30px; margin-left: 30px;">
107
+ </a>
108
+ </div>
109
+ ]]></comment>
110
+ <label>Other</label>
111
+ <frontend_type>text</frontend_type>
112
+ <sort_order>10000</sort_order>
113
+ <show_in_default>1</show_in_default>
114
+ <show_in_website>1</show_in_website>
115
+ <show_in_store>1</show_in_store>
116
+ </chromeloginfix_other>
117
+ </groups>
118
+ </chromeloginfix>
119
+ </sections>
120
+ </config>
app/etc/modules/VDGMage_ChromeLoginFix.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <VDGMage_ChromeLoginFix>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ </VDGMage_ChromeLoginFix>
8
+ </modules>
9
+ </config>
package.xml ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>vdgmage_chromeloginfix</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://opensource.org/licenses/BSD-3-Clause">BSD license</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>This extension fixes an issue with logging in on the backend using Google Chrome.</summary>
10
+ <description>This extension overwrites some session settings if the request browser in the backend is Google Chrome.&#xD;
11
+ &#xD;
12
+ There are also some more settings to give you extended control over the session settings that blocks you from logging in with Google Chrome.</description>
13
+ <notes>- Support for session HTTP&#xD;
14
+ - Support for session secure&#xD;
15
+ - Support for session domain&#xD;
16
+ - Support for session lifetime&#xD;
17
+ - Ability to disable the whole module&#xD;
18
+ - Ability to only enable if the request browser is Google Chrome</notes>
19
+ <authors><author><name>Daniel van der Garde</name><user>DaanVDG</user><email>daniel@vdgmage.com</email></author></authors>
20
+ <date>2014-11-21</date>
21
+ <time>12:24:08</time>
22
+ <contents><target name="magecommunity"><dir name="VDGMage"><dir name="ChromeLoginFix"><dir name="Helper"><file name="data.php" hash="a0955322e2c9a068a9d8bf93589d675e"/></dir><dir name="Model"><file name="Cookie.php" hash="0e8c20c128400fe20ba8a45544723708"/></dir><dir name="etc"><file name="config.xml" hash="7950a8073c4e7b65bf9bcc6cb2208699"/><file name="system.xml" hash="7f683297f83b50001af398da30548547"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="VDGMage_ChromeLoginFix.xml" hash="de9efcd522abc873e790f40adae27ee9"/></dir></target></contents>
23
+ <compatible/>
24
+ <dependencies><required><php><min>5.3.0</min><max>5.6.0</max></php></required></dependencies>
25
+ </package>