Summary Files Commits Branches @commit @diff @stats
path: root / src / controllers / DashboardLoginController.php
blob: af1113e40e0dd8eae49ab18e8418277c8e9cbac2 (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');
		}
	}
}