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