diff options
| author | Syndamia <kamen@syndamia.com> | 2025-01-26 14:04:11 +0200 |
|---|---|---|
| committer | Syndamia <kamen@syndamia.com> | 2025-01-26 14:04:11 +0200 |
| commit | bfa238c056f31f36c00faad1c5995cbb8af3bd26 (patch) | |
| tree | e35d6b33fff3e79ae905d7dad699134553a1292d /controllers/login.php | |
| parent | c36f74386bcbb19c13915fe3796cb757aa7d1845 (diff) | |
| download | nowayforward_human-bfa238c056f31f36c00faad1c5995cbb8af3bd26.tar nowayforward_human-bfa238c056f31f36c00faad1c5995cbb8af3bd26.tar.gz nowayforward_human-bfa238c056f31f36c00faad1c5995cbb8af3bd26.zip | |
feat!: Rework all views to be used with the router
Diffstat (limited to 'controllers/login.php')
| -rw-r--r-- | controllers/login.php | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/controllers/login.php b/controllers/login.php index 75c62ac..7502b03 100644 --- a/controllers/login.php +++ b/controllers/login.php @@ -1,9 +1,12 @@ <?php +namespace Controller; +use Database; +use Exception; function on_post() { - global $status; + global $user_status; global $token; - $status = ""; + $user_status = ""; try { $user = Database\User::fromDB($_POST["username"]); @@ -11,10 +14,10 @@ function on_post() { $token = Database\Cookie::create($user->UID); } else { - $status = "Incorrect password!"; + $user_status = "Incorrect password!"; } } catch(Exception $e) { - $status = "User \"" . $_POST["username"] . "\" doesn't exist!"; + $user_status = "User \"" . $_POST["username"] . "\" doesn't exist!"; } } |
