Summary Files Commits Branches @commit @diff @stats
path: root / src / controllers / DashboardLoginController.php
diff options
context:
space:
mode:
1 files changed, 24 insertions, 0 deletions
-rw-r--r--src/controllers/DashboardLoginController.php24
diff --git a/src/controllers/DashboardLoginController.php b/src/controllers/DashboardLoginController.php
new file mode 100644
index 0000000..8c1cc67
--- /dev/null
+++ b/src/controllers/DashboardLoginController.php
@@ -0,0 +1,24 @@
+<?php
+include_once('controllers/BaseController.php');
+include_once('controllers/DashboardController.php');
+
+class DashboardLoginController extends BaseController {
+ private static $message;
+
+ public static function get() {
+ include "views/dashboard-login.php";
+ }
+
+ public static function post() {
+ if ($_POST['username'] == "admin" && $_POST['password'] == "admin") {
+ // Probably a bad practice, but couldn't find if it is
+ $_SERVER['REQUEST_METHOD'] = "GET";
+ // Load normal dashboard
+ DashboardController::invoke();
+ }
+ else {
+ self::$message = "Bad credentials!";
+ include "views/dashboard-login.php";
+ }
+ }
+}