Summary Files Commits Branches @commit @diff @stats
path: root / src / controllers / DashboardLoginController.php
blob: fe2009bde861f6659f2a46e5dd5b3aae8c5e22e0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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";
		}
	}
}