aboutsummaryrefslogtreecommitdiff
path: root/controllers/login.php
diff options
context:
space:
mode:
Diffstat (limited to 'controllers/login.php')
-rw-r--r--controllers/login.php31
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) {}
-}