This commit is contained in:
Alexey Berezhok
2024-03-19 22:05:27 +03:00
commit 346a50856b
1572 changed files with 182163 additions and 0 deletions

22
web/delete/web/cache/index.php vendored Normal file
View File

@@ -0,0 +1,22 @@
<?php
use function Hestiacp\quoteshellarg\quoteshellarg;
ob_start();
include $_SERVER["DOCUMENT_ROOT"] . "/inc/main.php";
// Check token
verify_csrf($_GET);
// Delete as someone else?
if ($_SESSION["userContext"] === "admin" && !empty($_GET["user"])) {
$user = quoteshellarg($_GET["user"]);
}
if (!empty($_GET["domain"])) {
$v_domain = quoteshellarg($_GET["domain"]);
exec(HESTIA_CMD . "v-purge-nginx-cache " . $user . " " . $v_domain, $output, $return_var);
check_return_code($return_var, $output);
}
$_SESSION["ok_msg"] = _("NGINX cache has been purged successfully.");
header("Location: /edit/web/?domain=" . $_GET["domain"]);
exit();

33
web/delete/web/index.php Normal file
View File

@@ -0,0 +1,33 @@
<?php
use function Hestiacp\quoteshellarg\quoteshellarg;
ob_start();
include $_SERVER["DOCUMENT_ROOT"] . "/inc/main.php";
// Check token
verify_csrf($_GET);
// Delete as someone else?
if ($_SESSION["userContext"] === "admin" && !empty($_GET["user"])) {
$user = quoteshellarg($user);
}
if (!empty($_GET["domain"])) {
$v_domain = quoteshellarg($_GET["domain"]);
exec(
HESTIA_CMD . "v-delete-web-domain " . $user . " " . $v_domain . " 'yes'",
$output,
$return_var,
);
check_return_code($return_var, $output);
unset($output);
}
$back = $_SESSION["back"];
if (!empty($back)) {
header("Location: " . $back);
exit();
}
header("Location: /list/web/");
exit();