Exemplo n.º 1
0
 function terminateaccountAction()
 {
     $this->view->loginStatus = $this->isLoggedIn();
     $translate = Zend_Registry::get('Zend_Translate');
     $fitnessUserGeneral = new FitnessUserGeneral();
     $this->view->username = base64_decode($this->_request->getParam('Dbqs'));
     $sess = new Zend_Session_Namespace('UserSession');
     $userDetails = $fitnessUserGeneral->getUserbyUsername($sess->username);
     if ($this->_request->isPost()) {
         $terminateReason = $this->_request->getPost('terminate_reason');
         $username = $this->_request->getPost('username');
         $fitnessUserGeneral->terminateAccount($username);
         $message = "Hello,<br/><br/> The user " . $userDetails['user_first_name'] . " has terminated his/her account with fitness4.me. Below is the reason as given by the user:"******"*****@*****.**";
         $subject = "fitness4.me - Account Termination";
         //mail($to,$subject,$message,$headers);
         $mail = new Zend_Mail();
         $mail->setBodyHtml($message);
         $mail->setFrom($from, $userDetails['user_first_name']);
         $mail->addTo($to, "fitness4.me");
         $mail->setSubject($subject);
         $mail->send();
         //kill session and redirect user
         Zend_Session::destroy();
         $this->_redirect('/index/index');
     }
 }