diff options
Merge pull request #1 from Syndamia/dev v0.1
Implemented main functionality
1 files changed, 25 insertions, 0 deletions
| -rw-r--r-- | src/controllers/DashboardLoginController.php | 25 |
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"; + } + } +} |
