auto-format all files; add table-definitions to test-bootstrap file
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -30,9 +30,9 @@ if (isset($_POST['id'])) {
|
||||
}
|
||||
|
||||
if ($page == 'overview') {
|
||||
|
||||
|
||||
if ($action == '') {
|
||||
|
||||
|
||||
try {
|
||||
$json_result = PhpSettings::getLocal($userinfo, array(
|
||||
'with_subdomains' => true
|
||||
@@ -54,21 +54,21 @@ if ($page == 'overview') {
|
||||
foreach ($row['domains'] as $configdomain) {
|
||||
$domains .= $configdomain . "<br>";
|
||||
}
|
||||
$count++;
|
||||
$count ++;
|
||||
if ($subdomains_count == 0 && empty($domains)) {
|
||||
$domains = $lng['admin']['phpsettings']['notused'];
|
||||
}
|
||||
eval("\$tablecontent.=\"" . \Froxlor\UI\Template::getTemplate("phpconfig/overview_overview") . "\";");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
eval("echo \"" . \Froxlor\UI\Template::getTemplate("phpconfig/overview") . "\";");
|
||||
}
|
||||
|
||||
|
||||
if ($action == 'add') {
|
||||
|
||||
|
||||
if ((int) $userinfo['change_serversettings'] == 1) {
|
||||
|
||||
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
try {
|
||||
PhpSettings::getLocal($userinfo, $_POST)->add();
|
||||
@@ -80,10 +80,10 @@ if ($page == 'overview') {
|
||||
's' => $s
|
||||
));
|
||||
} else {
|
||||
|
||||
|
||||
$result_stmt = Database::query("SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = 1");
|
||||
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
|
||||
$fpmconfigs = '';
|
||||
$configs = Database::query("SELECT * FROM `" . TABLE_PANEL_FPMDAEMONS . "` ORDER BY `description` ASC");
|
||||
while ($row = $configs->fetch(PDO::FETCH_ASSOC)) {
|
||||
@@ -91,37 +91,41 @@ if ($page == 'overview') {
|
||||
}
|
||||
|
||||
$pm_select = makeoption('static', 'static', 'static', true, true);
|
||||
$pm_select.= makeoption('dynamic', 'dynamic', 'static', true, true);
|
||||
$pm_select.= makeoption('ondemand', 'ondemand', 'static', true, true);
|
||||
|
||||
$pm_select .= makeoption('dynamic', 'dynamic', 'static', true, true);
|
||||
$pm_select .= makeoption('ondemand', 'ondemand', 'static', true, true);
|
||||
|
||||
$phpconfig_add_data = include_once dirname(__FILE__) . '/lib/formfields/admin/phpconfig/formfield.phpconfig_add.php';
|
||||
$phpconfig_add_form = \Froxlor\UI\HtmlForm::genHTMLForm($phpconfig_add_data);
|
||||
|
||||
|
||||
$title = $phpconfig_add_data['phpconfig_add']['title'];
|
||||
$image = $phpconfig_add_data['phpconfig_add']['image'];
|
||||
|
||||
|
||||
eval("echo \"" . \Froxlor\UI\Template::getTemplate("phpconfig/overview_add") . "\";");
|
||||
}
|
||||
} else {
|
||||
\Froxlor\UI\Response::standard_error('nopermissionsorinvalidid');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($action == 'delete') {
|
||||
|
||||
try {
|
||||
$json_result = PhpSettings::getLocal($userinfo, array('id' => $id))->get();
|
||||
$json_result = PhpSettings::getLocal($userinfo, array(
|
||||
'id' => $id
|
||||
))->get();
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
||||
}
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
|
||||
|
||||
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') {
|
||||
try {
|
||||
PhpSettings::getLocal($userinfo, array('id' => $id))->delete();
|
||||
PhpSettings::getLocal($userinfo, array(
|
||||
'id' => $id
|
||||
))->delete();
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
||||
}
|
||||
@@ -140,18 +144,20 @@ if ($page == 'overview') {
|
||||
\Froxlor\UI\Response::standard_error('nopermissionsorinvalidid');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($action == 'edit') {
|
||||
|
||||
|
||||
try {
|
||||
$json_result = PhpSettings::getLocal($userinfo, array('id' => $id))->get();
|
||||
$json_result = PhpSettings::getLocal($userinfo, array(
|
||||
'id' => $id
|
||||
))->get();
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
||||
}
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
|
||||
|
||||
if ($result['id'] != 0 && $result['id'] == $id && (int) $userinfo['change_serversettings'] == 1) {
|
||||
|
||||
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
try {
|
||||
PhpSettings::getLocal($userinfo, $_POST)->update();
|
||||
@@ -163,7 +169,7 @@ if ($page == 'overview') {
|
||||
's' => $s
|
||||
));
|
||||
} else {
|
||||
|
||||
|
||||
$fpmconfigs = '';
|
||||
$configs = Database::query("SELECT * FROM `" . TABLE_PANEL_FPMDAEMONS . "` ORDER BY `description` ASC");
|
||||
while ($row = $configs->fetch(PDO::FETCH_ASSOC)) {
|
||||
@@ -171,15 +177,15 @@ if ($page == 'overview') {
|
||||
}
|
||||
|
||||
$pm_select = makeoption('static', 'static', $result['pm'], true, true);
|
||||
$pm_select.= makeoption('dynamic', 'dynamic', $result['pm'], true, true);
|
||||
$pm_select.= makeoption('ondemand', 'ondemand', $result['pm'], true, true);
|
||||
$pm_select .= makeoption('dynamic', 'dynamic', $result['pm'], true, true);
|
||||
$pm_select .= makeoption('ondemand', 'ondemand', $result['pm'], true, true);
|
||||
|
||||
$phpconfig_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/phpconfig/formfield.phpconfig_edit.php';
|
||||
$phpconfig_edit_form = \Froxlor\UI\HtmlForm::genHTMLForm($phpconfig_edit_data);
|
||||
|
||||
|
||||
$title = $phpconfig_edit_data['phpconfig_edit']['title'];
|
||||
$image = $phpconfig_edit_data['phpconfig_edit']['image'];
|
||||
|
||||
|
||||
eval("echo \"" . \Froxlor\UI\Template::getTemplate("phpconfig/overview_edit") . "\";");
|
||||
}
|
||||
} else {
|
||||
@@ -187,7 +193,7 @@ if ($page == 'overview') {
|
||||
}
|
||||
}
|
||||
} elseif ($page == 'fpmdaemons') {
|
||||
|
||||
|
||||
if ($action == '') {
|
||||
|
||||
try {
|
||||
@@ -196,7 +202,7 @@ if ($page == 'overview') {
|
||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
||||
}
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
|
||||
|
||||
$tablecontent = '';
|
||||
$count = 0;
|
||||
if (isset($result['count']) && $result['count'] > 0) {
|
||||
@@ -205,17 +211,17 @@ if ($page == 'overview') {
|
||||
foreach ($row['configs'] as $configused) {
|
||||
$configs .= $configused . "<br>";
|
||||
}
|
||||
$count++;
|
||||
$count ++;
|
||||
eval("\$tablecontent.=\"" . \Froxlor\UI\Template::getTemplate("phpconfig/fpmdaemons_overview") . "\";");
|
||||
}
|
||||
}
|
||||
eval("echo \"" . \Froxlor\UI\Template::getTemplate("phpconfig/fpmdaemons") . "\";");
|
||||
}
|
||||
|
||||
|
||||
if ($action == 'add') {
|
||||
|
||||
|
||||
if ((int) $userinfo['change_serversettings'] == 1) {
|
||||
|
||||
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
try {
|
||||
FpmDaemons::getLocal($userinfo, $_POST)->add();
|
||||
@@ -227,37 +233,39 @@ if ($page == 'overview') {
|
||||
's' => $s
|
||||
));
|
||||
} else {
|
||||
|
||||
|
||||
$pm_select = makeoption('static', 'static', 'static', true, true);
|
||||
$pm_select .= makeoption('dynamic', 'dynamic', 'static', true, true);
|
||||
$pm_select .= makeoption('ondemand', 'ondemand', 'static', true, true);
|
||||
|
||||
|
||||
$fpmconfig_add_data = include_once dirname(__FILE__) . '/lib/formfields/admin/phpconfig/formfield.fpmconfig_add.php';
|
||||
$fpmconfig_add_form = \Froxlor\UI\HtmlForm::genHTMLForm($fpmconfig_add_data);
|
||||
|
||||
|
||||
$title = $fpmconfig_add_data['fpmconfig_add']['title'];
|
||||
$image = $fpmconfig_add_data['fpmconfig_add']['image'];
|
||||
|
||||
|
||||
eval("echo \"" . \Froxlor\UI\Template::getTemplate("phpconfig/fpmconfig_add") . "\";");
|
||||
}
|
||||
} else {
|
||||
\Froxlor\UI\Response::standard_error('nopermissionsorinvalidid');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($action == 'delete') {
|
||||
|
||||
|
||||
try {
|
||||
$json_result = FpmDaemons::getLocal($userinfo, array('id' => $id))->get();
|
||||
$json_result = FpmDaemons::getLocal($userinfo, array(
|
||||
'id' => $id
|
||||
))->get();
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
||||
}
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
|
||||
|
||||
if ($id == 1) {
|
||||
\Froxlor\UI\Response::standard_error('cannotdeletedefaultphpconfig');
|
||||
}
|
||||
|
||||
|
||||
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') {
|
||||
@@ -281,18 +289,20 @@ if ($page == 'overview') {
|
||||
\Froxlor\UI\Response::standard_error('nopermissionsorinvalidid');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($action == 'edit') {
|
||||
|
||||
|
||||
try {
|
||||
$json_result = FpmDaemons::getLocal($userinfo, array('id' => $id))->get();
|
||||
$json_result = FpmDaemons::getLocal($userinfo, array(
|
||||
'id' => $id
|
||||
))->get();
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
||||
}
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
|
||||
|
||||
if ($result['id'] != 0 && $result['id'] == $id && (int) $userinfo['change_serversettings'] == 1) {
|
||||
|
||||
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
try {
|
||||
FpmDaemons::getLocal($userinfo, $_POST)->update();
|
||||
@@ -304,17 +314,17 @@ if ($page == 'overview') {
|
||||
's' => $s
|
||||
));
|
||||
} else {
|
||||
|
||||
|
||||
$pm_select = makeoption('static', 'static', $result['pm'], true, true);
|
||||
$pm_select .= makeoption('dynamic', 'dynamic', $result['pm'], true, true);
|
||||
$pm_select .= makeoption('ondemand', 'ondemand', $result['pm'], true, true);
|
||||
|
||||
|
||||
$fpmconfig_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/phpconfig/formfield.fpmconfig_edit.php';
|
||||
$fpmconfig_edit_form = \Froxlor\UI\HtmlForm::genHTMLForm($fpmconfig_edit_data);
|
||||
|
||||
|
||||
$title = $fpmconfig_edit_data['fpmconfig_edit']['title'];
|
||||
$image = $fpmconfig_edit_data['fpmconfig_edit']['image'];
|
||||
|
||||
|
||||
eval("echo \"" . \Froxlor\UI\Template::getTemplate("phpconfig/fpmconfig_edit") . "\";");
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user