Summary Files Commits Branches @commit @diff @stats
path: root / src / controllers / DashboardLoginController.php
diff options
context:
space:
mode:
1 files changed, 25 insertions, 0 deletions
-rw-r--r--src/controllers/DashboardLoginController.php25
diff --git a/src/controllers/DashboardLoginController.php b/src/controllers/DashboardLoginController.php
new file mode 100644
index 0000000..fe2009b
--- /dev/null
+++ b/src/controllers/DashboardLoginController.php
@@ -0,0 +1,25 @@
+<?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 (isset($_POST['_method'])) {
+ DashboardController::invoke();
+ }
+ else if ($_POST['username'] == "admin" && $_POST['password'] == "admin") {
+ // Load normal dashboard
+ DashboardController::get();
+ }
+ else {
+ self::$message = "Bad credentials!";
+ include "views/dashboard-login.php";
+ }
+ }
+}