public function signupAction() { $users = new PAP_Model_User(); $form = new PAP_Form_RegistrationForm(); $this->view->form = $form; 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."; $form->addError("Password and confirm password don't match."); return; } if ($users->checkUnique($data['email'])) { $form->addError("Email already taken. Please choose another one."); return; } unset($data['confirmPassword']); $data["priceRuleId"] = 1; $data["status"] = 'pending'; $data["rol"] = 2; //1:reseler, 2:customer, 3:admin $users->insert($data); $this->sendValidationEmail($data['email']); $this->_redirect('auth/showvalidationmessage'); } } }