Compare commits
No commits in common. "fdb02b051cf8831b2ea36c89489cda7fd7faacf3" and "a0f2edd4c690e7eeb1af16f16e739549f4fb4498" have entirely different histories.
fdb02b051c
...
a0f2edd4c6
@ -31,19 +31,11 @@ class UserController{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function showUserRegisterForm(){
|
public function showUserRegisterForm(){
|
||||||
if (!isset($this->errors)) {
|
|
||||||
$this->errors = [];
|
|
||||||
}
|
|
||||||
if (!isset($this->validData)) {
|
|
||||||
$this->validData = [];
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->view->setVars([
|
$this->view->setVars([
|
||||||
'labels' => $this->labels,
|
'labels' => $this->labels,
|
||||||
'errors' => $this->errors,
|
'errors' => $this->errors,
|
||||||
'validData' => $this->validData
|
'validData' => $this->validData
|
||||||
]);
|
]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function showUserRegisterConfirmation(){
|
public function showUserRegisterConfirmation(){
|
||||||
@ -106,16 +98,9 @@ class UserController{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function register(){
|
public function register(){
|
||||||
$this->validateForm();
|
|
||||||
|
|
||||||
if(count($this->errors) > 0){
|
|
||||||
$this->view->setDoMethodName("showUserRegisterForm");
|
|
||||||
$this->showUserRegisterForm();
|
|
||||||
} else{
|
|
||||||
$this->db->createUser($_POST);
|
$this->db->createUser($_POST);
|
||||||
$this->login();
|
$this->login();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public function login(){
|
public function login(){
|
||||||
$user = $this->db->getUserByEmail($_POST["email"]);
|
$user = $this->db->getUserByEmail($_POST["email"]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user