Summary Files Commits Branches @commit @diff @stats
path: root / src / controllers / DashboardLoginController.php
diff options
context:
space:
mode:
Commitf8c1df9a9a24be0ff3811dc33e00f92bf51465ab (patch)
Author
 Kamen Mladenov <kamen.d.mladenov@protonmail.com>
2021-04-03 11:54:52 +0300
Committer
 GitHub <noreply@github.com>
2021-04-03 11:54:52 +0300
Files56dfbe9d57e3150b480928da543b3dba30e11692 /src/controllers/DashboardLoginController.php
devrix-job-board-f8c1df9a9a24be0ff3811dc33e00f92bf51465ab.tar
devrix-job-board-f8c1df9a9a24be0ff3811dc33e00f92bf51465ab.tar.gz
devrix-job-board-f8c1df9a9a24be0ff3811dc33e00f92bf51465ab.zip
Parentaa2e361c3114b53ac7858e118454b9dfaf51ebe4 (diff)
Parentfff8c08ad7f3845eb32671292392cbf08bb738c9 (diff)
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.php25
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";
+ }
+ }
+}