Initial
This commit is contained in:
23
web/suspend/cron/index.php
Normal file
23
web/suspend/cron/index.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
use function Hestiacp\quoteshellarg\quoteshellarg;
|
||||
ob_start();
|
||||
include $_SERVER["DOCUMENT_ROOT"] . "/inc/main.php";
|
||||
|
||||
// Check token
|
||||
verify_csrf($_GET);
|
||||
|
||||
if (!empty($_GET["job"])) {
|
||||
$v_job = quoteshellarg($_GET["job"]);
|
||||
exec(HESTIA_CMD . "v-suspend-cron-job " . $user . " " . $v_job, $output, $return_var);
|
||||
check_return_code($return_var, $output);
|
||||
unset($output);
|
||||
}
|
||||
|
||||
$back = $_SESSION["back"];
|
||||
if (!empty($back)) {
|
||||
header("Location: " . $back);
|
||||
exit();
|
||||
}
|
||||
|
||||
header("Location: /list/cron/");
|
||||
exit();
|
||||
24
web/suspend/db/index.php
Normal file
24
web/suspend/db/index.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
use function Hestiacp\quoteshellarg\quoteshellarg;
|
||||
|
||||
ob_start();
|
||||
include $_SERVER["DOCUMENT_ROOT"] . "/inc/main.php";
|
||||
|
||||
// Check token
|
||||
verify_csrf($_GET);
|
||||
|
||||
if (!empty($_GET["database"])) {
|
||||
$v_database = quoteshellarg($_GET["database"]);
|
||||
exec(HESTIA_CMD . "v-suspend-database " . $user . " " . $v_database, $output, $return_var);
|
||||
check_return_code($return_var, $output);
|
||||
unset($output);
|
||||
}
|
||||
|
||||
$back = $_SESSION["back"];
|
||||
if (!empty($back)) {
|
||||
header("Location: " . $back);
|
||||
exit();
|
||||
}
|
||||
|
||||
header("Location: /list/db/");
|
||||
exit();
|
||||
52
web/suspend/dns/index.php
Normal file
52
web/suspend/dns/index.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
use function Hestiacp\quoteshellarg\quoteshellarg;
|
||||
|
||||
ob_start();
|
||||
include $_SERVER["DOCUMENT_ROOT"] . "/inc/main.php";
|
||||
|
||||
// Check token
|
||||
verify_csrf($_GET);
|
||||
|
||||
// DNS domain
|
||||
if (!empty($_GET["domain"]) && empty($_GET["record_id"])) {
|
||||
$v_domain = quoteshellarg($_GET["domain"]);
|
||||
exec(HESTIA_CMD . "v-suspend-dns-domain " . $user . " " . $v_domain, $output, $return_var);
|
||||
check_return_code($return_var, $output);
|
||||
unset($output);
|
||||
$back = $_SESSION["back"];
|
||||
if (!empty($back)) {
|
||||
header("Location: " . $back);
|
||||
exit();
|
||||
}
|
||||
header("Location: /list/dns/");
|
||||
exit();
|
||||
}
|
||||
|
||||
// DNS record
|
||||
if (!empty($_GET["domain"]) && !empty($_GET["record_id"])) {
|
||||
$v_domain = quoteshellarg($_GET["domain"]);
|
||||
$v_record_id = quoteshellarg($_GET["record_id"]);
|
||||
exec(
|
||||
HESTIA_CMD . "v-suspend-dns-record " . $user . " " . $v_domain . " " . $v_record_id,
|
||||
$output,
|
||||
$return_var,
|
||||
);
|
||||
check_return_code($return_var, $output);
|
||||
unset($output);
|
||||
$back = $_SESSION["back"];
|
||||
if (!empty($back)) {
|
||||
header("Location: " . $back);
|
||||
exit();
|
||||
}
|
||||
header("Location: /list/dns/?domain=" . $_GET["domain"]);
|
||||
exit();
|
||||
}
|
||||
|
||||
$back = $_SESSION["back"];
|
||||
if (!empty($back)) {
|
||||
header("Location: " . $back);
|
||||
exit();
|
||||
}
|
||||
|
||||
header("Location: /list/dns/");
|
||||
exit();
|
||||
32
web/suspend/firewall/index.php
Normal file
32
web/suspend/firewall/index.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
use function Hestiacp\quoteshellarg\quoteshellarg;
|
||||
|
||||
ob_start();
|
||||
|
||||
session_start();
|
||||
include $_SERVER["DOCUMENT_ROOT"] . "/inc/main.php";
|
||||
|
||||
// Check token
|
||||
verify_csrf($_GET);
|
||||
|
||||
// Check user
|
||||
if ($_SESSION["userContext"] != "admin") {
|
||||
header("Location: /list/user");
|
||||
exit();
|
||||
}
|
||||
|
||||
if (!empty($_GET["rule"])) {
|
||||
$v_rule = quoteshellarg($_GET["rule"]);
|
||||
exec(HESTIA_CMD . "v-suspend-firewall-rule " . $v_rule, $output, $return_var);
|
||||
}
|
||||
check_return_code($return_var, $output);
|
||||
unset($output);
|
||||
|
||||
$back = getenv("HTTP_REFERER");
|
||||
if (!empty($back)) {
|
||||
header("Location: " . $back);
|
||||
exit();
|
||||
}
|
||||
|
||||
header("Location: /list/firewall/");
|
||||
exit();
|
||||
53
web/suspend/mail/index.php
Normal file
53
web/suspend/mail/index.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
use function Hestiacp\quoteshellarg\quoteshellarg;
|
||||
|
||||
ob_start();
|
||||
include $_SERVER["DOCUMENT_ROOT"] . "/inc/main.php";
|
||||
|
||||
// Check token
|
||||
verify_csrf($_GET);
|
||||
|
||||
// Mail domain
|
||||
if (!empty($_GET["domain"]) && empty($_GET["account"])) {
|
||||
$v_domain = quoteshellarg($_GET["domain"]);
|
||||
exec(HESTIA_CMD . "v-suspend-mail-domain " . $user . " " . $v_domain, $output, $return_var);
|
||||
check_return_code($return_var, $output);
|
||||
unset($output);
|
||||
$back = getenv("HTTP_REFERER");
|
||||
if (!empty($back)) {
|
||||
header("Location: " . $back);
|
||||
exit();
|
||||
}
|
||||
header("Location: /list/mail/");
|
||||
exit();
|
||||
}
|
||||
|
||||
// Mail account
|
||||
if (!empty($_GET["domain"]) && !empty($_GET["account"])) {
|
||||
$v_username = quoteshellarg($user);
|
||||
$v_domain = quoteshellarg($_GET["domain"]);
|
||||
$v_account = quoteshellarg($_GET["account"]);
|
||||
exec(
|
||||
HESTIA_CMD . "v-suspend-mail-account " . $user . " " . $v_domain . " " . $v_account,
|
||||
$output,
|
||||
$return_var,
|
||||
);
|
||||
check_return_code($return_var, $output);
|
||||
unset($output);
|
||||
$back = $_SESSION["back"];
|
||||
if (!empty($back)) {
|
||||
header("Location: " . $back);
|
||||
exit();
|
||||
}
|
||||
header("Location: /list/mail/?domain=" . $_GET["domain"]);
|
||||
exit();
|
||||
}
|
||||
|
||||
$back = $_SESSION["back"];
|
||||
if (!empty($back)) {
|
||||
header("Location: " . $back);
|
||||
exit();
|
||||
}
|
||||
|
||||
header("Location: /list/mail/");
|
||||
exit();
|
||||
31
web/suspend/user/index.php
Normal file
31
web/suspend/user/index.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
use function Hestiacp\quoteshellarg\quoteshellarg;
|
||||
|
||||
ob_start();
|
||||
$TAB = "USER";
|
||||
include $_SERVER["DOCUMENT_ROOT"] . "/inc/main.php";
|
||||
|
||||
// Check token
|
||||
verify_csrf($_GET);
|
||||
|
||||
// Check user
|
||||
if ($_SESSION["userContext"] != "admin") {
|
||||
header("Location: /list/user");
|
||||
exit();
|
||||
}
|
||||
|
||||
if (!empty($_GET["user"])) {
|
||||
$v_username = quoteshellarg($_GET["user"]);
|
||||
exec(HESTIA_CMD . "v-suspend-user " . $v_username, $output, $return_var);
|
||||
}
|
||||
check_return_code($return_var, $output);
|
||||
unset($output);
|
||||
|
||||
$back = $_SESSION["back"];
|
||||
if (!empty($back)) {
|
||||
header("Location: " . $back);
|
||||
exit();
|
||||
}
|
||||
|
||||
header("Location: /list/user/");
|
||||
exit();
|
||||
25
web/suspend/web/index.php
Normal file
25
web/suspend/web/index.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
use function Hestiacp\quoteshellarg\quoteshellarg;
|
||||
|
||||
ob_start();
|
||||
include $_SERVER["DOCUMENT_ROOT"] . "/inc/main.php";
|
||||
|
||||
// Check token
|
||||
verify_csrf($_GET);
|
||||
|
||||
if (!empty($_GET["domain"])) {
|
||||
$v_username = quoteshellarg($user);
|
||||
$v_domain = quoteshellarg($_GET["domain"]);
|
||||
exec(HESTIA_CMD . "v-suspend-web-domain " . $user . " " . $v_domain, $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();
|
||||
Reference in New Issue
Block a user