Initial
This commit is contained in:
26
web/unsuspend/cron/index.php
Normal file
26
web/unsuspend/cron/index.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
use function Hestiacp\quoteshellarg\quoteshellarg;
|
||||
|
||||
// Init
|
||||
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-unsuspend-cron-job " . $user . " " . $v_job, $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/cron/");
|
||||
exit();
|
||||
25
web/unsuspend/db/index.php
Normal file
25
web/unsuspend/db/index.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
use function Hestiacp\quoteshellarg\quoteshellarg;
|
||||
|
||||
// Init
|
||||
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-unsuspend-database " . $user . " " . $v_database, $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/db/");
|
||||
exit();
|
||||
65
web/unsuspend/dns/index.php
Normal file
65
web/unsuspend/dns/index.php
Normal file
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
use function Hestiacp\quoteshellarg\quoteshellarg;
|
||||
|
||||
// Init
|
||||
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-unsuspend-dns-domain " . $user . " " . $v_domain, $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode("<br>", $output);
|
||||
if (empty($error)) {
|
||||
$error = _("Error: Hestia did not return any output.");
|
||||
}
|
||||
$_SESSION["error_msg"] = $error;
|
||||
}
|
||||
unset($output);
|
||||
$back = getenv("HTTP_REFERER");
|
||||
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-unsuspend-dns-record " . $user . " " . $v_domain . " " . $v_record_id,
|
||||
$output,
|
||||
$return_var,
|
||||
);
|
||||
if ($return_var != 0) {
|
||||
$error = implode("<br>", $output);
|
||||
if (empty($error)) {
|
||||
$error = _("Error: Hestia did not return any output.");
|
||||
}
|
||||
$_SESSION["error_msg"] = $error;
|
||||
}
|
||||
unset($output);
|
||||
$back = getenv("HTTP_REFERER");
|
||||
if (!empty($back)) {
|
||||
header("Location: " . $back);
|
||||
exit();
|
||||
}
|
||||
header("Location: /list/dns/?domain=" . $_GET["domain"]);
|
||||
exit();
|
||||
}
|
||||
|
||||
$back = getenv("HTTP_REFERER");
|
||||
if (!empty($back)) {
|
||||
header("Location: " . $back);
|
||||
exit();
|
||||
}
|
||||
|
||||
header("Location: /list/dns/");
|
||||
exit();
|
||||
31
web/unsuspend/firewall/index.php
Normal file
31
web/unsuspend/firewall/index.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
use function Hestiacp\quoteshellarg\quoteshellarg;
|
||||
|
||||
// Init
|
||||
ob_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-unsuspend-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();
|
||||
66
web/unsuspend/mail/index.php
Normal file
66
web/unsuspend/mail/index.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
use function Hestiacp\quoteshellarg\quoteshellarg;
|
||||
|
||||
// Init
|
||||
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-unsuspend-mail-domain " . $user . " " . $v_domain, $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode("<br>", $output);
|
||||
if (empty($error)) {
|
||||
$error = _("Error: Hestia did not return any output.");
|
||||
}
|
||||
$_SESSION["error_msg"] = $error;
|
||||
}
|
||||
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-unsuspend-mail-account " . $user . " " . $v_domain . " " . $v_account,
|
||||
$output,
|
||||
$return_var,
|
||||
);
|
||||
if ($return_var != 0) {
|
||||
$error = implode("<br>", $output);
|
||||
if (empty($error)) {
|
||||
$error = _("Error: Hestia did not return any output.");
|
||||
}
|
||||
$_SESSION["error_msg"] = $error;
|
||||
}
|
||||
unset($output);
|
||||
$back = getenv("HTTP_REFERER");
|
||||
if (!empty($back)) {
|
||||
header("Location: " . $back);
|
||||
exit();
|
||||
}
|
||||
header("Location: /list/mail/?domain=" . $_GET["domain"]);
|
||||
exit();
|
||||
}
|
||||
|
||||
$back = getenv("HTTP_REFERER");
|
||||
if (!empty($back)) {
|
||||
header("Location: " . $back);
|
||||
exit();
|
||||
}
|
||||
|
||||
header("Location: /list/mail/");
|
||||
exit();
|
||||
32
web/unsuspend/user/index.php
Normal file
32
web/unsuspend/user/index.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
use function Hestiacp\quoteshellarg\quoteshellarg;
|
||||
|
||||
// Init
|
||||
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-unsuspend-user " . $v_username, $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/user/");
|
||||
exit();
|
||||
25
web/unsuspend/web/index.php
Normal file
25
web/unsuspend/web/index.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
use function Hestiacp\quoteshellarg\quoteshellarg;
|
||||
|
||||
// Init
|
||||
ob_start();
|
||||
include $_SERVER["DOCUMENT_ROOT"] . "/inc/main.php";
|
||||
|
||||
// Check token
|
||||
verify_csrf($_GET);
|
||||
|
||||
if (!empty($_GET["domain"])) {
|
||||
$v_domain = quoteshellarg($_GET["domain"]);
|
||||
exec(HESTIA_CMD . "v-unsuspend-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/web/");
|
||||
exit();
|
||||
Reference in New Issue
Block a user