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

View File

@@ -0,0 +1,59 @@
<?php
$TAB = "SERVER";
// Main include
include $_SERVER["DOCUMENT_ROOT"] . "/inc/main.php";
// Check user
if ($_SESSION["userContext"] != "admin") {
header("Location: /list/user");
exit();
}
// Check POST request
if (!empty($_POST["save"])) {
// Check token
verify_csrf($_POST);
// Set restart flag
$v_restart = "yes";
if (empty($_POST["v_restart"])) {
$v_restart = "no";
}
// Update config
if (!empty($_POST["v_config"])) {
exec("mktemp", $mktemp_output, $return_var);
$new_conf = $mktemp_output[0];
$fp = fopen($new_conf, "w");
fwrite($fp, str_replace("\r\n", "\n", $_POST["v_config"]));
fclose($fp);
exec(
HESTIA_CMD . "v-change-sys-service-config " . $new_conf . " apache2 " . $v_restart,
$output,
$return_var,
);
check_return_code($return_var, $output);
unset($output);
unlink($new_conf);
}
// Set success message
if (empty($_SESSION["error_msg"])) {
$_SESSION["ok_msg"] = _("Changes have been saved.");
}
}
$v_config_path = "/etc/apache2/apache2.conf";
$v_service_name = strtoupper("apache2");
// Read config
$v_config = shell_exec(HESTIA_CMD . "v-open-fs-config " . $v_config_path);
// Render page
render_page($user, $TAB, "edit_server_httpd");
// Flush session messages
unset($_SESSION["error_msg"]);
unset($_SESSION["ok_msg"]);

View File

@@ -0,0 +1,78 @@
<?php
$TAB = "SERVER";
// Main include
include $_SERVER["DOCUMENT_ROOT"] . "/inc/main.php";
// Check user
if ($_SESSION["userContext"] != "admin") {
header("Location: /list/user");
exit();
}
// Check POST request
if (!empty($_POST["save"])) {
// Check token
verify_csrf($_POST);
// Set restart flag
$v_restart = "yes";
if (empty($_POST["v_restart"])) {
$v_restart = "no";
}
// Update options
if (!empty($_POST["v_options"])) {
exec("mktemp", $mktemp_output, $return_var);
$new_conf = $mktemp_output[0];
$fp = fopen($new_conf, "w");
fwrite($fp, str_replace("\r\n", "\n", $_POST["v_options"]));
fclose($fp);
exec(
HESTIA_CMD . "v-change-sys-service-config " . $new_conf . " bind9-opt " . $v_restart,
$output,
$return_var,
);
check_return_code($return_var, $output);
unset($output);
unlink($new_conf);
}
// Update config
if (empty($_SESSION["error_msg"]) && !empty($_POST["v_config"])) {
exec("mktemp", $mktemp_output, $return_var);
$new_conf = $mktemp_output[0];
$fp = fopen($new_conf, "w");
fwrite($fp, str_replace("\r\n", "\n", $_POST["v_config"]));
fclose($fp);
exec(
HESTIA_CMD . "v-change-sys-service-config " . $new_conf . " bind9 " . $v_restart,
$output,
$return_var,
);
check_return_code($return_var, $output);
unset($output);
unlink($new_conf);
}
// Set success message
if (empty($_SESSION["error_msg"])) {
$_SESSION["ok_msg"] = _("Changes have been saved.");
}
}
$v_options_path = "/etc/bind/named.conf.options";
$v_config_path = "/etc/bind/named.conf";
$v_service_name = strtoupper("bind9");
// Read config
$v_options = shell_exec(HESTIA_CMD . "v-open-fs-config " . $v_options_path);
$v_config = shell_exec(HESTIA_CMD . "v-open-fs-config " . $v_config_path);
// Render page
render_page($user, $TAB, "edit_server_bind9");
// Flush session messages
unset($_SESSION["error_msg"]);
unset($_SESSION["ok_msg"]);

View File

@@ -0,0 +1,59 @@
<?php
$TAB = "SERVER";
// Main include
include $_SERVER["DOCUMENT_ROOT"] . "/inc/main.php";
// Check user
if ($_SESSION["userContext"] != "admin") {
header("Location: /list/user");
exit();
}
// Check POST request
if (!empty($_POST["save"])) {
// Check token
verify_csrf($_POST);
// Set restart flag
$v_restart = "yes";
if (empty($_POST["v_restart"])) {
$v_restart = "no";
}
// Update config
if (!empty($_POST["v_config"])) {
exec("mktemp", $mktemp_output, $return_var);
$new_conf = $mktemp_output[0];
$fp = fopen($new_conf, "w");
fwrite($fp, str_replace("\r\n", "\n", $_POST["v_config"]));
fclose($fp);
exec(
HESTIA_CMD . "v-change-sys-service-config " . $new_conf . " clamd " . $v_restart,
$output,
$return_var,
);
check_return_code($return_var, $output);
unset($output);
unlink($new_conf);
}
// Set success message
if (empty($_SESSION["error_msg"])) {
$_SESSION["ok_msg"] = _("Changes have been saved.");
}
}
$v_config_path = shell_exec(HESTIA_CMD . "v-list-sys-clamd-config plain");
$v_service_name = strtoupper("clamav");
// Read config
$v_config = shell_exec(HESTIA_CMD . "v-open-fs-config " . $v_config_path);
// Render page
render_page($user, $TAB, "edit_server_service");
// Flush session messages
unset($_SESSION["error_msg"]);
unset($_SESSION["ok_msg"]);

View File

@@ -0,0 +1,31 @@
<?php
$TAB = "SERVER";
// Main include
include $_SERVER["DOCUMENT_ROOT"] . "/inc/main.php";
// Check user
if ($_SESSION["userContext"] != "admin") {
header("Location: /list/user");
exit();
}
// Check POST request
if (!empty($_POST["save"])) {
// Set success message
$_SESSION["ok_msg"] = _("Info (read-only mode): Crontab can only be edited via SSH.");
}
$v_config_path = "/etc/crontab";
$v_service_name = strtoupper("cron");
// Read config
$v_config = shell_exec(HESTIA_CMD . "v-open-fs-config " . $v_config_path);
// Render page
render_page($user, $TAB, "edit_server_service");
// Flush session messages
unset($_SESSION["error_msg"]);
unset($_SESSION["ok_msg"]);

View File

