2010-01-27 08:54:31 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This file is part of the Froxlor project.
|
|
|
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
|
|
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
|
|
|
*
|
|
|
|
* For the full copyright and license information, please view the COPYING
|
|
|
|
* file that was distributed with this source code. You can also view the
|
|
|
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
|
|
|
*
|
|
|
|
* @copyright (c) the authors
|
|
|
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
|
|
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
|
|
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
|
|
|
* @package Panel
|
2011-05-04 09:59:20 +00:00
|
|
|
*
|
2010-01-27 08:54:31 +00:00
|
|
|
*/
|
|
|
|
define('AREA', 'admin');
|
2013-11-18 11:53:33 +00:00
|
|
|
require './lib/init.php';
|
2010-01-27 08:54:31 +00:00
|
|
|
|
2018-12-19 15:57:03 +00:00
|
|
|
use Froxlor\Database\Database;
|
2018-12-18 12:45:05 +00:00
|
|
|
use Froxlor\Api\Commands\PhpSettings as PhpSettings;
|
|
|
|
use Froxlor\Api\Commands\FpmDaemons as FpmDaemons;
|
|
|
|
|
2013-04-14 09:10:51 +00:00
|
|
|
if (isset($_POST['id'])) {
|
2010-01-27 08:54:31 +00:00
|
|
|
$id = intval($_POST['id']);
|
2013-04-14 09:10:51 +00:00
|
|
|
} elseif (isset($_GET['id'])) {
|
2010-01-27 08:54:31 +00:00
|
|
|
$id = intval($_GET['id']);
|
|
|
|
}
|
|
|
|
|
2013-04-14 09:10:51 +00:00
|
|
|
if ($page == 'overview') {
|
2018-12-21 11:24:07 +00:00
|
|
|
|
2013-04-14 09:10:51 +00:00
|
|
|
if ($action == '') {
|
2018-12-21 11:24:07 +00:00
|
|
|
|
2018-02-19 12:36:15 +00:00
|
|
|
try {
|
2018-12-11 09:12:37 +00:00
|
|
|
$json_result = PhpSettings::getLocal($userinfo, array(
|
|
|
|
'with_subdomains' => true
|
|
|
|
))->listing();
|
2018-02-19 12:36:15 +00:00
|
|
|
} catch (Exception $e) {
|
2018-12-21 10:22:03 +00:00
|
|
|
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
2018-02-19 12:36:15 +00:00
|
|
|
}
|
|
|
|
$result = json_decode($json_result, true)['data'];
|
|
|
|
|
2010-01-27 08:54:31 +00:00
|
|
|
$tablecontent = '';
|
2011-02-08 11:53:24 +00:00
|
|
|
$count = 0;
|
2018-02-19 12:36:15 +00:00
|
|
|
if (isset($result['count']) && $result['count'] > 0) {
|
|
|
|
foreach ($result['list'] as $row) {
|
|
|
|
if (isset($row['is_default']) && $row['is_default'] == true) {
|
|
|
|
$row['description'] = "<b>" . $row['description'] . "</b>";
|
2013-04-14 09:10:51 +00:00
|
|
|
}
|
2018-02-19 12:36:15 +00:00
|
|
|
$domains = "";
|
2018-12-11 10:45:39 +00:00
|
|
|
$subdomains_count = count($row['subdomains']);
|
2018-02-19 12:36:15 +00:00
|
|
|
foreach ($row['domains'] as $configdomain) {
|
|
|
|
$domains .= $configdomain . "<br>";
|
2013-04-14 09:10:51 +00:00
|
|
|
}
|
2018-12-21 11:24:07 +00:00
|
|
|
$count ++;
|
2018-12-11 09:12:37 +00:00
|
|
|
if ($subdomains_count == 0 && empty($domains)) {
|
|
|
|
$domains = $lng['admin']['phpsettings']['notused'];
|
|
|
|
}
|
2018-12-21 10:22:03 +00:00
|
|
|
eval("\$tablecontent.=\"" . \Froxlor\UI\Template::getTemplate("phpconfig/overview_overview") . "\";");
|
2010-01-27 08:54:31 +00:00
|
|
|
}
|
|
|
|
}
|
2018-12-21 11:24:07 +00:00
|
|
|
|
2018-12-21 10:22:03 +00:00
|
|
|
eval("echo \"" . \Froxlor\UI\Template::getTemplate("phpconfig/overview") . "\";");
|
2010-01-27 08:54:31 +00:00
|
|
|
}
|
2018-12-21 11:24:07 +00:00
|
|
|
|
2013-11-02 11:07:34 +00:00
|
|
|
if ($action == 'add') {
|
2018-12-21 11:24:07 +00:00
|
|
|
|
2018-01-07 13:55:25 +00:00
|
|
|
if ((int) $userinfo['change_serversettings'] == 1) {
|
2018-12-21 11:24:07 +00:00
|
|
|
|
2018-01-07 13:55:25 +00:00
|
|
|
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
2018-02-19 12:36:15 +00:00
|
|
|
try {
|
|
|
|
PhpSettings::getLocal($userinfo, $_POST)->add();
|
|
|
|
} catch (Exception $e) {
|
2018-12-21 10:22:03 +00:00
|
|
|
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
2010-01-27 08:54:31 +00:00
|
|
|
}
|
2018-12-21 10:22:03 +00:00
|
|
|
\Froxlor\UI\Response::redirectTo($filename, array(
|
2018-01-07 13:55:25 +00:00
|
|
|
'page' => $page,
|
|
|
|
's' => $s
|
|
|
|
));
|
2013-11-02 11:07:34 +00:00
|
|
|
} else {
|
2018-12-21 11:24:07 +00:00
|
|
|
|
2013-11-02 11:07:34 +00:00
|
|
|
$result_stmt = Database::query("SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = 1");
|
|
|
|
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
2018-12-21 11:24:07 +00:00
|
|
|
|
2018-01-07 13:55:25 +00:00
|
|
|
$fpmconfigs = '';
|
|
|
|
$configs = Database::query("SELECT * FROM `" . TABLE_PANEL_FPMDAEMONS . "` ORDER BY `description` ASC");
|
|
|
|
while ($row = $configs->fetch(PDO::FETCH_ASSOC)) {
|
|
|
|
$fpmconfigs .= makeoption($row['description'], $row['id'], 1, true, true);
|
|
|
|
}
|
2018-09-30 08:04:15 +00:00
|
|
|
|
2018-09-28 08:55:08 +00:00
|
|
|
$pm_select = makeoption('static', 'static', 'static', true, true);
|
2018-12-21 11:24:07 +00:00
|
|
|
$pm_select .= makeoption('dynamic', 'dynamic', 'static', true, true);
|
|
|
|
$pm_select .= makeoption('ondemand', 'ondemand', 'static', true, true);
|
|
|
|
|
2018-01-07 13:55:25 +00:00
|
|
|
$phpconfig_add_data = include_once dirname(__FILE__) . '/lib/formfields/admin/phpconfig/formfield.phpconfig_add.php';
|
2018-12-21 10:22:03 +00:00
|
|
|
$phpconfig_add_form = \Froxlor\UI\HtmlForm::genHTMLForm($phpconfig_add_data);
|
2018-12-21 11:24:07 +00:00
|
|
|
|
2015-06-10 12:59:38 +00:00
|
|
|
$title = $phpconfig_add_data['phpconfig_add']['title'];
|
|
|
|
$image = $phpconfig_add_data['phpconfig_add']['image'];
|
2018-12-21 11:24:07 +00:00
|
|
|
|
2018-12-21 10:22:03 +00:00
|
|
|
eval("echo \"" . \Froxlor\UI\Template::getTemplate("phpconfig/overview_add") . "\";");
|
2010-01-27 08:54:31 +00:00
|
|
|
}
|
2013-11-02 11:07:34 +00:00
|
|
|
} else {
|
2018-12-21 10:22:03 +00:00
|
|
|
\Froxlor\UI\Response::standard_error('nopermissionsorinvalidid');
|
2010-01-27 08:54:31 +00:00
|
|
|
}
|
|
|
|
}
|
2018-12-21 11:24:07 +00:00
|
|
|
|
2013-11-02 11:07:34 +00:00
|
|
|
if ($action == 'delete') {
|
2018-02-19 12:36:15 +00:00
|
|
|
|
|
|
|
try {
|
2018-12-21 11:24:07 +00:00
|
|
|
$json_result = PhpSettings::getLocal($userinfo, array(
|
|
|
|
'id' => $id
|
|
|
|
))->get();
|
2018-02-19 12:36:15 +00:00
|
|
|
} catch (Exception $e) {
|
2018-12-21 10:22:03 +00:00
|
|
|
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
2014-02-18 16:13:25 +00:00
|
|
|
}
|
2018-02-19 12:36:15 +00:00
|
|
|
$result = json_decode($json_result, true)['data'];
|
2018-12-21 11:24:07 +00:00
|
|
|
|
2018-01-07 13:55:25 +00:00
|
|
|
if ($result['id'] != 0 && $result['id'] == $id && (int) $userinfo['change_serversettings'] == 1 && $id != 1) // cannot delete the default php.config
|
|
|
|
{
|
2018-12-21 11:24:07 +00:00
|
|
|
|
2018-01-07 13:55:25 +00:00
|
|
|
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
2018-02-19 12:36:15 +00:00
|
|
|
try {
|
2018-12-21 11:24:07 +00:00
|
|
|
PhpSettings::getLocal($userinfo, array(
|
|
|
|
'id' => $id
|
|
|
|
))->delete();
|
2018-02-19 12:36:15 +00:00
|
|
|
} catch (Exception $e) {
|
2018-12-21 10:22:03 +00:00
|
|
|
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
2018-02-19 12:36:15 +00:00
|
|
|
}
|
2018-12-21 10:22:03 +00:00
|
|
|
\Froxlor\UI\Response::redirectTo($filename, array(
|
2018-01-07 13:55:25 +00:00
|
|
|
'page' => $page,
|
|
|
|
's' => $s
|
|
|
|
));
|
2013-11-02 11:07:34 +00:00
|
|
|
} else {
|
2018-01-07 13:55:25 +00:00
|
|
|
ask_yesno('phpsetting_reallydelete', $filename, array(
|
|
|
|
'id' => $id,
|
|
|
|
'page' => $page,
|
|
|
|
'action' => $action
|
|
|
|
), $result['description']);
|
2010-01-27 08:54:31 +00:00
|
|
|
}
|
2013-11-02 11:07:34 +00:00
|
|
|
} else {
|
2018-12-21 10:22:03 +00:00
|
|
|
\Froxlor\UI\Response::standard_error('nopermissionsorinvalidid');
|
2010-01-27 08:54:31 +00:00
|
|
|
}
|
|
|
|
}
|
2018-12-21 11:24:07 +00:00
|
|
|
|
2013-11-02 11:07:34 +00:00
|
|
|
if ($action == 'edit') {
|
2018-12-21 11:24:07 +00:00
|
|
|
|
2018-02-19 12:36:15 +00:00
|
|
|
try {
|
2018-12-21 11:24:07 +00:00
|
|
|
$json_result = PhpSettings::getLocal($userinfo, array(
|
|
|
|
'id' => $id
|
|
|
|
))->get();
|
2018-02-19 12:36:15 +00:00
|
|
|
} catch (Exception $e) {
|
2018-12-21 10:22:03 +00:00
|
|
|
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
2018-02-19 12:36:15 +00:00
|
|
|
}
|
|
|
|
$result = json_decode($json_result, true)['data'];
|
2018-12-21 11:24:07 +00:00
|
|
|
|
2018-01-07 13:55:25 +00:00
|
|
|
if ($result['id'] != 0 && $result['id'] == $id && (int) $userinfo['change_serversettings'] == 1) {
|
2018-12-21 11:24:07 +00:00
|
|
|
|
2018-01-07 13:55:25 +00:00
|
|
|
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
2018-02-19 12:36:15 +00:00
|
|
|
try {
|
|
|
|
PhpSettings::getLocal($userinfo, $_POST)->update();
|
|
|
|
} catch (Exception $e) {
|
2018-12-21 10:22:03 +00:00
|
|
|
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
2013-12-03 10:14:32 +00:00
|
|
|
}
|
2018-12-21 10:22:03 +00:00
|
|
|
\Froxlor\UI\Response::redirectTo($filename, array(
|
2018-01-07 13:55:25 +00:00
|
|
|
'page' => $page,
|
|
|
|
's' => $s
|
|
|
|
));
|
2013-11-02 11:07:34 +00:00
|
|
|
} else {
|
2018-12-21 11:24:07 +00:00
|
|
|
|
2018-01-07 13:55:25 +00:00
|
|
|
$fpmconfigs = '';
|
|
|
|
$configs = Database::query("SELECT * FROM `" . TABLE_PANEL_FPMDAEMONS . "` ORDER BY `description` ASC");
|
|
|
|
while ($row = $configs->fetch(PDO::FETCH_ASSOC)) {
|
2018-02-09 06:33:28 +00:00
|
|
|
$fpmconfigs .= makeoption($row['description'], $row['id'], $result['fpmsettingid'], true, true);
|
2018-01-07 13:55:25 +00:00
|
|
|
}
|
2018-09-30 08:04:15 +00:00
|
|
|
|
2018-09-28 08:55:08 +00:00
|
|
|
$pm_select = makeoption('static', 'static', $result['pm'], true, true);
|
2018-12-21 11:24:07 +00:00
|
|
|
$pm_select .= makeoption('dynamic', 'dynamic', $result['pm'], true, true);
|
|
|
|
$pm_select .= makeoption('ondemand', 'ondemand', $result['pm'], true, true);
|
2018-01-07 13:55:25 +00:00
|
|
|
|
|
|
|
$phpconfig_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/phpconfig/formfield.phpconfig_edit.php';
|
2018-12-21 10:22:03 +00:00
|
|
|
$phpconfig_edit_form = \Froxlor\UI\HtmlForm::genHTMLForm($phpconfig_edit_data);
|
2018-12-21 11:24:07 +00:00
|
|
|
|
2015-06-10 12:59:38 +00:00
|
|
|
$title = $phpconfig_edit_data['phpconfig_edit']['title'];
|
|
|
|
$image = $phpconfig_edit_data['phpconfig_edit']['image'];
|
2018-12-21 11:24:07 +00:00
|
|
|
|
2018-12-21 10:22:03 +00:00
|
|
|
eval("echo \"" . \Froxlor\UI\Template::getTemplate("phpconfig/overview_edit") . "\";");
|
2010-01-27 08:54:31 +00:00
|
|
|
}
|
2018-01-07 13:55:25 +00:00
|
|
|
} else {
|
2018-12-21 10:22:03 +00:00
|
|
|
\Froxlor\UI\Response::standard_error('nopermissionsorinvalidid');
|
2018-01-07 13:55:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} elseif ($page == 'fpmdaemons') {
|
2018-12-21 11:24:07 +00:00
|
|
|
|
2018-01-07 13:55:25 +00:00
|
|
|
if ($action == '') {
|
2018-02-19 12:58:39 +00:00
|
|
|
|
|
|
|
try {
|
2018-03-02 16:22:47 +00:00
|
|
|
$json_result = FpmDaemons::getLocal($userinfo)->listing();
|
2018-02-19 12:58:39 +00:00
|
|
|
} catch (Exception $e) {
|
2018-12-21 10:22:03 +00:00
|
|
|
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
2018-02-19 12:58:39 +00:00
|
|
|
}
|
|
|
|
$result = json_decode($json_result, true)['data'];
|
2018-12-21 11:24:07 +00:00
|
|
|
|
2018-01-07 13:55:25 +00:00
|
|
|
$tablecontent = '';
|
|
|
|
$count = 0;
|
2018-02-19 12:58:39 +00:00
|
|
|
if (isset($result['count']) && $result['count'] > 0) {
|
|
|
|
foreach ($result['list'] as $row) {
|
|
|
|
$configs = "";
|
|
|
|
foreach ($row['configs'] as $configused) {
|
|
|
|
$configs .= $configused . "<br>";
|
2018-01-07 13:55:25 +00:00
|
|
|
}
|
2018-12-21 11:24:07 +00:00
|
|
|
$count ++;
|
2018-12-21 10:22:03 +00:00
|
|
|
eval("\$tablecontent.=\"" . \Froxlor\UI\Template::getTemplate("phpconfig/fpmdaemons_overview") . "\";");
|
2018-01-07 13:55:25 +00:00
|
|
|
}
|
|
|
|
}
|
2018-12-21 10:22:03 +00:00
|
|
|
eval("echo \"" . \Froxlor\UI\Template::getTemplate("phpconfig/fpmdaemons") . "\";");
|
2018-01-07 13:55:25 +00:00
|
|
|
}
|
2018-12-21 11:24:07 +00:00
|
|
|
|
2018-01-07 13:55:25 +00:00
|
|
|
if ($action == 'add') {
|
2018-12-21 11:24:07 +00:00
|
|
|
|
2018-01-07 13:55:25 +00:00
|
|
|
if ((int) $userinfo['change_serversettings'] == 1) {
|
2018-12-21 11:24:07 +00:00
|
|
|
|
2018-01-07 13:55:25 +00:00
|
|
|
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
2018-02-19 12:58:39 +00:00
|
|
|
try {
|
|
|
|
FpmDaemons::getLocal($userinfo, $_POST)->add();
|
|
|
|
} catch (Exception $e) {
|
2018-12-21 10:22:03 +00:00
|
|
|
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
2018-01-07 13:55:25 +00:00
|
|
|
}
|
2018-12-21 10:22:03 +00:00
|
|
|
\Froxlor\UI\Response::redirectTo($filename, array(
|
2018-01-07 13:55:25 +00:00
|
|
|
'page' => $page,
|
|
|
|
's' => $s
|
|
|
|
));
|
|
|
|
} else {
|
2018-12-21 11:24:07 +00:00
|
|
|
|
2018-01-07 13:55:25 +00:00
|
|
|
$pm_select = makeoption('static', 'static', 'static', true, true);
|
2018-02-19 12:36:15 +00:00
|
|
|
$pm_select .= makeoption('dynamic', 'dynamic', 'static', true, true);
|
|
|
|
$pm_select .= makeoption('ondemand', 'ondemand', 'static', true, true);
|
2018-12-21 11:24:07 +00:00
|
|
|
|
2018-01-07 13:55:25 +00:00
|
|
|
$fpmconfig_add_data = include_once dirname(__FILE__) . '/lib/formfields/admin/phpconfig/formfield.fpmconfig_add.php';
|
2018-12-21 10:22:03 +00:00
|
|
|
$fpmconfig_add_form = \Froxlor\UI\HtmlForm::genHTMLForm($fpmconfig_add_data);
|
2018-12-21 11:24:07 +00:00
|
|
|
|
2018-01-07 13:55:25 +00:00
|
|
|
$title = $fpmconfig_add_data['fpmconfig_add']['title'];
|
|
|
|
$image = $fpmconfig_add_data['fpmconfig_add']['image'];
|
2018-12-21 11:24:07 +00:00
|
|
|
|
2018-12-21 10:22:03 +00:00
|
|
|
eval("echo \"" . \Froxlor\UI\Template::getTemplate("phpconfig/fpmconfig_add") . "\";");
|
2018-01-07 13:55:25 +00:00
|
|
|
}
|
|
|
|
} else {
|
2018-12-21 10:22:03 +00:00
|
|
|
\Froxlor\UI\Response::standard_error('nopermissionsorinvalidid');
|
2018-01-07 13:55:25 +00:00
|
|
|
}
|
|
|
|
}
|
2018-12-21 11:24:07 +00:00
|
|
|
|
2018-01-07 13:55:25 +00:00
|
|
|
if ($action == 'delete') {
|
2018-12-21 11:24:07 +00:00
|
|
|
|
2018-02-19 12:58:39 +00:00
|
|
|
try {
|
2018-12-21 11:24:07 +00:00
|
|
|
$json_result = FpmDaemons::getLocal($userinfo, array(
|
|
|
|
'id' => $id
|
|
|
|
))->get();
|
2018-02-19 12:58:39 +00:00
|
|
|
} catch (Exception $e) {
|
2018-12-21 10:22:03 +00:00
|
|
|
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
2018-02-19 12:58:39 +00:00
|
|
|
}
|
|
|
|
$result = json_decode($json_result, true)['data'];
|
2018-12-21 11:24:07 +00:00
|
|
|
|
2018-01-07 13:55:25 +00:00
|
|
|
if ($id == 1) {
|
2018-12-21 10:22:03 +00:00
|
|
|
\Froxlor\UI\Response::standard_error('cannotdeletedefaultphpconfig');
|
2018-01-07 13:55:25 +00:00
|
|
|
}
|
2018-12-21 11:24:07 +00:00
|
|
|
|
2018-01-07 13:55:25 +00:00
|
|
|
if ($result['id'] != 0 && $result['id'] == $id && (int) $userinfo['change_serversettings'] == 1 && $id != 1) // cannot delete the default php.config
|
|
|
|
{
|
|
|
|
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
2018-02-19 12:58:39 +00:00
|
|
|
try {
|
|
|
|
FpmDaemons::getLocal($userinfo, $_POST)->delete();
|
|
|
|
} catch (Exception $e) {
|
2018-12-21 10:22:03 +00:00
|
|
|
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
2018-02-19 12:58:39 +00:00
|
|
|
}
|
2018-12-21 10:22:03 +00:00
|
|
|
\Froxlor\UI\Response::redirectTo($filename, array(
|
2018-01-07 13:55:25 +00:00
|
|
|
'page' => $page,
|
|
|
|
's' => $s
|
|
|
|
));
|
|
|
|
} else {
|
|
|
|
ask_yesno('fpmsetting_reallydelete', $filename, array(
|
|
|
|
'id' => $id,
|
|
|
|
'page' => $page,
|
|
|
|
'action' => $action
|
|
|
|
), $result['description']);
|
|
|
|
}
|
|
|
|
} else {
|
2018-12-21 10:22:03 +00:00
|
|
|
\Froxlor\UI\Response::standard_error('nopermissionsorinvalidid');
|
2018-01-07 13:55:25 +00:00
|
|
|
}
|
|
|
|
}
|
2018-12-21 11:24:07 +00:00
|
|
|
|
2018-01-07 13:55:25 +00:00
|
|
|
if ($action == 'edit') {
|
2018-12-21 11:24:07 +00:00
|
|
|
|
2018-02-19 12:58:39 +00:00
|
|
|
try {
|
2018-12-21 11:24:07 +00:00
|
|
|
$json_result = FpmDaemons::getLocal($userinfo, array(
|
|
|
|
'id' => $id
|
|
|
|
))->get();
|
2018-02-19 12:58:39 +00:00
|
|
|
} catch (Exception $e) {
|
2018-12-21 10:22:03 +00:00
|
|
|
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
2018-02-19 12:58:39 +00:00
|
|
|
}
|
|
|
|
$result = json_decode($json_result, true)['data'];
|
2018-12-21 11:24:07 +00:00
|
|
|
|
2018-01-07 13:55:25 +00:00
|
|
|
if ($result['id'] != 0 && $result['id'] == $id && (int) $userinfo['change_serversettings'] == 1) {
|
2018-12-21 11:24:07 +00:00
|
|
|
|
2018-01-07 13:55:25 +00:00
|
|
|
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
2018-02-19 12:58:39 +00:00
|
|
|
try {
|
|
|
|
FpmDaemons::getLocal($userinfo, $_POST)->update();
|
|
|
|
} catch (Exception $e) {
|
2018-12-21 10:22:03 +00:00
|
|
|
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
2018-01-07 13:55:25 +00:00
|
|
|
}
|
2018-12-21 10:22:03 +00:00
|
|
|
\Froxlor\UI\Response::redirectTo($filename, array(
|
2018-01-07 13:55:25 +00:00
|
|
|
'page' => $page,
|
|
|
|
's' => $s
|
|
|
|
));
|
|
|
|
} else {
|
2018-12-21 11:24:07 +00:00
|
|
|
|
2018-01-07 13:55:25 +00:00
|
|
|
$pm_select = makeoption('static', 'static', $result['pm'], true, true);
|
2018-02-19 12:36:15 +00:00
|
|
|
$pm_select .= makeoption('dynamic', 'dynamic', $result['pm'], true, true);
|
|
|
|
$pm_select .= makeoption('ondemand', 'ondemand', $result['pm'], true, true);
|
2018-12-21 11:24:07 +00:00
|
|
|
|
2018-01-07 13:55:25 +00:00
|
|
|
$fpmconfig_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/phpconfig/formfield.fpmconfig_edit.php';
|
2018-12-21 10:22:03 +00:00
|
|
|
$fpmconfig_edit_form = \Froxlor\UI\HtmlForm::genHTMLForm($fpmconfig_edit_data);
|
2018-12-21 11:24:07 +00:00
|
|
|
|
2018-01-07 13:55:25 +00:00
|
|
|
$title = $fpmconfig_edit_data['fpmconfig_edit']['title'];
|
|
|
|
$image = $fpmconfig_edit_data['fpmconfig_edit']['image'];
|
2018-12-21 11:24:07 +00:00
|
|
|
|
2018-12-21 10:22:03 +00:00
|
|
|
eval("echo \"" . \Froxlor\UI\Template::getTemplate("phpconfig/fpmconfig_edit") . "\";");
|
2018-01-07 13:55:25 +00:00
|
|
|
}
|
2013-11-02 11:07:34 +00:00
|
|
|
} else {
|
2018-12-21 10:22:03 +00:00
|
|
|
\Froxlor\UI\Response::standard_error('nopermissionsorinvalidid');
|
2010-01-27 08:54:31 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|