Permalink
Browse files

Flesh out the previous commit regarding #37

  • Loading branch information...
Vinai committed Feb 1, 2014
1 parent e52c166 commit c4d0ed877f92b6babbedd3961b5a4fe0a54083ec
Showing with 11 additions and 4 deletions.
  1. +11 −4 app/code/community/Netzarbeiter/CustomerActivation/Model/Observer.php
@@ -402,18 +402,25 @@ protected function _addActivationStatusColumn(Mage_Adminhtml_Block_Customer_Grid
}
/**
- * In Magento 1.6 customer where logged in automatically by the lost password functionality
- * In Magento 1.7 and newer this was changed.
+ * Reportedly on Magento 1.6 customers are logged in automatically
+ * by the lost password functionality (must be some customization actually).
*
- * This fix removes the customer id from the customer/session in effect login him out again.
+ * This observer method removes the customer id from the customer/session,
+ * in effect causing a logout just in case.
*
* @param Varien_Event_Observer $observer
*/
public function controllerActionPostdispatchCustomerAccountResetPasswordPost(Varien_Event_Observer $observer)
{
+ if (Mage::getStoreConfig(self::XML_PATH_MODULE_DISABLED)) {
+ return;
+ }
if (version_compare(Mage::getVersion(), '1.7', '<')) {
$session = Mage::getSingleton('customer/session');
- $session->setCustomerId(null)->setId(null);
+ $customer = $session->getCustomer();
+ if (!$customer->getCustomerActivated() && $session->isLoggedIn()) {
+ $session->setCustomerId(null)->setId(null);
+ }
}
}

0 comments on commit c4d0ed8

Please sign in to comment.