Added passeneg manager. Part 3

This commit is contained in:
Alexey Berezhok
2024-12-14 23:10:43 +03:00
parent 455223af4b
commit a2988a71d7
4 changed files with 65 additions and 4 deletions

View File

@@ -184,10 +184,26 @@ $stats = json_decode(implode("", $output), true);
unset($output);
//Check if passenger enabled
$passenger_state = "disabled";
exec(HESTIA_CMD . "v-ext-modules state passenger_manager json", $output, $return_var);
$check_passenger_enabled = json_decode(implode("", $output), true);
unset($output);
if (($return_var == 0) && (!empty($check_passenger_enabled)) && ($check_passenger_enabled[0]["STATE"] == "enabled")){
//TODO
$passenger_state = "enabled";
exec(HESTIA_CMD . "v-ext-modules-run passenger_manager get_rubys json", $output, $return_var);
$rubys = json_decode(implode("", $output), true);
unset($output);
if ($return_var != 0){
$passenger_state = "disabled";
} else {
$ruby_domain = quoteshellarg($v_domain);
exec(HESTIA_CMD . "v-ext-modules-run passenger_manager get_user_ruby " . $ruby_domain . " json", $output, $return_var);
$domain_ruby = json_decode(implode("", $output), true);
unset($output);
if ($return_var != 0){
$passenger_state = "disabled";
}
}
}
unset($output);
@@ -431,6 +447,7 @@ if (!empty($_POST["save"])) {
if (!empty($_POST["v_proxy_template"])) {
$v_proxy_template = $_POST["v_proxy_template"];
}
$v_proxy_port = "0";
if (!empty($_POST["v_proxy_port"])) {
$v_proxy_port = $_POST["v_proxy_port"];
}