allow admin to set php-configs that can be used by customers
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
@@ -532,6 +532,14 @@ if ($page == 'customers'
|
||||
$phpenabled = intval($_POST['phpenabled']);
|
||||
}
|
||||
|
||||
$allowed_phpconfigs = array();
|
||||
if (isset($_POST['allowed_phpconfigs']) && is_array($_POST['allowed_phpconfigs'])) {
|
||||
foreach ($_POST['allowed_phpconfigs'] as $allowed_phpconfig) {
|
||||
$allowed_phpconfig = intval($allowed_phpconfig);
|
||||
$allowed_phpconfigs[] = $allowed_phpconfig;
|
||||
}
|
||||
}
|
||||
|
||||
$perlenabled = 0;
|
||||
if (isset($_POST['perlenabled'])) {
|
||||
$perlenabled = intval($_POST['perlenabled']);
|
||||
@@ -693,6 +701,7 @@ if ($page == 'customers'
|
||||
'tickets' => $tickets,
|
||||
'mysqls' => $mysqls,
|
||||
'phpenabled' => $phpenabled,
|
||||
'allowed_phpconfigs' => empty($allowed_phpconfigs) ? "" : json_encode($allowed_phpconfigs),
|
||||
'imap' => $email_imap,
|
||||
'pop3' => $email_pop3,
|
||||
'perlenabled' => $perlenabled,
|
||||
@@ -733,6 +742,7 @@ if ($page == 'customers'
|
||||
`mysqls` = :mysqls,
|
||||
`standardsubdomain` = '0',
|
||||
`phpenabled` = :phpenabled,
|
||||
`allowed_phpconfigs` = :allowed_phpconfigs,
|
||||
`imap` = :imap,
|
||||
`pop3` = :pop3,
|
||||
`perlenabled` = :perlenabled,
|
||||
@@ -1043,6 +1053,26 @@ if ($page == 'customers'
|
||||
$gender_options .= makeoption($lng['gender']['male'], 1, null, true, true);
|
||||
$gender_options .= makeoption($lng['gender']['female'], 2, null, true, true);
|
||||
|
||||
$phpconfigs = array();
|
||||
$configs = Database::query("
|
||||
SELECT c.*, fc.description as interpreter
|
||||
FROM `" . TABLE_PANEL_PHPCONFIGS . "` c
|
||||
LEFT JOIN `" . TABLE_PANEL_FPMDAEMONS . "` fc ON fc.id = c.fpmsettingid
|
||||
");
|
||||
while ($row = $configs->fetch(PDO::FETCH_ASSOC)) {
|
||||
if ((int) Settings::Get('phpfpm.enabled') == 1) {
|
||||
$phpconfigs[] = array(
|
||||
'label' => $row['description'] . " [".$row['interpreter']."]<br />",
|
||||
'value' => $row['id']
|
||||
);
|
||||
} else {
|
||||
$phpconfigs[] = array(
|
||||
'label' => $row['description']."<br />",
|
||||
'value' => $row['id']
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$customer_add_data = include_once dirname(__FILE__).'/lib/formfields/admin/customer/formfield.customer_add.php';
|
||||
$customer_add_form = htmlform::genHTMLForm($customer_add_data);
|
||||
|
||||
@@ -1205,6 +1235,14 @@ if ($page == 'customers'
|
||||
$phpenabled = intval($_POST['phpenabled']);
|
||||
}
|
||||
|
||||
$allowed_phpconfigs = array();
|
||||
if (isset($_POST['allowed_phpconfigs']) && is_array($_POST['allowed_phpconfigs'])) {
|
||||
foreach ($_POST['allowed_phpconfigs'] as $allowed_phpconfig) {
|
||||
$allowed_phpconfig = intval($allowed_phpconfig);
|
||||
$allowed_phpconfigs[] = $allowed_phpconfig;
|
||||
}
|
||||
}
|
||||
|
||||
$perlenabled = 0;
|
||||
if (isset($_POST['perlenabled'])) {
|
||||
$perlenabled = intval($_POST['perlenabled']);
|
||||
@@ -1457,6 +1495,7 @@ if ($page == 'customers'
|
||||
'mysqls' => $mysqls,
|
||||
'deactivated' => $deactivated,
|
||||
'phpenabled' => $phpenabled,
|
||||
'allowed_phpconfigs' => empty($allowed_phpconfigs) ? "" : json_encode($allowed_phpconfigs),
|
||||
'imap' => $email_imap,
|
||||
'pop3' => $email_pop3,
|
||||
'perlenabled' => $perlenabled,
|
||||
@@ -1490,6 +1529,7 @@ if ($page == 'customers'
|
||||
`mysqls` = :mysqls,
|
||||
`deactivated` = :deactivated,
|
||||
`phpenabled` = :phpenabled,
|
||||
`allowed_phpconfigs` = :allowed_phpconfigs,
|
||||
`email_quota` = :email_quota,
|
||||
`imap` = :imap,
|
||||
`pop3` = :pop3,
|
||||
@@ -1695,6 +1735,26 @@ if ($page == 'customers'
|
||||
$gender_options .= makeoption($lng['gender']['male'], 1, ($result['gender'] == '1' ? true : false), true, true);
|
||||
$gender_options .= makeoption($lng['gender']['female'], 2, ($result['gender'] == '2' ? true : false), true, true);
|
||||
|
||||
$phpconfigs = array();
|
||||
$configs = Database::query("
|
||||
SELECT c.*, fc.description as interpreter
|
||||
FROM `" . TABLE_PANEL_PHPCONFIGS . "` c
|
||||
LEFT JOIN `" . TABLE_PANEL_FPMDAEMONS . "` fc ON fc.id = c.fpmsettingid
|
||||
");
|
||||
while ($row = $configs->fetch(PDO::FETCH_ASSOC)) {
|
||||
if ((int) Settings::Get('phpfpm.enabled') == 1) {
|
||||
$phpconfigs[] = array(
|
||||
'label' => $row['description'] . " [".$row['interpreter']."]<br />",
|
||||
'value' => $row['id']
|
||||
);
|
||||
} else {
|
||||
$phpconfigs[] = array(
|
||||
'label' => $row['description']."<br />",
|
||||
'value' => $row['id']
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$customer_edit_data = include_once dirname(__FILE__).'/lib/formfields/admin/customer/formfield.customer_edit.php';
|
||||
$customer_edit_form = htmlform::genHTMLForm($customer_edit_data);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user