@@ -0,0 +1,31 @@
<?php
$TAB = "SERVER";
// Main include
include $_SERVER["DOCUMENT_ROOT"] . "/inc/main.php";
// Check user
if ($_SESSION["userContext"] != "admin") {
header("Location: /list/user");
exit();
}
// Check POST request
if (!empty($_POST["save"])) {
// Set success message
$_SESSION["ok_msg"] = _("Info (read-only mode): Crontab can only be edited via SSH.");
}
$v_config_path = "/etc/crontab";
$v_service_name = strtoupper("cron");
// Read config
$v_config = shell_exec(HESTIA_CMD . "v-open-fs-config " . $v_config_path);
// Render page
render_page($user, $TAB, "edit_server_service");
// Flush session messages
unset($_SESSION["error_msg"]);
unset($_SESSION["ok_msg"]);

View File

@@ -0,0 +1,232 @@
<?php
$TAB = "SERVER";
// Main include
include $_SERVER["DOCUMENT_ROOT"] . "/inc/main.php";
// Check user
if ($_SESSION["userContext"] != "admin") {
header("Location: /list/user");
exit();
}
// Check POST request
if (!empty($_POST["save"])) {
// Check token
verify_csrf($_POST);
// Set restart flag
$v_restart = "yes";
if (empty($_POST["v_restart"])) {
$v_restart = "no";
}
// Update config
if (!empty($_POST["v_config"])) {
exec("mktemp", $mktemp_output, $return_var);
$new_conf = $mktemp_output[0];
$fp = fopen($new_conf, "w");
fwrite($fp, str_replace("\r\n", "\n", $_POST["v_config"]));
fclose($fp);
exec(
HESTIA_CMD . "v-change-sys-service-config " . $new_conf . " dovecot " . $v_restart,
$output,
$return_var,
);
check_return_code($return_var, $output);
unset($output);
unlink($new_conf);
}
// Update config1
if (empty($_SESSION["error_msg"]) && !empty($_POST["v_config1"])) {
exec("mktemp", $mktemp_output, $return_var);
$new_conf = $mktemp_output[0];
$fp = fopen($new_conf, "w");
fwrite($fp, str_replace("\r\n", "\n", $_POST["v_config1"]));
fclose($fp);
exec(
HESTIA_CMD . "v-change-sys-service-config " . $new_conf . " dovecot-1 " . $v_restart,
$output,
$return_var,
);
check_return_code($return_var, $output);
unset($output);
unlink($new_conf);
}
// Update config2
if (empty($_SESSION["error_msg"]) && !empty($_POST["v_config2"])) {
exec("mktemp", $mktemp_output, $return_var);
$new_conf = $mktemp_output[0];
$fp = fopen($new_conf, "w");
fwrite($fp, str_replace("\r\n", "\n", $_POST["v_config2"]));
fclose($fp);
exec(
HESTIA_CMD . "v-change-sys-service-config " . $new_conf . " dovecot-2 " . $v_restart,
$output,
$return_var,
);
check_return_code($return_var, $output);
unset($output);
unlink($new_conf);
}
// Update config3
if (empty($_SESSION["error_msg"]) && !empty($_POST["v_config3"])) {
exec("mktemp", $mktemp_output, $return_var);
$new_conf = $mktemp_output[0];
$fp = fopen($new_conf, "w");
fwrite($fp, str_replace("\r\n", "\n", $_POST["v_config3"]));
fclose($fp);
exec(
HESTIA_CMD . "v-change-sys-service-config " . $new_conf . " dovecot-3 " . $v_restart,
$output,
$return_var,
);
check_return_code($return_var, $output);
unset($output);
unlink($new_conf);
}
// Update config4
if (empty($_SESSION["error_msg"]) && !empty($_POST["v_config4"])) {
exec("mktemp", $mktemp_output, $return_var);
$new_conf = $mktemp_output[0];
$fp = fopen($new_conf, "w");
fwrite($fp, str_replace("\r\n", "\n", $_POST["v_config4"]));
fclose($fp);
exec(
HESTIA_CMD . "v-change-sys-service-config " . $new_conf . " dovecot-4 " . $v_restart,
$output,
$return_var,
);
check_return_code($return_var, $output);
unset($output);
unlink($new_conf);
}
// Update config5
if (empty($_SESSION["error_msg"]) && !empty($_POST["v_config5"])) {
exec("mktemp", $mktemp_output, $return_var);
$new_conf = $mktemp_output[0];
$fp = fopen($new_conf, "w");
fwrite($fp, str_replace("\r\n", "\n", $_POST["v_config5"]));
fclose($fp);
exec(
HESTIA_CMD . "v-change-sys-service-config " . $new_conf . " dovecot-5 " . $v_restart,
$output,
$return_var,
);
check_return_code($return_var, $output);
unset($output);
unlink($new_conf);
}
// Update config6
if (empty($_SESSION["error_msg"]) && !empty($_POST["v_config6"])) {
exec("mktemp", $mktemp_output, $return_var);
$new_conf = $mktemp_output[0];
$fp = fopen($new_conf, "w");
fwrite($fp, str_replace("\r\n", "\n", $_POST["v_config6"]));
fclose($fp);
exec(
HESTIA_CMD . "v-change-sys-service-config " . $new_conf . " dovecot-6 " . $v_restart,
$output,
$return_var,
);
check_return_code($return_var, $output);
unset($output);
unlink($new_conf);
}
// Update config7
if (empty($_SESSION["error_msg"]) && !empty($_POST["v_config7"])) {
exec("mktemp", $mktemp_output, $return_var);
$new_conf = $mktemp_output[0];
$fp = fopen($new_conf, "w");
fwrite($fp, str_replace("\r\n", "\n", $_POST["v_config7"]));
fclose($fp);
exec(
HESTIA_CMD . "v-change-sys-service-config " . $new_conf . " dovecot-7 " . $v_restart,
$output,
$return_var,
);
check_return_code($return_var, $output);
unset($output);
unlink($new_conf);
}
// Update config8
if (empty($_SESSION["error_msg"]) && !empty($_POST["v_config8"])) {
exec("mktemp", $mktemp_output, $return_var);
$new_conf = $mktemp_output[0];
$fp = fopen($new_conf, "w");
fwrite($fp, str_replace("\r\n", "\n", $_POST["v_config8"]));
fclose($fp);
exec(
HESTIA_CMD . "v-change-sys-service-config " . $new_conf . " dovecot-8 " . $v_restart,
$output,
$return_var,
);
check_return_code($return_var, $output);
unset($output);
unlink($new_conf);
}
// Set success message
if (empty($_SESSION["error_msg"])) {
$_SESSION["ok_msg"] = _("Changes have been saved.");
}
}
// List config
exec(HESTIA_CMD . "v-list-sys-dovecot-config json", $output, $return_var);
$data = json_decode(implode("", $output), true);
unset($output);
$v_config_path = $data["CONFIG"]["config_path"];
$v_config_path1 = $data["CONFIG"]["config_path1"];
$v_config_path2 = $data["CONFIG"]["config_path2"];
$v_config_path3 = $data["CONFIG"]["config_path3"];
$v_config_path4 = $data["CONFIG"]["config_path4"];
$v_config_path5 = $data["CONFIG"]["config_path5"];
$v_config_path6 = $data["CONFIG"]["config_path6"];
$v_config_path7 = $data["CONFIG"]["config_path7"];
$v_config_path8 = $data["CONFIG"]["config_path8"];
$v_service_name = strtoupper("dovecot");
// Read config
$v_config = shell_exec(HESTIA_CMD . "v-open-fs-config " . $v_config_path);
if (!empty($v_config_path1)) {
$v_config1 = shell_exec(HESTIA_CMD . "v-open-fs-config " . $v_config_path1);
}
if (!empty($v_config_path2)) {
$v_config2 = shell_exec(HESTIA_CMD . "v-open-fs-config " . $v_config_path2);
}
if (!empty($v_config_path3)) {
$v_config3 = shell_exec(HESTIA_CMD . "v-open-fs-config " . $v_config_path3);
}
if (!empty($v_config_path4)) {
$v_config4 = shell_exec(HESTIA_CMD . "v-open-fs-config " . $v_config_path4);
}
if (!empty($v_config_path5)) {
$v_config5 = shell_exec(HESTIA_CMD . "v-open-fs-config " . $v_config_path5);
}
if (!empty($v_config_path6)) {
$v_config6 = shell_exec(HESTIA_CMD . "v-open-fs-config " . $v_config_path6);
}
if (!empty($v_config_path7)) {
$v_config7 = shell_exec(HESTIA_CMD . "v-open-fs-config " . $v_config_path7);
}
if (!empty($v_config_path8)) {
$v_config8 = shell_exec(HESTIA_CMD . "v-open-fs-config " . $v_config_path8);
}
// Render page
render_page($user, $TAB, "edit_server_dovecot");
// Flush session messages
unset($_SESSION["error_msg"]);
unset($_SESSION["ok_msg"]);

