Exemplo n.º 1
0
 public function registerAction()
 {
     $form = new Application_Form_RegistrationForm();
     $users = new Application_Model_Users();
     if ($this->getRequest()->isPost()) {
         if ($form->isValid($_POST)) {
             $data = $form->getValues();
             if ($data['password'] != $data['confirmPassword']) {
                 $this->view->errorMessage = "Password and confirm password don't match.";
                 return;
             }
             unset($data['confirmPassword']);
             $users->insert($data);
             $this->_redirect('authentification/login');
         }
     }
     $this->view->form = $form;
 }