intell_customers - Version 1.0.0.1

Version Notes

New

Download this release

Release Info

Developer Amatya Trivedi
Extension intell_customers
Version 1.0.0.1
Comparing to
See all releases


Version 1.0.0.1

app/code/local/Intell/Customer/Helper/Data.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Intell_Customer_Helper_Data extends Mage_Core_Helper_Abstract
4
+ {
5
+
6
+ }
app/code/local/Intell/Customer/controllers/AccountController.php ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require_once 'Mage/Customer/controllers/AccountController.php';
4
+ class Intell_Customer_AccountController extends Mage_Customer_AccountController
5
+ {
6
+
7
+ public function indexAction()
8
+ {
9
+ //echo "Hello";die;
10
+ $this->loadLayout();
11
+ $this->_initLayoutMessages('customer/session');
12
+ $this->_initLayoutMessages('catalog/session');
13
+
14
+ $this->getLayout()->getBlock('content')->append(
15
+ $this->getLayout()->createBlock('customer/account_dashboard')
16
+ );
17
+ $this->getLayout()->getBlock('head')->setTitle($this->__('My Account'));
18
+ $this->renderLayout();
19
+ }
20
+
21
+ /**
22
+ * Login post action
23
+ */
24
+ public function loginPostAction()
25
+ {
26
+ if ($this->_getSession()->isLoggedIn()) {
27
+ $this->_redirect('*/*/');
28
+ return;
29
+ }
30
+ $session = $this->_getSession();
31
+
32
+ //checking is it from checkout
33
+ $session->setCustomerRedirectFlag(0);
34
+ $context = $this->getRequest()->getPost('context');
35
+ $customerAlwaysRedirectToUrl = Mage::getStoreConfig('customer/customerredirect/always');
36
+ if((!$customerAlwaysRedirectToUrl)){
37
+ $session->setCustomerRedirectFlag(1);
38
+ }
39
+
40
+ if ($this->getRequest()->isPost()) {
41
+ $login = $this->getRequest()->getPost('login');
42
+ if (!empty($login['username']) && !empty($login['password'])) {
43
+ try {
44
+ $session->login($login['username'], $login['password']);
45
+ if ($session->getCustomer()->getIsJustConfirmed()) {
46
+ $this->_welcomeCustomer($session->getCustomer(), true);
47
+ }
48
+ } catch (Mage_Core_Exception $e) {
49
+ switch ($e->getCode()) {
50
+ case Mage_Customer_Model_Customer::EXCEPTION_EMAIL_NOT_CONFIRMED:
51
+ $value = Mage::helper('customer')->getEmailConfirmationUrl($login['username']);
52
+ $message = Mage::helper('customer')->__('This account is not confirmed. <a href="%s">Click here</a> to resend confirmation email.', $value);
53
+ break;
54
+ case Mage_Customer_Model_Customer::EXCEPTION_INVALID_EMAIL_OR_PASSWORD:
55
+ $message = $e->getMessage();
56
+ break;
57
+ default:
58
+ $message = $e->getMessage();
59
+ }
60
+ $session->addError($message);
61
+ $session->setUsername($login['username']);
62
+ } catch (Exception $e) {
63
+ // Mage::logException($e); // PA DSS violation: this exception log can disclose customer password
64
+ }
65
+ } else {
66
+ $session->addError($this->__('Login and password are required.'));
67
+ }
68
+ }
69
+
70
+ $this->_loginPostRedirect();
71
+ }
72
+
73
+
74
+ protected function _loginPostRedirect()
75
+ {
76
+ //customer session
77
+ $session = $this->_getSession();
78
+ $preUrl = $session->getBeforeAuthUrl(true);
79
+
80
+ $cusromerRedirectStatus = Mage::getStoreConfig('customer/customerredirect/active');
81
+ $customerRedirectUrl = Mage::getStoreConfig('customer/customerredirect/redirecturl');
82
+
83
+ $redirectUrl = $preUrl;
84
+ if(($cusromerRedirectStatus) && ($customerRedirectUrl) && ($session->getCustomerRedirectFlag()) && (strpos($preUrl, 'checkout/onepage') == '')){
85
+ $redirectUrl = Mage::getUrl().$customerRedirectUrl;
86
+ }
87
+
88
+ if(($cusromerRedirectStatus) && ($customerRedirectUrl) && (!$session->getCustomerRedirectFlag())){
89
+ $redirectUrl = Mage::getUrl().$customerRedirectUrl;
90
+ }
91
+
92
+ if ($this->_getSession()->isLoggedIn()) {
93
+ $this->_redirectUrl($redirectUrl);
94
+ return;
95
+ }
96
+
97
+ $this->_redirectUrl($preUrl);
98
+ }
99
+ }
app/code/local/Intell/Customer/etc/config.xml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Intell_Customer>
5
+ <version>1.1.0</version>
6
+ </Intell_Customer>
7
+ </modules>
8
+ <frontend>
9
+ <routers>
10
+ <customer>
11
+ <args>
12
+ <modules>
13
+ <intell_customer before="Mage_Customer">Intell_Customer</intell_customer>
14
+ </modules>
15
+ </args>
16
+ </customer>
17
+ </routers>
18
+ </frontend>
19
+ <global>
20
+ <helpers>
21
+ <intell>
22
+ <class>Intell_Customer_Helper</class>
23
+ </intell>
24
+ </helpers>
25
+ </global>
26
+ </config>
app/code/local/Intell/Customer/etc/system.xml ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <sections>
4
+ <customer translate="label" module="customer">
5
+ <class>separator-top</class>
6
+ <label>Customer Configuration</label>
7
+ <tab>customer</tab>
8
+ <sort_order>130</sort_order>
9
+ <show_in_default>1</show_in_default>
10
+ <show_in_website>1</show_in_website>
11
+ <show_in_store>1</show_in_store>
12
+ <groups>
13
+ <customerredirect translate="label">
14
+ <label>Customer After Login Redirect</label>
15
+ <frontend_type>text</frontend_type>
16
+ <sort_order>10</sort_order>
17
+ <show_in_default>1</show_in_default>
18
+ <show_in_website>1</show_in_website>
19
+ <show_in_store>1</show_in_store>
20
+ <fields>
21
+ <active translate="label">
22
+ <label>Enable</label>
23
+ <frontend_type>select</frontend_type>
24
+ <source_model>adminhtml/system_config_source_yesno</source_model>
25
+ <sort_order>10</sort_order>
26
+ <show_in_default>1</show_in_default>
27
+ <show_in_website>1</show_in_website>
28
+ <show_in_store>1</show_in_store>
29
+ </active>
30
+ <always translate="label">
31
+ <label>Always Redirect</label>
32
+ <frontend_type>select</frontend_type>
33
+ <source_model>adminhtml/system_config_source_yesno</source_model>
34
+ <sort_order>10</sort_order>
35
+ <show_in_default>1</show_in_default>
36
+ <show_in_website>1</show_in_website>
37
+ <show_in_store>1</show_in_store>
38
+ </always>
39
+ <redirecturl translate="label">
40
+ <label>Redirect Url</label>
41
+ <frontend_type>text</frontend_type>
42
+ <sort_order>20</sort_order>
43
+ <show_in_default>1</show_in_default>
44
+ <show_in_website>1</show_in_website>
45
+ <show_in_store>1</show_in_store>
46
+ <comment><![CDATA[Put url in format : customer/account]]></comment>
47
+ </redirecturl>
48
+ </fields>
49
+ </customerredirect>
50
+ </groups>
51
+ </customer>
52
+ </sections>
53
+ </config>
app/etc/modules/Intell_Customer.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Intell_Customer>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ </Intell_Customer>
8
+ </modules>
9
+ </config>
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>intell_customers</name>
4
+ <version>1.0.0.1</version>
5
+ <stability>stable</stability>
6
+ <license>OSL v3.0</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>intell_customers</summary>
10
+ <description>intell_customers</description>
11
+ <notes>New</notes>
12
+ <authors><author><name>Amatya</name><user>amatya</user><email>amatya@intelligrape.com</email></author></authors>
13
+ <date>2012-10-12</date>
14
+ <time>23:03:12</time>
15
+ <contents><target name="magelocal"><dir name="Intell"><dir name="Customer"><dir name="Helper"><file name="Data.php" hash="3460d09c280451e9ebb600027b8c4d45"/></dir><dir name="controllers"><file name="AccountController.php" hash="bc9e00e3a51351a1e4b08cb8cb8b952c"/></dir><dir name="etc"><file name="config.xml" hash="dbd42c0c046bda42167199fe737f5114"/><file name="system.xml" hash="962e9def28bec46251d7d58a6359d0d9"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Intell_Customer.xml" hash="6a464e604ee4e082b93385c59f8f9d24"/></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
+ </package>