aboutsummaryrefslogtreecommitdiff
path: root/_site/includes/modules/admin.php
blob: 099ea00658febc4643bb0b1565973f9daff8d045 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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']));
        }
    }
}