View File

@@ -0,0 +1,59 @@
<?php
$TAB = "SERVER";
// Main include
include $_SERVER["DOCUMENT_ROOT"] . "/inc/main.php";
// Check user
if ($_SESSION["userContext"] != "admin") {
header("Location: /list/user");
exit();
}
// Check POST request
if (!empty($_POST["save"])) {
// Check token
verify_csrf($_POST);
// Set restart flag
$v_restart = "yes";
if (empty($_POST["v_restart"])) {
$v_restart = "no";
}
// Update config
if (!empty($_POST["v_config"])) {
exec("mktemp", $mktemp_output, $return_var);
$new_conf = $mktemp_output[0];
$fp = fopen($new_conf, "w");
fwrite($fp, str_replace("\r\n", "\n", $_POST["v_config"]));
fclose($fp);
exec(
HESTIA_CMD . "v-change-sys-service-config " . $new_conf . " exim " . $v_restart,
$output,
$return_var,
);
check_return_code($return_var, $output);
unset($output);
unlink($new_conf);
}
// Set success message
if (empty($_SESSION["error_msg"])) {
$_SESSION["ok_msg"] = _("Changes have been saved.");
}
}
$v_config_path = "/etc/exim/exim.conf";
$v_service_name = strtoupper("exim");
// Read config
$v_config = shell_exec(HESTIA_CMD . "v-open-fs-config " . $v_config_path);
// Render page
render_page($user, $TAB, "edit_server_service");
// Flush session messages
unset($_SESSION["error_msg"]);
unset($_SESSION["ok_msg"]);

View File

@@ -0,0 +1,59 @@
<?php
$TAB = "SERVER";
// Main include
include $_SERVER["DOCUMENT_ROOT"] . "/inc/main.php";
// Check user
if ($_SESSION["userContext"] != "admin") {
header("Location: /list/user");
exit();
}
// Check POST request
if (!empty($_POST["save"])) {
// Check token
verify_csrf($_POST);
// Set restart flag
$v_restart = "yes";
if (empty($_POST["v_restart"])) {
$v_restart = "no";
}
// Update config
if (!empty($_POST["v_config"])) {
exec("mktemp", $mktemp_output, $return_var);
$new_conf = $mktemp_output[0];
$fp = fopen($new_conf, "w");
fwrite($fp, str_replace("\r\n", "\n", $_POST["v_config"]));
fclose($fp);
exec(
HESTIA_CMD . "v-change-sys-service-config " . $new_conf . " exim4 " . $v_restart,
$output,
$return_var,
);
check_return_code($return_var, $output);
unset($output);
unlink($new_conf);
}
// Set success message
if (empty($_SESSION["error_msg"])) {
$_SESSION["ok_msg"] = _("Changes have been saved.");
}
}
$v_config_path = "/etc/exim4/exim4.conf.template";
$v_service_name = strtoupper("exim");
// Read config
$v_config = shell_exec(HESTIA_CMD . "v-open-fs-config " . $v_config_path);
// Render page
render_page($user, $TAB, "edit_server_service");
// Flush session messages
unset($_SESSION["error_msg"]);
unset($_SESSION["ok_msg"]);

View File

@@ -0,0 +1,59 @@
<?php
$TAB = "SERVER";
// Main include
include $_SERVER["DOCUMENT_ROOT"] . "/inc/main.php";
// Check user
if ($_SESSION["userContext"] != "admin") {
header("Location: /list/user");
exit();
}
// Check POST request
if (!empty($_POST["save"])) {
// Check token
verify_csrf($_POST);
// Set restart flag
$v_restart = "yes";
if (empty($_POST["v_restart"])) {
$v_restart = "no";
}
// Update config
if (!empty($_POST["v_config"])) {
exec("mktemp", $mktemp_output, $return_var);
$new_conf = $mktemp_output[0];
$fp = fopen($new_conf, "w");
fwrite($fp, str_replace("\r\n", "\n", $_POST["v_config"]));
fclose($fp);
exec(
HESTIA_CMD . "v-change-sys-service-config " . $new_conf . " fail2ban " . $v_restart,
$output,
$return_var,
);
check_return_code($return_var, $output);
unset($output);
unlink($new_conf);
}
// Set success message
if (empty($_SESSION["error_msg"])) {
$_SESSION["ok_msg"] = _("Changes have been saved.");
}
}
$v_config_path = "/etc/fail2ban/jail.local";
$v_service_name = strtoupper("fail2ban");
// Read config
$v_config = shell_exec(HESTIA_CMD . "v-open-fs-config " . $v_config_path);
// Render page
render_page($user, $TAB, "edit_server_service");
// Flush session messages
unset($_SESSION["error_msg"]);
unset($_SESSION["ok_msg"]);

