parent
14af530339
commit
93ccae3f18
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
use function Hestiacp\quoteshellarg\quoteshellarg;
|
||||
|
||||
$TAB = "EXTMODULES";
|
||||
|
||||
// Main include
|
||||
include $_SERVER["DOCUMENT_ROOT"] . "/inc/main.php";
|
||||
|
||||
// Check user
|
||||
if ($_SESSION["userContext"] != "admin") {
|
||||
header("Location: /list/user");
|
||||
exit();
|
||||
}
|
||||
|
||||
exec(HESTIA_CMD . "v-ext-modules state php_brepo_modules 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["ver"])) && ($_GET["ver"] != "")) {
|
||||
if (!empty($_GET["save"])){
|
||||
|
||||
}
|
||||
$php_vers = $_GET["ver"];
|
||||
$ver_quoted = quoteshellarg($_GET["ver"]);
|
||||
exec(HESTIA_CMD . "v-ext-modules-run php_brepo_modules php_modules " . $ver_quoted . " json", $output, $return_var);
|
||||
$phps_modules = [];
|
||||
if ($return_var == 0) {
|
||||
$phps_modules = json_decode(implode("", $output), true);
|
||||
} else {
|
||||
$error_message = $output;
|
||||
}
|
||||
|
||||
unset($output);
|
||||
|
||||
// Render page
|
||||
render_page($user, $TAB, "extmodules/extmodules_php_brepo_modules_list");
|
||||
} else {
|
||||
// Data
|
||||
exec(HESTIA_CMD . "v-ext-modules-run php_brepo_modules php_list json", $output, $return_var);
|
||||
$phps = [];
|
||||
if ($return_var == 0) {
|
||||
$phps = json_decode(implode("", $output), true);
|
||||
ksort($phps);
|
||||
} else {
|
||||
$error_message = $output;
|
||||
}
|
||||
|
||||
unset($output);
|
||||
|
||||
// Render page
|
||||
render_page($user, $TAB, "extmodules/extmodules_php_brepo_modules");
|
||||
}
|
||||
|
||||
// Back uri
|
||||
$_SESSION["back"] = $_SERVER["REQUEST_URI"];
|
@ -0,0 +1,62 @@
|
||||
<!-- Begin toolbar -->
|
||||
<div class="toolbar">
|
||||
<div class="toolbar-inner">
|
||||
<div class="toolbar-buttons">
|
||||
<a class="button button-secondary button-back js-button-back" href="/list/server/">
|
||||
<i class="fas fa-arrow-left icon-blue"></i><?= _("Back") ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End toolbar -->
|
||||
|
||||
<div class="container">
|
||||
|
||||
<?php
|
||||
if (!empty($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
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
<h1 class="u-text-center u-hide-desktop u-mt20 u-pr30 u-mb20 u-pl30"><?= _("Available PHP list") ?></h1>
|
||||
|
||||
<div class="units-table js-units-container">
|
||||
<div class="units-table-header">
|
||||
|
||||
<div class="units-table-cell" style="width: 60%;"><?= _("PHP version") ?></div>
|
||||
<div class="units-table-cell u-text-center"><?= _("Modules") ?></div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
foreach ($phps as $key => $value) {
|
||||
?>
|
||||
<div class="units-table-ro js-unit">
|
||||
<div class="units-table-cell u-text-center" style="width: 60%;">
|
||||
<span class="u-hide-desktop"><?= _("PHP version") ?>:</span>
|
||||
<?php echo "PHP ".$phps[$key]["PHPVER"]; ?>
|
||||
</div>
|
||||
<div class="units-table-cell u-text-center-desktop">
|
||||
<span class="u-hide-desktop"><?= _("Modules") ?>:</span>
|
||||
<a href="/extm/php_brepo_modules/edit/?ver=<?= urlencode($phps[$key]['PHPVER']) ?>" title="<?= $phps[$key]['PHPVER'] ?>">
|
||||
<?= _("Change PHP modules list") ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<footer class="app-footer">
|
||||
<div class="container app-footer-inner">
|
||||
<p>
|
||||
<?= _("PHP modules tunning") ?>
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
@ -0,0 +1,77 @@
|
||||
<!-- Begin toolbar -->
|
||||
<div class="toolbar">
|
||||
<div class="toolbar-inner">
|
||||
<div class="toolbar-buttons">
|
||||
<a class="button button-secondary button-back js-button-back" href="/list/server/">
|
||||
<i class="fas fa-arrow-left icon-blue"></i><?= _("Back") ?>
|
||||
</a>
|
||||
</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>
|
||||
<!-- End toolbar -->
|
||||
|
||||
<div class="container">
|
||||
|
||||
<?php
|
||||
if (!empty($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
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
<h1 class="u-text-center u-hide-desktop u-mt20 u-pr30 u-mb20 u-pl30"><?= _("Available modules list for version PHP") ?> <?= $php_vers ?></h1>
|
||||
|
||||
<form id="main-form" name="v_ruby_path" method="post">
|
||||
<div class="units-table js-units-container">
|
||||
<div class="units-table-header">
|
||||
|
||||
<div class="units-table-cell u-text-center"><?= _("PHP module name") ?></div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
foreach ($phps_modules as $key => $value) {
|
||||
?>
|
||||
<div class="units-table-ro js-unit">
|
||||
<div class="form-check">
|
||||
<input
|
||||
class="form-check-input"
|
||||
type="checkbox"
|
||||
name="v_php_module_name[]"
|
||||
id="v_php_module_name[]"
|
||||
<?= $phps_modules[$key]["STATE"] != "disabled" ? "checked" : "" ?>
|
||||
<?php
|
||||
if ($phps_modules[$key]["STATE"] != "disabled") {
|
||||
echo " value=\"" . $phps_modules[$key]["STATE"] . "\"";
|
||||
} else {
|
||||
echo " value=\"\"";
|
||||
}
|
||||
?>
|
||||
>
|
||||
<label for="v_policy_user_change_theme">
|
||||
<?= $phps_modules[$key]["MODNAME"] ?>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
<footer class="app-footer">
|
||||
<div class="container app-footer-inner">
|
||||
<p>
|
||||
<?= _("PHP modules list") ?>
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
Loading…
Reference in new issue