diff options
Diffstat (limited to '_site/includes/modules/admin.php')
-rw-r--r-- | _site/includes/modules/admin.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/_site/includes/modules/admin.php b/_site/includes/modules/admin.php new file mode 100644 index 0000000..099ea00 --- /dev/null +++ b/_site/includes/modules/admin.php @@ -0,0 +1,17 @@ +<?php
+$admin = true;
+if (!isset($_COOKIE["ADMIN_TOKEN"])) {
+ $admin = false;
+ if (isset($__ADMIN)) header("Location: /admin/offline") and die();
+} else {
+ if (!(strpos("/", $_COOKIE['ADMIN_TOKEN']) === false && strpos(".", $_COOKIE['ADMIN_TOKEN']) === false && (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/admin/tokens/" . $_COOKIE['ADMIN_TOKEN']) || file_exists("/mnt/minteckrolt-main/admin/private/tokens/" . $_COOKIE['ADMIN_TOKEN'])))) {
+ $admin = false;
+ if (isset($__ADMIN)) header("Location: /admin/offline") and die();
+ } else {
+ if (file_exists("/mnt/minteckrolt-main/admin/private/tokens/" . $_COOKIE['ADMIN_TOKEN'])) {
+ $_USER = trim(file_get_contents("/mnt/minteckrolt-main/admin/private/tokens/" . $_COOKIE['ADMIN_TOKEN']));
+ } else {
+ $_USER = trim(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/admin/tokens/" . $_COOKIE['ADMIN_TOKEN']));
+ }
+ }
+}
\ No newline at end of file |