View File

@@ -0,0 +1,59 @@
<?php
$TAB = "SERVER";
// Main include
include $_SERVER["DOCUMENT_ROOT"] . "/inc/main.php";
// Check user
if ($_SESSION["userContext"] != "admin") {
header("Location: /list/user");
exit();
}
// Check POST request
if (!empty($_POST["save"])) {
// Check token
verify_csrf($_POST);
// Set restart flag
$v_restart = "yes";
if (empty($_POST["v_restart"])) {
$v_restart = "no";
}
// Update config
if (!empty($_POST["v_config"])) {
exec("mktemp", $mktemp_output, $return_var);
$new_conf = $mktemp_output[0];
$fp = fopen($new_conf, "w");
fwrite($fp, str_replace("\r\n", "\n", $_POST["v_config"]));
fclose($fp);
exec(
HESTIA_CMD . "v-change-sys-service-config " . $new_conf . " httpd " . $v_restart,
$output,
$return_var,
);
check_return_code($return_var, $output);
unset($output);
unlink($new_conf);
}
// Set success message
if (empty($_SESSION["error_msg"])) {
$_SESSION["ok_msg"] = _("Changes have been saved.");
}
}
$v_config_path = "/etc/httpd/conf/httpd.conf";
$v_service_name = strtoupper("httpd");
// Read config
$v_config = shell_exec(HESTIA_CMD . "v-open-fs-config " . $v_config_path);
// Render page
render_page($user, $TAB, "edit_server_httpd");
// Flush session messages
unset($_SESSION["error_msg"]);
unset($_SESSION["ok_msg"]);

1748
web/edit/server/index.php Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,9 @@
<?php
$TAB = "SERVER";
// Main include
include $_SERVER["DOCUMENT_ROOT"] . "/inc/main.php";
// Check user
header("Location: /list/firewall");
exit();

View File

@@ -0,0 +1,68 @@
<?php
$TAB = "SERVER";
// Main include
include $_SERVER["DOCUMENT_ROOT"] . "/inc/main.php";
// Check user
if ($_SESSION["userContext"] != "admin") {
header("Location: /list/user");
exit();
}
// Check POST request
if (!empty($_POST["save"])) {
// Check token
verify_csrf($_POST);
// Set restart flag
$v_restart = "yes";
if (empty($_POST["v_restart"])) {
$v_restart = "no";
}
// Update config
if (!empty($_POST["v_config"])) {
exec("mktemp", $mktemp_output, $return_var);
$new_conf = $mktemp_output[0];
$fp = fopen($new_conf, "w");
fwrite($fp, str_replace("\r\n", "\n", $_POST["v_config"]));
fclose($fp);
exec(
HESTIA_CMD . "v-change-sys-service-config " . $new_conf . " mariadb " . $v_restart,
$output,
$return_var,
);
check_return_code($return_var, $output);
unset($output);
unlink($new_conf);
}
// Set success message
if (empty($_SESSION["error_msg"])) {
$_SESSION["ok_msg"] = _("Changes have been saved.");
}
}
// List config
exec(HESTIA_CMD . "v-list-sys-mysql-config json", $output, $return_var);
$data = json_decode(implode("", $output), true);
unset($output);
$v_max_user_connections = $data["CONFIG"]["max_user_connections"];
$v_max_connections = $data["CONFIG"]["max_connections"];
$v_wait_timeout = $data["CONFIG"]["wait_timeout"];
$v_interactive_timeout = $data["CONFIG"]["interactive_timeout"];
$v_max_allowed_packet = $data["CONFIG"]["max_allowed_packet"];
$v_config_path = $data["CONFIG"]["config_path"];
$v_service_name = strtoupper("mariadb");
# Read config
$v_config = shell_exec(HESTIA_CMD . "v-open-fs-config " . $v_config_path);
// Render page
render_page($user, $TAB, "edit_server_mysql");
// Flush session messages
unset($_SESSION["error_msg"]);
unset($_SESSION["ok_msg"]);

View File

@@ -0,0 +1,68 @@
<?php
$TAB = "SERVER";
// Main include
include $_SERVER["DOCUMENT_ROOT"] . "/inc/main.php";
// Check user
if ($_SESSION["userContext"] != "admin") {
header("Location: /list/user");
exit();
}
// Check POST request
if (!empty($_POST["save"])) {
// Check token
verify_csrf($_POST);
// Set restart flag
$v_restart = "yes";
if (empty($_POST["v_restart"])) {
$v_restart = "no";
}
// Update config
if (!empty($_POST["v_config"])) {
exec("mktemp", $mktemp_output, $return_var);
$new_conf = $mktemp_output[0];
$fp = fopen($new_conf, "w");
fwrite($fp, str_replace("\r\n", "\n", $_POST["v_config"]));
fclose($fp);
exec(
HESTIA_CMD . "v-change-sys-service-config " . $new_conf . " mysql " . $v_restart,
$output,
$return_var,
);
check_return_code($return_var, $output);
unset($output);
unlink($new_conf);
}
// Set success message
if (empty($_SESSION["error_msg"])) {
$_SESSION["ok_msg"] = _("Changes have been saved.");
}
}
// List config
exec(HESTIA_CMD . "v-list-sys-mysql-config json", $output, $return_var);
$data = json_decode(implode("", $output), true);
unset($output);
$v_max_user_connections = $data["CONFIG"]["max_user_connections"];
$v_max_connections = $data["CONFIG"]["max_connections"];
$v_wait_timeout = $data["CONFIG"]["wait_timeout"];
$v_interactive_timeout = $data["CONFIG"]["interactive_timeout"];
$v_max_allowed_packet = $data["CONFIG"]["max_allowed_packet"];
$v_config_path = $data["CONFIG"]["config_path"];
$v_service_name = strtoupper("mysql");
# Read config
$v_config = shell_exec(HESTIA_CMD . "v-open-fs-config " . $v_config_path);
// Render page
render_page($user, $TAB, "edit_server_mysql");
// Flush session messages
unset($_SESSION["error_msg"]);
unset($_SESSION["ok_msg"]);

View File

