blob: 8c1cc6794a99b7a343b4e5b0ca8bdc444e0fdad3 (
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
|
<?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";
}
}
}
|