I want do something like this:
throw new Exception("The system was deactivated.");
public function authAction() {
$this->view->disable();
if ($this->request->isPost() == true) {
$this->request->getPost("user_name");
$this->request->getPost("user_password");
$o_user = \BtsUser::findFirst(array(
'userName = :userName: and password = :password:',
'bind' => array(
'userName' => $this->request->getPost("user_name"),
'password' => md5($this->request->getPost("user_password"))
)
));
if ($o_user === false) {
$this->flash->error("Incorrect credentials");
} else {
if (!$o_user->systemActive) {
throw new Exception("The system was deactivated."); // HOW DO THIS IN PHALCON?
}
$this->session->set("user-name", "Michael");
...
}
}
}