@@ -0,0 +1,68 @@
<?php
$TAB = "SERVER";
// Main include
include $_SERVER["DOCUMENT_ROOT"] . "/inc/main.php";
// Check user
if ($_SESSION["userContext"] != "admin") {
header("Location: /list/user");
exit();
}
// Check POST request
if (!empty($_POST["save"])) {
// Check token
verify_csrf($_POST);
// Set restart flag
$v_restart = "yes";
if (empty($_POST["v_restart"])) {
$v_restart = "no";
}
// Update config
if (!empty($_POST["v_config"])) {
exec("mktemp", $mktemp_output, $return_var);
$new_conf = $mktemp_output[0];
$fp = fopen($new_conf, "w");
fwrite($fp, str_replace("\r\n", "\n", $_POST["v_config"]));
fclose($fp);
exec(
HESTIA_CMD . "v-change-sys-service-config " . $new_conf . " mysqld " . $v_restart,
$output,
$return_var,
);
check_return_code($return_var, $output);
unset($output);
unlink($new_conf);
}
// Set success message
if (empty($_SESSION["error_msg"])) {
$_SESSION["ok_msg"] = _("Changes have been saved.");
}
}
// List config
exec(HESTIA_CMD . "v-list-sys-mysql-config json", $output, $return_var);
$data = json_decode(implode("", $output), true);
unset($output);
$v_max_user_connections = $data["CONFIG"]["max_user_connections"];
$v_max_connections = $data["CONFIG"]["max_connections"];
$v_wait_timeout = $data["CONFIG"]["wait_timeout"];
$v_interactive_timeout = $data["CONFIG"]["interactive_timeout"];
$v_max_allowed_packet = $data["CONFIG"]["max_allowed_packet"];
$v_config_path = $data["CONFIG"]["config_path"];
$v_service_name = strtoupper("mysql");
# Read config
$v_config = shell_exec(HESTIA_CMD . "v-open-fs-config " . $v_config_path);
// Render page
render_page($user, $TAB, "edit_server_mysql");
// Flush session messages
unset($_SESSION["error_msg"]);
unset($_SESSION["ok_msg"]);

View File

@@ -0,0 +1,59 @@
<?php
$TAB = "SERVER";
// Main include
include $_SERVER["DOCUMENT_ROOT"] . "/inc/main.php";
// Check user
if ($_SESSION["userContext"] != "admin") {
header("Location: /list/user");
exit();
}
// Check POST request
if (!empty($_POST["save"])) {
// Check token
verify_csrf($_POST);
// Set restart flag
$v_restart = "yes";
if (empty($_POST["v_restart"])) {
$v_restart = "no";
}
// Update config
if (!empty($_POST["v_config"])) {
exec("mktemp", $mktemp_output, $return_var);
$new_conf = $mktemp_output[0];
$fp = fopen($new_conf, "w");
fwrite($fp, str_replace("\r\n", "\n", $_POST["v_config"]));
fclose($fp);
exec(
HESTIA_CMD . "v-change-sys-service-config " . $new_conf . " named " . $v_restart,
$output,
$return_var,
);
check_return_code($return_var, $output);
unset($output);
unlink($new_conf);
}
// Set success message
if (empty($_SESSION["error_msg"])) {
$_SESSION["ok_msg"] = _("Changes have been saved.");
}
}
$v_config_path = "/etc/named.conf";
$v_service_name = strtoupper("named");
// Read config
$v_config = shell_exec(HESTIA_CMD . "v-open-fs-config " . $v_config_path);
// Render page
render_page($user, $TAB, "edit_server_service");
// Flush session messages
unset($_SESSION["error_msg"]);
unset($_SESSION["ok_msg"]);

View File

@@ -0,0 +1,73 @@
<?php
$TAB = "SERVER";
// Main include
include $_SERVER["DOCUMENT_ROOT"] . "/inc/main.php";
// Check user
if ($_SESSION["userContext"] != "admin") {
header("Location: /list/user");
exit();
}
// Check POST request
if (!empty($_POST["save"])) {
// Check token
verify_csrf($_POST);
// Set restart flag
$v_restart = "yes";
if (empty($_POST["v_restart"])) {
$v_restart = "no";
}
// Update config
if (!empty($_POST["v_config"])) {
exec("mktemp", $mktemp_output, $return_var);
$new_conf = $mktemp_output[0];
$fp = fopen($new_conf, "w");
fwrite($fp, str_replace("\r\n", "\n", $_POST["v_config"]));
fclose($fp);
exec(
HESTIA_CMD . "v-change-sys-service-config " . $new_conf . " nginx " . $v_restart,
$output,
$return_var,
);
check_return_code($return_var, $output);
unset($output);
unlink($new_conf);
}
// Set success message
if (empty($_SESSION["error_msg"])) {
$_SESSION["ok_msg"] = _("Changes have been saved.");
}
}
// List config
exec(HESTIA_CMD . "v-list-sys-nginx-config json", $output, $return_var);
$data = json_decode(implode("", $output), true);
unset($output);
$v_worker_processes = $data["CONFIG"]["worker_processes"];
$v_worker_connections = $data["CONFIG"]["worker_connections"];
$v_send_timeout = $data["CONFIG"]["send_timeout"];
$v_proxy_connect_timeout = $data["CONFIG"]["proxy_connect_timeout"];
$v_proxy_send_timeout = $data["CONFIG"]["proxy_send_timeout"];
$v_proxy_read_timeout = $data["CONFIG"]["proxy_read_timeout"];
$v_client_max_body_size = $data["CONFIG"]["client_max_body_size"];
$v_gzip = $data["CONFIG"]["gzip"];
$v_gzip_comp_level = $data["CONFIG"]["gzip_comp_level"];
$v_charset = $data["CONFIG"]["charset"];
$v_config_path = $data["CONFIG"]["config_path"];
$v_service_name = strtoupper("nginx");
// Read config
$v_config = shell_exec(HESTIA_CMD . "v-open-fs-config " . $v_config_path);
// Render page
render_page($user, $TAB, "edit_server_nginx");
// Flush session messages
unset($_SESSION["error_msg"]);
unset($_SESSION["ok_msg"]);

View File

