Compare commits

..

No commits in common. "5eb3e30114473addd696295a2a49c3da0e5ae565" and "95b763490124aec5e4adaf2e01572eb94a42f766" have entirely different histories.

2 changed files with 9 additions and 9 deletions

View File

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

View File

@ -50,7 +50,7 @@ class UserModel extends Database
if (!preg_match('/[^A-Za-z0-9]/', $password)) $errors[] = "Password needs a special character."; if (!preg_match('/[^A-Za-z0-9]/', $password)) $errors[] = "Password needs a special character.";
if (!empty($errors)) { if (!empty($errors)) {
return ['success' => false, 'message' => implode("\\n", $errors)]; return ['success' => false, 'message' => "<ul><li>" . implode("</li><li>", $errors) . "</li></ul>"];
} }
try { try {