Public Member Functions | |
preDispatch () | |
indexAction () | |
saveAction () |
Definition at line 35 of file ManageController.php.
indexAction | ( | ) |
Definition at line 50 of file ManageController.php.
00051 { 00052 $this->loadLayout(); 00053 $this->_initLayoutMessages('customer/session'); 00054 $this->_initLayoutMessages('catalog/session'); 00055 00056 if ($block = $this->getLayout()->getBlock('customer_newsletter')) { 00057 $block->setRefererUrl($this->_getRefererUrl()); 00058 } 00059 $this->getLayout()->getBlock('head')->setTitle($this->__('Newsletter Subscription')); 00060 $this->renderLayout(); 00061 }
preDispatch | ( | ) |
Action predispatch
Check customer authentication for some actions
Reimplemented from Mage_Core_Controller_Front_Action.
Definition at line 42 of file ManageController.php.
00043 { 00044 parent::preDispatch(); 00045 if (!Mage::getSingleton('customer/session')->authenticate($this)) { 00046 $this->setFlag('', 'no-dispatch', true); 00047 } 00048 }
saveAction | ( | ) |
Definition at line 63 of file ManageController.php.
00064 { 00065 if (!$this->_validateFormKey()) { 00066 return $this->_redirect('customer/account/'); 00067 } 00068 try { 00069 Mage::getSingleton('customer/session')->getCustomer() 00070 ->setStoreId(Mage::app()->getStore()->getId()) 00071 ->setIsSubscribed((boolean)$this->getRequest()->getParam('is_subscribed', false)) 00072 ->save(); 00073 Mage::getSingleton('customer/session')->addSuccess($this->__('The subscription was successfully saved')); 00074 } 00075 catch (Exception $e) { 00076 Mage::getSingleton('customer/session')->addError($this->__('There was an error while saving your subscription')); 00077 } 00078 $this->_redirect('customer/account/'); 00079 }