/** * send email with password */ public function forgotAction() { // init $status = array('success' => false, 'message' => 'user.forgot.unknown'); // try to load customer $customer = Object_Customer::getByEmail($this->getParam('email'), array('limit' => 1)); if ($customer) { // send email $status['success'] = true; $status['message'] = 'user.forgot.send'; } // send output if ($this->getRequest()->isXmlHttpRequest()) { $this->_helper->viewRenderer->setNoRender(true); $this->getResponse()->setHeader('Content-Type', 'application/json'); echo Zend_Json::encode($status); } else { $this->enableLayout(); $this->view->status = $status; } }