public function secondFormAction() { $this->_helper->layout->setLayout('second_form'); $this->view->headTitle('שאלון רפואי'); $email = $this->getRequest()->getParam('email'); $emailValidation = new System_Model_SystemEmailValidation(); $userId = $emailValidation->getId($email); if (!isset($email)) { echo "Access denied!"; } else { $this->view->email = $email; $userSecondForm = new User_Form_UserSecondForm(); $this->view->form = $userSecondForm; if ($this->getRequest()->getParam('submit')) { if (!$userSecondForm->isValid($_POST)) { $this->view->form = $userSecondForm; } else { // success $username = $emailValidation->getNameByEmail($email); //$emailValidation->sendWelcomeMail($email,$username,$userId); $values = $userSecondForm->getValues(); $user = new User_Model_UserHealthTable(); $user->addAdditionalData($userId, $values); $auth = Zend_Auth::getInstance(); $auth->getStorage()->write(array('u_email' => $email, 'u_id' => $userId)); $mailExchange = new Student_Model_MailExchange(); //$text = "New <a href='/teacher/dashboard/view-student/stid/$userId/'>user</a> was registered"; $mailExchange->sendNewUserInformation($userId); $this->_redirect("/student/profile/my-profile/"); } } else { $this->view->form = $userSecondForm; } } }