From 9036a02b5b69da3e41646c1a8e88d8e210a30aa4 Mon Sep 17 00:00:00 2001 From: Alexey Berezhok Date: Thu, 26 Dec 2024 22:58:36 +0300 Subject: [PATCH] Added passeneg manager. Part 10 --- web/edit/web/index.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/web/edit/web/index.php b/web/edit/web/index.php index cd15121..f17a5c7 100644 --- a/web/edit/web/index.php +++ b/web/edit/web/index.php @@ -184,6 +184,7 @@ $stats = json_decode(implode("", $output), true); unset($output); //Check if passenger enabled +$ruby_enabled = false; $passenger_state = "disabled"; exec(HESTIA_CMD . "v-ext-modules state passenger_manager json", $output, $return_var); $check_passenger_enabled = json_decode(implode("", $output), true); @@ -202,6 +203,10 @@ if (($return_var == 0) && (!empty($check_passenger_enabled)) && ($check_passenge unset($output); if ($return_var != 0){ $passenger_state = "disabled"; + } else { + if (trim($domain_ruby[0]["RUBY"]) != ""){ + $ruby_enabled = true; + } } } } @@ -220,6 +225,7 @@ if (!empty($_POST["save"])) { $v_newip_public = ""; $changed_ruby = false; + $ruby_tpl = "default"; // Save ruby setting for domain if (!empty($_POST["v_passenger_enabled"])){ @@ -231,6 +237,7 @@ if (!empty($_POST["save"])) { $restart_proxy = "yes"; unset($output); $changed_ruby = true; + $ruby_tpl = "passenger"; } } else { if ($passenger_state == "enabled"){ @@ -251,7 +258,7 @@ if (!empty($_POST["save"])) { " " . quoteshellarg($v_domain) . " " . - "passenger", + quoteshellarg($ruby_tpl), $output, $return_var); check_return_code($return_var, $output); $restart_web = "yes"; @@ -448,6 +455,7 @@ if (!empty($_POST["save"])) { } // Delete proxy support + if (!$ruby_enabled) { if ( !empty($_SESSION["PROXY_SYSTEM"]) && !empty($v_proxy) && @@ -553,6 +561,7 @@ if (!empty($_POST["save"])) { unset($output); $restart_proxy = "yes"; } + } } // Change aliases if (empty($_SESSION["error_msg"])) {