This commit is contained in:
2025-06-23 11:13:48 +02:00
parent ba55304182
commit 3d4e1532c7
4 changed files with 93 additions and 7 deletions

View File

@@ -20,7 +20,7 @@ class UserController
public function loginUser()
{
$erg = array();
$erg = $this->userModel->verifyLogin($_POST["username"], $_POST["password"]);
$erg = $this->userModel->loginUser($_POST["username"], $_POST["password"]);
if ($erg["success"] == true) {
header("Location: ?controller=Welcome&do=showWelcome");
exit();
@@ -28,9 +28,9 @@ class UserController
}
else {
$this->view->setDoMethodName("showUserLoginForm");
$this->view->setVars([
"errmsg" => $erg["message"]
]);
## $this->view->setVars([
## "errmsg" => $erg["message"]
## ]);
$this->showUserLoginForm();
}
@@ -43,12 +43,36 @@ class UserController
exit();
}
public function registerUser()
{
$erg = array();
$erg = $this->userModel->registerUser($_POST["username"], $_POST["password"]);
if ($erg["success"] == true) {
header("Location: ?controller=Welcome&do=showWelcome");
exit();
}
else {
$this->view->setDoMethodName("showUserRegisterForm");
## $message = $erg['message'];
## echo "<script type='text/javascript'>alert('$message');</script>";
## $this->view->setVars([
## "errmsg" => $erg["message"]
## ]);
$this->showUserRegisterForm();
}
}
public function showUserLoginForm()
{
}
public function showUserRegisterForm()
{
}
}