diff options
| author | Syndamia <kamen@syndamia.com> | 2025-02-02 12:34:53 +0200 |
|---|---|---|
| committer | Syndamia <kamen@syndamia.com> | 2025-02-02 12:34:53 +0200 |
| commit | c83d7e03b607447cb203c0a17edaca9baf1d087f (patch) | |
| tree | 7b64b824d54bd4ed7ec6fc5cbbc35616c384a02e /controllers/login.php | |
| parent | 254e643a4f74a8b499093b303b831d80de5464ea (diff) | |
| download | nowayforward_human-c83d7e03b607447cb203c0a17edaca9baf1d087f.tar nowayforward_human-c83d7e03b607447cb203c0a17edaca9baf1d087f.tar.gz nowayforward_human-c83d7e03b607447cb203c0a17edaca9baf1d087f.zip | |
feat(views): Move login and logout to session/create and session/delete
Diffstat (limited to 'controllers/login.php')
| -rw-r--r-- | controllers/login.php | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/controllers/login.php b/controllers/login.php deleted file mode 100644 index 179afe6..0000000 --- a/controllers/login.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php -namespace Controller; -use Database; -use Exception; - -function on_post() { - global $user_status; - global $token; - $user_status = ""; - - try { - $user = Database\User::fromDB($_POST["username"]); - if (password_verify($_POST["password"], $user->Password)) { - $token = Database\Cookie::create($user->UID); - } - else { - $user_status = "Incorrect password!"; - } - } - catch(Exception $e) { - $user_status = "User \"" . $_POST["username"] . "\" doesn't exist!"; - } -} - -function on_delete() { - global $TOKEN; - try { - Database\Cookie::delete($TOKEN); - } - catch(Exception $e) {} -} |
