aboutsummaryrefslogtreecommitdiff
path: root/admin/NeutronManage/index.php
blob: 0b10034b9076aa243fef67ad4ea1bc53f0f7f184 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php

$_OVERRIDEPERMISSION = "neutron";
require_once $_SERVER['DOCUMENT_ROOT'] . "/admin/private/header.sso.php";

if (isset($_GET['_']) && strpos($_GET['_'], "/") === false) {
    $arg = $_GET['_'];
} else {
    die();
}

$webs = scandir("/mnt/minteckrolt-cloud");

if (in_array($arg, $webs)) {
    $token = "madm-" . bin2hex(random_bytes(24));

    file_put_contents("/mnt/minteckrolt-cloud/" . $arg . "/data/tokens/" . $token, "");
    setcookie("_NEUTRON_ADMIN_TOKEN", $token, 0, "/", ".minteck.ro.lt", true, true);

    header("Location: https://cloud.minteck.ro.lt/" . $arg . "/cms-special/admin/#/home");
    die();
}

die("Unable to calculate data usage");