Summary Files Commits Branches @commit @diff @stats
path: root / src / controllers / DashboardLoginController.php
diff options
context:
space:
mode:
1 files changed, 7 insertions, 4 deletions
-rw-r--r--src/controllers/DashboardLoginController.php11
diff --git a/src/controllers/DashboardLoginController.php b/src/controllers/DashboardLoginController.php
index fe2009b..c6ac070 100644
--- a/src/controllers/DashboardLoginController.php
+++ b/src/controllers/DashboardLoginController.php
@@ -6,20 +6,23 @@ class DashboardLoginController extends BaseController {
private static $message;
public static function get() {
- include "views/dashboard-login.php";
+ include('views/dashboard-login.php');
}
public static function post() {
+ // The dashboard(controller) doesn't have it's own URI (and all requests are sent in this controller), so
+ // we can't send a request directly to dashboard.
+ // This does compromise security, but for now it will have to do.
if (isset($_POST['_method'])) {
DashboardController::invoke();
}
- else if ($_POST['username'] == "admin" && $_POST['password'] == "admin") {
+ else if ($_POST['username'] == 'admin' && $_POST['password'] == 'admin') {
// Load normal dashboard
DashboardController::get();
}
else {
- self::$message = "Bad credentials!";
- include "views/dashboard-login.php";
+ self::$message = 'Bad credentials!';
+ include('views/dashboard-login.php');
}
}
}