@@ -0,0 +1,69 @@
<?php
$TAB = "SERVER";
// Main include
include $_SERVER["DOCUMENT_ROOT"] . "/inc/main.php";
// Check user
if ($_SESSION["userContext"] != "admin") {
header("Location: /list/user");
exit();
}
// Check POST request
if (!empty($_POST["save"])) {
// Check token
verify_csrf($_POST);
// Set restart flag
$v_restart = "yes";
if (empty($_POST["v_restart"])) {
$v_restart = "no";
}
// Update config
if (!empty($_POST["v_config"])) {
exec("mktemp", $mktemp_output, $return_var);
$new_conf = $mktemp_output[0];
$fp = fopen($new_conf, "w");
fwrite($fp, str_replace("\r\n", "\n", $_POST["v_config"]));
fclose($fp);
exec(
HESTIA_CMD . "v-change-sys-service-config " . $new_conf . " php " . $v_restart,
$output,
$return_var,
);
check_return_code($return_var, $output);
unset($output);
unlink($new_conf);
}
// Set success message
if (empty($_SESSION["error_msg"])) {
$_SESSION["ok_msg"] = _("Changes have been saved.");
}
}
// List config
exec(HESTIA_CMD . "v-list-sys-php-config json", $output, $return_var);
$data = json_decode(implode("", $output), true);
unset($output);
$v_memory_limit = $data["CONFIG"]["memory_limit"];
$v_max_execution_time = $data["CONFIG"]["max_execution_time"];
$v_max_input_time = $data["CONFIG"]["max_input_time"];
$v_upload_max_filesize = $data["CONFIG"]["upload_max_filesize"];
$v_post_max_size = $data["CONFIG"]["post_max_size"];
$v_display_errors = $data["CONFIG"]["display_errors"];
$v_error_reporting = $data["CONFIG"]["error_reporting"];
$v_config_path = $data["CONFIG"]["config_path"];
# Read config
$v_config = shell_exec(HESTIA_CMD . "v-open-fs-config " . $v_config_path);
// Render page
render_page($user, $TAB, "edit_server_php");
// Flush session messages
unset($_SESSION["error_msg"]);
unset($_SESSION["ok_msg"]);

View File

@@ -0,0 +1,69 @@
<?php
$TAB = "SERVER";
// Main include
include $_SERVER["DOCUMENT_ROOT"] . "/inc/main.php";
// Check user
if ($_SESSION["userContext"] != "admin") {
header("Location: /list/user");
exit();
}
// Check POST request
if (!empty($_POST["save"])) {
// Check token
verify_csrf($_POST);
// Set restart flag
$v_restart = "yes";
if (empty($_POST["v_restart"])) {
$v_restart = "no";
}
// Update config
if (!empty($_POST["v_config"])) {
exec("mktemp", $mktemp_output, $return_var);
$new_conf = $mktemp_output[0];
$fp = fopen($new_conf, "w");
fwrite($fp, str_replace("\r\n", "\n", $_POST["v_config"]));
fclose($fp);
exec(
HESTIA_CMD . "v-change-sys-service-config " . $new_conf . " php " . $v_restart,
$output,
$return_var,
);
check_return_code($return_var, $output);
unset($output);
unlink($new_conf);
}
// Set success message
if (empty($_SESSION["error_msg"])) {
$_SESSION["ok_msg"] = _("Changes have been saved.");
}
}
// List config
exec(HESTIA_CMD . "v-list-sys-php-config json", $output, $return_var);
$data = json_decode(implode("", $output), true);
unset($output);
$v_memory_limit = $data["CONFIG"]["memory_limit"];
$v_max_execution_time = $data["CONFIG"]["max_execution_time"];
$v_max_input_time = $data["CONFIG"]["max_input_time"];
$v_upload_max_filesize = $data["CONFIG"]["upload_max_filesize"];
$v_post_max_size = $data["CONFIG"]["post_max_size"];
$v_display_errors = $data["CONFIG"]["display_errors"];
$v_error_reporting = $data["CONFIG"]["error_reporting"];
$v_config_path = $data["CONFIG"]["config_path"];
# Read config
$v_config = shell_exec(HESTIA_CMD . "v-open-fs-config " . $v_config_path);
// Render page
render_page($user, $TAB, "edit_server_php");
// Flush session messages
unset($_SESSION["error_msg"]);
unset($_SESSION["ok_msg"]);

View File

@@ -0,0 +1,69 @@
<?php
$TAB = "SERVER";
// Main include
include $_SERVER["DOCUMENT_ROOT"] . "/inc/main.php";
// Check user
if ($_SESSION["userContext"] != "admin") {
header("Location: /list/user");
exit();
}
// Check POST request
if (!empty($_POST["save"])) {
// Check token
verify_csrf($_POST);
// Set restart flag
$v_restart = "yes";
if (empty($_POST["v_restart"])) {
$v_restart = "no";
}
// Update config
if (!empty($_POST["v_config"])) {
exec("mktemp", $mktemp_output, $return_var);
$new_conf = $mktemp_output[0];
$fp = fopen($new_conf, "w");
fwrite($fp, str_replace("\r\n", "\n", $_POST["v_config"]));
fclose($fp);
exec(
HESTIA_CMD . "v-change-sys-service-config " . $new_conf . " php " . $v_restart,
$output,
$return_var,
);
check_return_code($return_var, $output);
unset($output);
unlink($new_conf);
}
// Set success message
if (empty($_SESSION["error_msg"])) {
$_SESSION["ok_msg"] = _("Changes have been saved.");
}
}
// List config
exec(HESTIA_CMD . "v-list-sys-php-config json", $output, $return_var);
$data = json_decode(implode("", $output), true);
unset($output);
$v_memory_limit = $data["CONFIG"]["memory_limit"];
$v_max_execution_time = $data["CONFIG"]["max_execution_time"];
$v_max_input_time = $data["CONFIG"]["max_input_time"];
$v_upload_max_filesize = $data["CONFIG"]["upload_max_filesize"];
$v_post_max_size = $data["CONFIG"]["post_max_size"];
$v_display_errors = $data["CONFIG"]["display_errors"];
$v_error_reporting = $data["CONFIG"]["error_reporting"];
$v_config_path = $data["CONFIG"]["config_path"];
# Read config
$v_config = shell_exec(HESTIA_CMD . "v-open-fs-config " . $v_config_path);
// Render page
render_page($user, $TAB, "edit_server_php");
// Flush session messages
unset($_SESSION["error_msg"]);
unset($_SESSION["ok_msg"]);

View File

