Added passeneg manager. Part 2
This commit is contained in:
@@ -2105,7 +2105,7 @@ cat $tmpfile
|
|||||||
rm -f $tmpfile
|
rm -f $tmpfile
|
||||||
|
|
||||||
# Add welcome message to notification panel
|
# Add welcome message to notification panel
|
||||||
$HESTIA/bin/v-add-user-notification admin 'Welcome to Hestia Control Panel!' '<p>You are now ready to begin adding <a href="/add/user/">user accounts</a> and <a href="/add/web/">domains</a>. For help and assistance, <a href="https://hestiacp.com/docs/" target="_blank">view the documentation</a> or <a href="https://forum.hestiacp.com/" target="_blank">visit our forum</a>.</p><p>Please <a href="https://github.com/hestiacp/hestiacp/issues" target="_blank">report any issues via GitHub</a>.</p><p class="u-text-bold">Have a wonderful day!</p><p><i class="fas fa-heart icon-red"></i> The Hestia Control Panel development team</p>'
|
$HESTIA/bin/v-add-user-notification admin 'Добро пожаловать в HestiaCP' '<p>Перйдите по ссылке для добавления <a href="/add/user/">пользователя</a> и <a href="/add/web/">домена</a>. Для получения информации ознакомтесь с <a href="https://hestiadocs.brepo.ru/docs/" target="_blank">документацией</a>.</p><p class="u-text-bold">Желаем удачного дня!</p><p><i class="fas fa-heart icon-red"></i> Команда разработчиков HestiaCP</p>'
|
||||||
|
|
||||||
# Clean-up
|
# Clean-up
|
||||||
# Sort final configuration file
|
# Sort final configuration file
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
use function Hestiacp\quoteshellarg\quoteshellarg;
|
||||||
|
|
||||||
$TAB = "EXTMODULES";
|
$TAB = "EXTMODULES";
|
||||||
|
|
||||||
// Main include
|
// Main include
|
||||||
@@ -10,10 +12,42 @@ if ($_SESSION["userContext"] != "admin") {
|
|||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
exec(HESTIA_CMD . "v-ext-modules state passenger_manager json", $output, $return_var);
|
||||||
|
$check_passenger_enabled = json_decode(implode("", $output), true);
|
||||||
|
if (($return_var != 0) || (empty($check_passenger_enabled)) || ($check_passenger_enabled[0]["STATE"] != "enabled")){
|
||||||
|
header("Location: /list/extmodules/");
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
unset($output);
|
||||||
|
|
||||||
|
$error_message = "";
|
||||||
|
if ((!empty($_GET["del"])) && ($_GET["del"] != "")) {
|
||||||
|
//Delete item
|
||||||
|
$path = quoteshellarg($_GET["del"]);
|
||||||
|
exec(HESTIA_CMD . "v-ext-modules-run passenger_manager del_ruby " . $path, $output, $return_var);
|
||||||
|
if ($return_var != 0){
|
||||||
|
$error_message = $output;
|
||||||
|
}
|
||||||
|
unset($output);
|
||||||
|
} else if ((!empty($_GET["add"])) && ($_GET["add"] != "")) {
|
||||||
|
//Delete item
|
||||||
|
$path = quoteshellarg($_GET["add"]);
|
||||||
|
exec(HESTIA_CMD . "v-ext-modules-run passenger_manager add_ruby " . $path, $output, $return_var);
|
||||||
|
if ($return_var != 0){
|
||||||
|
$error_message = $output;
|
||||||
|
}
|
||||||
|
unset($output);
|
||||||
|
}
|
||||||
|
|
||||||
// Data
|
// Data
|
||||||
exec(HESTIA_CMD . "v-ext-modules-run passenger_manager get_rubys json", $output, $return_var);
|
exec(HESTIA_CMD . "v-ext-modules-run passenger_manager get_rubys json", $output, $return_var);
|
||||||
$rubys = json_decode(implode("", $output), true);
|
$rubys = [];
|
||||||
ksort($rubys);
|
if ($return_var != 0) {
|
||||||
|
$rubys = json_decode(implode("", $output), true);
|
||||||
|
ksort($rubys);
|
||||||
|
} else {
|
||||||
|
$error_message = $output;
|
||||||
|
}
|
||||||
|
|
||||||
unset($output);
|
unset($output);
|
||||||
|
|
||||||
|
|||||||
@@ -6,20 +6,69 @@
|
|||||||
<i class="fas fa-arrow-left icon-blue"></i><?= _("Back") ?>
|
<i class="fas fa-arrow-left icon-blue"></i><?= _("Back") ?>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="toolbar-buttons">
|
||||||
|
<button type="submit" class="button" form="main-form">
|
||||||
|
<i class="fas fa-floppy-disk icon-purple"></i><?= _("Save") ?>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- End toolbar -->
|
<!-- End toolbar -->
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
|
||||||
<h1 class="u-text-center u-hide-desktop u-mt20 u-pr30 u-mb20 u-pl30"><?= _("Passenger manager") ?></h1>
|
<?php
|
||||||
|
if ($error_message != "") {
|
||||||
|
?>
|
||||||
|
<div class="u-text-center inline-alert inline-alert-danger u-mb20" role="alert">
|
||||||
|
<i class="fas fa-circle-exclamation"></i>
|
||||||
|
<p><?= $error_message ?></p>
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
<h2 class="u-text-center u-mt20 u-pr30 u-mb20 u-pl30"><?= _("Passenger manager") ?></h2>
|
||||||
|
|
||||||
|
<form id="main-form" name="v_ruby_path" method="get">
|
||||||
|
<div>
|
||||||
|
<!-- Basic options section -->
|
||||||
|
<details class="collapse u-mb10">
|
||||||
|
<summary class="collapse-header">
|
||||||
|
<i class="fas fa-folder-open u-mr10"></i><?= _("Add new ruby path") ?>
|
||||||
|
</summary>
|
||||||
|
<div class="collapse-content">
|
||||||
|
<div class="u-mb10">
|
||||||
|
<label for="v_path" class="form-label">
|
||||||
|
<?= _("Path") ?>
|
||||||
|
</label>
|
||||||
|
<input type="text" class="form-control" name="add" id="v_path" value="">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</details>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
<p>Ruby list</p>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
foreach ($rubys as $key => $value) {
|
||||||
|
?>
|
||||||
|
<div class="u-text-center card-content">
|
||||||
|
<?= $value["RUBY"] ?> <a class="data-controls js-confirm-action"
|
||||||
|
href="/extm/passenger_manager/edit/?del=<?= urlencode($value["RUBY"]) ?>"
|
||||||
|
title="<?= $value["RUBY"] ?>"
|
||||||
|
data-confirm-title="<?= _("Are you sure you want to delete item?") ?>"
|
||||||
|
data-confirm-message="<?= $value["RUBY"] ?>"><i class="fas fa-trash-can icon-red"></i></a>
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<footer class="app-footer">
|
<footer class="app-footer">
|
||||||
<div class="container app-footer-inner">
|
<div class="container app-footer-inner">
|
||||||
<p>
|
<p>
|
||||||
<?= _("Extended modules list") ?>
|
<?= _("Ruby available list") ?>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
Reference in New Issue
Block a user