|
|
@@ -0,0 +1,44 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+$TAB = "SERVER";
|
|
|
+
|
|
|
+// Main include
|
|
|
+include $_SERVER["DOCUMENT_ROOT"] . "/inc/main.php";
|
|
|
+
|
|
|
+// Check user
|
|
|
+if ($_SESSION["userContext"] !== "admin" && $user_plain === "$ROOT_USER") {
|
|
|
+ header("Location: /list/user");
|
|
|
+ exit();
|
|
|
+}
|
|
|
+
|
|
|
+// Check POST request
|
|
|
+if (!empty($_POST["save"])) {
|
|
|
+ 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 . " hestiaweb no",
|
|
|
+ $output,
|
|
|
+ $return_var,
|
|
|
+ );
|
|
|
+ check_return_code($return_var, $output);
|
|
|
+ unset($output);
|
|
|
+ unlink($new_conf);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+$v_config_path = "/var/spool/cron/crontabs/hestiaweb";
|
|
|
+$v_service_name = _("Panel Cronjobs");
|
|
|
+
|
|
|
+// 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"]);
|