@@ -0,0 +1,87 @@
<?php
$TAB = "SERVER";
// Main include
include $_SERVER["DOCUMENT_ROOT"] . "/inc/main.php";
// Check user
if ($_SESSION["userContext"] != "admin") {
header("Location: /list/user");
exit();
}
// Check POST request
if (!empty($_POST["save"])) {
// Check token
verify_csrf($_POST);
// Set restart flag
$v_restart = "yes";
if (empty($_POST["v_restart"])) {
$v_restart = "no";
}
// Update option
if (!empty($_POST["v_options"])) {
exec("mktemp", $mktemp_output, $return_var);
$new_conf = $mktemp_output[0];
$fp = fopen($new_conf, "w");
fwrite($fp, str_replace("\r\n", "\n", $_POST["v_options"]));
fclose($fp);
exec(
HESTIA_CMD .
"v-change-sys-service-config " .
$new_conf .
" postgresql-hba " .
$v_restart,
$output,
$return_var,
);
check_return_code($return_var, $output);
unset($output);
unlink($new_conf);
}
// Update config
if (empty($_SESSION["error_msg"]) && !empty($_POST["v_config"])) {
exec("mktemp", $mktemp_output, $return_var);
$new_conf = $mktemp_output[0];
$fp = fopen($new_conf, "w");
fwrite($fp, str_replace("\r\n", "\n", $_POST["v_config"]));
fclose($fp);
exec(
HESTIA_CMD . "v-change-sys-service-config " . $new_conf . " postgresql " . $v_restart,
$output,
$return_var,
);
check_return_code($return_var, $output);
unset($output);
unlink($new_conf);
}
// Set success message
if (empty($_SESSION["error_msg"])) {
$_SESSION["ok_msg"] = _("Changes have been saved.");
}
}
// List config
exec(HESTIA_CMD . "v-list-sys-pgsql-config json", $output, $return_var);
$data = json_decode(implode("", $output), true);
unset($output);
$v_options_path = $data["CONFIG"]["pg_hba_path"];
$v_config_path = $data["CONFIG"]["config_path"];
$v_service_name = strtoupper("postgresql");
// Read config
$v_options = shell_exec(HESTIA_CMD . "v-open-fs-config " . $v_options_path);
$v_config = shell_exec(HESTIA_CMD . "v-open-fs-config " . $v_config_path);
// Render page
render_page($user, $TAB, "edit_server_pgsql");
// Flush session messages
unset($_SESSION["error_msg"]);
unset($_SESSION["ok_msg"]);

View File

@@ -0,0 +1,59 @@
<?php
$TAB = "SERVER";
// Main include
include $_SERVER["DOCUMENT_ROOT"] . "/inc/main.php";
// Check user
if ($_SESSION["userContext"] != "admin") {
header("Location: /list/user");
exit();
}
// Check POST request
if (!empty($_POST["save"])) {
// Check token
verify_csrf($_POST);
// Set restart flag
$v_restart = "yes";
if (empty($_POST["v_restart"])) {
$v_restart = "no";
}
// Update config
if (!empty($_POST["v_config"])) {
exec("mktemp", $mktemp_output, $return_var);
$new_conf = $mktemp_output[0];
$fp = fopen($new_conf, "w");
fwrite($fp, str_replace("\r\n", "\n", $_POST["v_config"]));
fclose($fp);
exec(
HESTIA_CMD . "v-change-sys-service-config " . $new_conf . " proftpd " . $v_restart,
$output,
$return_var,
);
check_return_code($return_var, $output);
unset($output);
unlink($new_conf);
}
// Set success message
if (empty($_SESSION["error_msg"])) {
$_SESSION["ok_msg"] = _("Changes have been saved.");
}
}
$v_config_path = shell_exec(HESTIA_CMD . "v-list-sys-proftpd-config plain");
$v_service_name = strtoupper("proftpd");
// Read config
$v_config = shell_exec(HESTIA_CMD . "v-open-fs-config " . $v_config_path);
// Render page
render_page($user, $TAB, "edit_server_service");
// Flush session messages
unset($_SESSION["error_msg"]);
unset($_SESSION["ok_msg"]);

View File

@@ -0,0 +1,59 @@
<?php
$TAB = "SERVER";
// Main include
include $_SERVER["DOCUMENT_ROOT"] . "/inc/main.php";
// Check user
if ($_SESSION["userContext"] != "admin") {
header("Location: /list/user");
exit();
}
// Check POST request
if (!empty($_POST["save"])) {
// Check token
verify_csrf($_POST);
// Set restart flag
$v_restart = "yes";
if (empty($_POST["v_restart"])) {
$v_restart = "no";
}
// Update config
if (!empty($_POST["v_config"])) {
exec("mktemp", $mktemp_output, $return_var);
$new_conf = $mktemp_output[0];
$fp = fopen($new_conf, "w");
fwrite($fp, str_replace("\r\n", "\n", $_POST["v_config"]));
fclose($fp);
exec(
HESTIA_CMD . "v-change-sys-service-config " . $new_conf . " spamassassin " . $v_restart,
$output,
$return_var,
);
check_return_code($return_var, $output);
unset($output);
unlink($new_conf);
}
// Set success message
if (empty($_SESSION["error_msg"])) {
$_SESSION["ok_msg"] = _("Changes have been saved.");
}
}
$v_config_path = shell_exec(HESTIA_CMD . "v-list-sys-spamd-config plain");
$v_service_name = strtoupper("spamassassin");
// Read config
$v_config = shell_exec(HESTIA_CMD . "v-open-fs-config " . $v_config_path);
// Render page
render_page($user, $TAB, "edit_server_service");
// Flush session messages
unset($_SESSION["error_msg"]);
unset($_SESSION["ok_msg"]);

View File

@@ -0,0 +1,59 @@
<?php
$TAB = "SERVER";
// Main include
include $_SERVER["DOCUMENT_ROOT"] . "/inc/main.php";
// Check user
if ($_SESSION["userContext"] != "admin") {
header("Location: /list/user");
exit();
}
// Check POST request
if (!empty($_POST["save"])) {
// Check token
verify_csrf($_POST);
// Set restart flag
$v_restart = "yes";
if (empty($_POST["v_restart"])) {
$v_restart = "no";
}
// Update config
if (!empty($_POST["v_config"])) {
exec("mktemp", $mktemp_output, $return_var);
$new_conf = $mktemp_output[0];
$fp = fopen($new_conf, "w");
fwrite($fp, str_replace("\r\n", "\n", $_POST["v_config"]));
fclose($fp);
exec(
HESTIA_CMD . "v-change-sys-service-config " . $new_conf . " spamd " . $v_restart,
$output,
$return_var,
);
check_return_code($return_var, $output);
unset($output);
unlink($new_conf);
}
// Set success message
if (empty($_SESSION["error_msg"])) {
$_SESSION["ok_msg"] = _("Changes have been saved.");
}
}
$v_config_path = shell_exec(HESTIA_CMD . "v-list-sys-spamd-config plain");
$v_service_name = strtoupper("spamassassin");
// Read config
$v_config = shell_exec(HESTIA_CMD . "v-open-fs-config " . $v_config_path);
// Render page
render_page($user, $TAB, "edit_server_service");
// Flush session messages
unset($_SESSION["error_msg"]);
unset($_SESSION["ok_msg"]);

View File

