aboutsummaryrefslogtreecommitdiff
path: root/_site/includes/modules/admin.php
diff options
context:
space:
mode:
authorMinteck <nekostarfan@gmail.com>2021-08-04 16:56:12 +0200
committerMinteck <nekostarfan@gmail.com>2021-08-04 16:56:12 +0200
commit896fa7c96856142f844d958b049d5432f511641c (patch)
treed8bbbe327939ade9bd13276c6b4c6105adf95323 /_site/includes/modules/admin.php
parent7df2fb3f5ee0ac5bd89e127c86ad0c2d6de126d1 (diff)
downloadunchainedtech-896fa7c96856142f844d958b049d5432f511641c.tar.gz
unchainedtech-896fa7c96856142f844d958b049d5432f511641c.tar.bz2
unchainedtech-896fa7c96856142f844d958b049d5432f511641c.zip
v2.0
Diffstat (limited to '_site/includes/modules/admin.php')
-rw-r--r--_site/includes/modules/admin.php17
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