Added passeneg manager. Part 4
This commit is contained in:
@@ -205,7 +205,6 @@ if (($return_var == 0) && (!empty($check_passenger_enabled)) && ($check_passenge
|
||||
}
|
||||
}
|
||||
}
|
||||
unset($output);
|
||||
|
||||
// Check POST request
|
||||
if (!empty($_POST["save"])) {
|
||||
@@ -220,6 +219,32 @@ if (!empty($_POST["save"])) {
|
||||
$v_newip = "";
|
||||
$v_newip_public = "";
|
||||
|
||||
$changed_ruby = false;
|
||||
|
||||
// Save ruby setting for domain
|
||||
if (!empty($_POST["v_passenger_enabled"])){
|
||||
$v_ruby_path = $_POST["v_ruby_path"];
|
||||
if ($v_ruby_path != $domain_ruby["RUBY"]){
|
||||
exec(HESTIA_CMD . "v-ext-modules-run passenger_manager set_user_ruby " . quoteshellarg($v_domain) . " ". quoteshellarg($v_ruby_path), $output, $return_var);
|
||||
check_return_code($return_var, $output);
|
||||
$restart_web = "yes";
|
||||
$restart_proxy = "yes";
|
||||
unset($output);
|
||||
$changed_ruby = true;
|
||||
}
|
||||
} else {
|
||||
if ($passenger_state == "enabled"){
|
||||
if ($domain_ruby["RUBY"] != ""){
|
||||
exec(HESTIA_CMD . "v-ext-modules-run passenger_manager disable_user " . quoteshellarg($v_domain), $output, $return_var);
|
||||
check_return_code($return_var, $output);
|
||||
$restart_web = "yes";
|
||||
$restart_proxy = "yes";
|
||||
unset($output);
|
||||
$changed_ruby = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($_POST["v_ip"])) {
|
||||
$v_newip = $_POST["v_ip"];
|
||||
$v_newip_public = empty($ips[$v_newip]["NAT"]) ? $v_newip : $ips[$v_newip]["NAT"];
|
||||
|
||||
@@ -475,7 +475,12 @@ if ($passenger_state == "enabled") {
|
||||
<div x-cloak x-show="showPassenger">
|
||||
<?php if ($_SESSION["userContext"] === "admin") { ?>
|
||||
<div class="form-check u-mb10">
|
||||
<input class="form-check-input" type="checkbox" name="v_passenger_enabled" id="v_passenger_enabled">
|
||||
<input class="form-check-input" type="checkbox" name="v_passenger_enabled" id="v_passenger_enabled"
|
||||
<?php
|
||||
if ($domain_ruby["RUBY"] != "") {
|
||||
echo "checked";
|
||||
}
|
||||
?> >
|
||||
<label for="v_passenger_enabled">
|
||||
<?= _("Enable passenger for domain") ?>
|
||||
</label>
|
||||
@@ -488,7 +493,7 @@ if ($passenger_state == "enabled") {
|
||||
<?php
|
||||
foreach ($rubys as $key => $value) {
|
||||
echo "\t\t\t\t<option value=\"".htmlentities($value["RUBY"])."\"";
|
||||
if ((!empty($domain_ruby)) && ( $value["RUBY"] == $domain_ruby[0]["RUBY"] )){
|
||||
if ((!empty($domain_ruby)) && ( $value["RUBY"] == $domain_ruby["RUBY"] )){
|
||||
echo ' selected' ;
|
||||
}
|
||||
echo ">".htmlentities($value["RUBY"])."</option>\n";
|
||||
|
||||
Reference in New Issue
Block a user