@@ -0,0 +1,59 @@
<?php
$TAB = "SERVER";
// Main include
include $_SERVER["DOCUMENT_ROOT"] . "/inc/main.php";
// Check user
if ($_SESSION["userContext"] != "admin") {
header("Location: /list/user");
exit();
}
// Check POST request
if (!empty($_POST["save"])) {
// Check token
verify_csrf($_POST);
// Set restart flag
$v_restart = "yes";
if (empty($_POST["v_restart"])) {
$v_restart = "no";
}
// Update config
if (!empty($_POST["v_config"])) {
exec("mktemp", $mktemp_output, $return_var);
$new_conf = $mktemp_output[0];
$fp = fopen($new_conf, "w");
fwrite($fp, str_replace("\r\n", "\n", $_POST["v_config"]));
fclose($fp);
exec(
HESTIA_CMD . "v-change-sys-service-config " . $new_conf . " ssh " . $v_restart,
$output,
$return_var,
);
check_return_code($return_var, $output);
unset($output);
unlink($new_conf);
}
// Set success message
if (empty($_SESSION["error_msg"])) {
$_SESSION["ok_msg"] = _("Changes have been saved.");
}
}
$v_config_path = "/etc/ssh/sshd_config";
$v_service_name = strtoupper("ssh");
// Read config
$v_config = shell_exec(HESTIA_CMD . "v-open-fs-config " . $v_config_path);
// Render page
render_page($user, $TAB, "edit_server_service");
// Flush session messages
unset($_SESSION["error_msg"]);
unset($_SESSION["ok_msg"]);

View File

@@ -0,0 +1,59 @@
<?php
$TAB = "SERVER";
// Main include
include $_SERVER["DOCUMENT_ROOT"] . "/inc/main.php";
// Check user
if ($_SESSION["userContext"] != "admin") {
header("Location: /list/user");
exit();
}
// Check POST request
if (!empty($_POST["save"])) {
//verify token
verify_csrf($_POST);
// Set restart flag
$v_restart = "yes";
if (empty($_POST["v_restart"])) {
$v_restart = "no";
}
// Update config
if (!empty($_POST["v_config"])) {
exec("mktemp", $mktemp_output, $return_var);
$new_conf = $mktemp_output[0];
$fp = fopen($new_conf, "w");
fwrite($fp, str_replace("\r\n", "\n", $_POST["v_config"]));
fclose($fp);
exec(
HESTIA_CMD . "v-change-sys-service-config " . $new_conf . " vsftpd " . $v_restart,
$output,
$return_var,
);
check_return_code($return_var, $output);
unset($output);
unlink($new_conf);
}
// Set success message
if (empty($_SESSION["error_msg"])) {
$_SESSION["ok_msg"] = _("Changes have been saved.");
}
}
$v_config_path = shell_exec(HESTIA_CMD . "v-list-sys-vsftpd-config plain");
$v_service_name = strtoupper("vsftpd");
// Read config
$v_config = shell_exec(HESTIA_CMD . "v-open-fs-config " . $v_config_path);
// Render page
render_page($user, $TAB, "edit_server_service");
// Flush session messages
unset($_SESSION["error_msg"]);
unset($_SESSION["ok_msg"]);

View File

@@ -0,0 +1,104 @@
<?php
use function Hestiacp\quoteshellarg\quoteshellarg;
$TAB = "SERVER";
// Main include
include $_SERVER["DOCUMENT_ROOT"] . "/inc/main.php";
// Check user
if ($_SESSION["userContext"] != "admin") {
header("Location: /list/user");
exit();
}
if (!empty($_POST)) {
if (!empty($_POST["v_app_name"]) && $_SESSION["APP_NAME"] != $_POST["v_app_name"]) {
exec(
HESTIA_CMD .
"v-change-sys-config-value APP_NAME " .
quoteshellarg($_POST["v_app_name"]),
$output,
$return_var,
);
}
if (!empty($_POST["v_title"]) && $_SESSION["TITLE"] != $_POST["v_title"]) {
exec(
HESTIA_CMD . "v-change-sys-config-value TITLE " . quoteshellarg($_POST["v_title"]),
$output,
$return_var,
);
}
if (
!empty($_POST["v_subject_email"]) &&
$_SESSION["SUBJECT_EMAIL"] != $_POST["v_subject_email"]
) {
exec(
HESTIA_CMD .
"v-change-sys-config-value SUBJECT_EMAIL " .
quoteshellarg($_POST["v_subject_email"]),
$output,
$return_var,
);
}
if (!empty($_POST["v_hide_docs"]) && $_SESSION["HIDE_DOCS"] != $_POST["v_hide_docs"]) {
exec(
HESTIA_CMD .
"v-change-sys-config-value HIDE_DOCS " .
quoteshellarg($_POST["v_hide_docs"]),
$output,
$return_var,
);
}
if (!empty($_POST["v_from_name"]) && $_SESSION["FROM_NAME"] != $_POST["v_from_name"]) {
exec(
HESTIA_CMD .
"v-change-sys-config-value FROM_NAME " .
quoteshellarg($_POST["v_from_name"]),
$output,
$return_var,
);
}
if (!empty($_POST["v_from_email"]) && $_SESSION["FROM_EMAIL"] != $_POST["v_from_email"]) {
exec(
HESTIA_CMD .
"v-change-sys-config-value FROM_EMAIL " .
quoteshellarg($_POST["v_from_email"]),
$output,
$return_var,
);
}
if (!empty($_POST["v_hide_docs"]) && $_SESSION["HIDE_DOCS"] != $_POST["v_hide_docs"]) {
exec(
HESTIA_CMD .
"v-change-sys-config-value HIDE_DOCS " .
quoteshellarg($_POST["v_hide_docs"]),
$output,
$return_var,
);
}
}
// Check system configuration
exec(HESTIA_CMD . "v-list-sys-config json", $output, $return_var);
$data = json_decode(implode("", $output), true);
unset($output);
$sys_arr = $data["config"];
foreach ($sys_arr as $key => $value) {
$_SESSION[$key] = $value;
}
$v_title = $_SESSION["TITLE"];
$v_app_name = $_SESSION["APP_NAME"];
$v_hide_docs = $_SESSION["HIDE_DOCS"];
$v_from_name = $_SESSION["FROM_NAME"];
$v_from_email = $_SESSION["FROM_EMAIL"];
$v_subject_email = $_SESSION["SUBJECT_EMAIL"];
// Render page
render_page($user, $TAB, "edit_whitelabel");
// Flush session messages
unset($_SESSION["error_msg"]);
unset($_SESSION["ok_msg"]);