more cleanup in admin_customers for add/edit form
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -148,7 +148,7 @@ if ($page == 'customers' && $userinfo['customers'] != '0') {
|
|||||||
$row['custom_notes'] = ($row['custom_notes'] != '') ? nl2br($row['custom_notes']) : '';
|
$row['custom_notes'] = ($row['custom_notes'] != '') ? nl2br($row['custom_notes']) : '';
|
||||||
|
|
||||||
eval("\$customers.=\"" . \Froxlor\UI\Template::getTemplate("customers/customers_customer") . "\";");
|
eval("\$customers.=\"" . \Froxlor\UI\Template::getTemplate("customers/customers_customer") . "\";");
|
||||||
$count ++;
|
$count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$customercount = $result['count'] . " / " . $paging->getEntries();
|
$customercount = $result['count'] . " / " . $paging->getEntries();
|
||||||
@@ -201,7 +201,7 @@ if ($page == 'customers' && $userinfo['customers'] != '0') {
|
|||||||
|
|
||||||
$target = (isset($_GET['target']) ? $_GET['target'] : 'index');
|
$target = (isset($_GET['target']) ? $_GET['target'] : 'index');
|
||||||
$redirect = "customer_" . $target . ".php";
|
$redirect = "customer_" . $target . ".php";
|
||||||
if (! file_exists(\Froxlor\Froxlor::getInstallDir() . "/" . $redirect)) {
|
if (!file_exists(\Froxlor\Froxlor::getInstallDir() . "/" . $redirect)) {
|
||||||
$redirect = "customer_index.php";
|
$redirect = "customer_index.php";
|
||||||
}
|
}
|
||||||
\Froxlor\UI\Response::redirectTo($redirect, array(
|
\Froxlor\UI\Response::redirectTo($redirect, array(
|
||||||
@@ -285,17 +285,7 @@ if ($page == 'customers' && $userinfo['customers'] != '0') {
|
|||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$diskspace_ul = \Froxlor\UI\HTML::makecheckbox('diskspace_ul', $lng['customer']['unlimited'], '-1', false, '0', true, true);
|
$phpconfigs = [];
|
||||||
$traffic_ul = \Froxlor\UI\HTML::makecheckbox('traffic_ul', $lng['customer']['unlimited'], '-1', false, '0', true, true);
|
|
||||||
$subdomains_ul = \Froxlor\UI\HTML::makecheckbox('subdomains_ul', $lng['customer']['unlimited'], '-1', false, '0', true, true);
|
|
||||||
$emails_ul = \Froxlor\UI\HTML::makecheckbox('emails_ul', $lng['customer']['unlimited'], '-1', false, '0', true, true);
|
|
||||||
$email_accounts_ul = \Froxlor\UI\HTML::makecheckbox('email_accounts_ul', $lng['customer']['unlimited'], '-1', false, '0', true, true);
|
|
||||||
$email_forwarders_ul = \Froxlor\UI\HTML::makecheckbox('email_forwarders_ul', $lng['customer']['unlimited'], '-1', false, '0', true, true);
|
|
||||||
$email_quota_ul = \Froxlor\UI\HTML::makecheckbox('email_quota_ul', $lng['customer']['unlimited'], '-1', false, '0', true, true);
|
|
||||||
$ftps_ul = \Froxlor\UI\HTML::makecheckbox('ftps_ul', $lng['customer']['unlimited'], '-1', false, '0', true, true);
|
|
||||||
$mysqls_ul = \Froxlor\UI\HTML::makecheckbox('mysqls_ul', $lng['customer']['unlimited'], '-1', false, '0', true, true);
|
|
||||||
|
|
||||||
$phpconfigs = array();
|
|
||||||
$configs = Database::query("
|
$configs = Database::query("
|
||||||
SELECT c.*, fc.description as interpreter
|
SELECT c.*, fc.description as interpreter
|
||||||
FROM `" . TABLE_PANEL_PHPCONFIGS . "` c
|
FROM `" . TABLE_PANEL_PHPCONFIGS . "` c
|
||||||
@@ -347,23 +337,6 @@ if ($page == 'customers' && $userinfo['customers'] != '0') {
|
|||||||
}
|
}
|
||||||
$result = json_decode($json_result, true)['data'];
|
$result = json_decode($json_result, true)['data'];
|
||||||
|
|
||||||
/*
|
|
||||||
* information for moving customer
|
|
||||||
*/
|
|
||||||
$available_admins_stmt = Database::prepare("
|
|
||||||
SELECT * FROM `" . TABLE_PANEL_ADMINS . "`
|
|
||||||
WHERE (`customers` = '-1' OR `customers` > `customers_used`)");
|
|
||||||
Database::pexecute($available_admins_stmt);
|
|
||||||
$admin_select = \Froxlor\UI\HTML::makeoption("-----", 0, true, true, true);
|
|
||||||
$admin_select_cnt = 0;
|
|
||||||
while ($available_admin = $available_admins_stmt->fetch()) {
|
|
||||||
$admin_select .= \Froxlor\UI\HTML::makeoption($available_admin['name'] . " (" . $available_admin['loginname'] . ")", $available_admin['adminid'], null, true, true);
|
|
||||||
$admin_select_cnt ++;
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* end of moving customer stuff
|
|
||||||
*/
|
|
||||||
|
|
||||||
if ($result['loginname'] != '') {
|
if ($result['loginname'] != '') {
|
||||||
|
|
||||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||||
@@ -377,69 +350,15 @@ if ($page == 'customers' && $userinfo['customers'] != '0') {
|
|||||||
's' => $s
|
's' => $s
|
||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
$language_options = '';
|
|
||||||
|
|
||||||
foreach ($languages as $language_file => $language_name) {
|
|
||||||
$language_options .= \Froxlor\UI\HTML::makeoption($language_name, $language_file, $result['def_language'], true);
|
|
||||||
}
|
|
||||||
|
|
||||||
$dec_places = Settings::Get('panel.decimal_places');
|
$dec_places = Settings::Get('panel.decimal_places');
|
||||||
$result['traffic'] = round($result['traffic'] / (1024 * 1024), $dec_places);
|
$result['traffic'] = round($result['traffic'] / (1024 * 1024), $dec_places);
|
||||||
$result['diskspace'] = round($result['diskspace'] / 1024, $dec_places);
|
$result['diskspace'] = round($result['diskspace'] / 1024, $dec_places);
|
||||||
$result['email'] = $idna_convert->decode($result['email']);
|
$result['email'] = $idna_convert->decode($result['email']);
|
||||||
|
|
||||||
$diskspace_ul = \Froxlor\UI\HTML::makecheckbox('diskspace_ul', $lng['customer']['unlimited'], '-1', false, $result['diskspace'], true, true);
|
|
||||||
if ($result['diskspace'] == '-1') {
|
|
||||||
$result['diskspace'] = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
$traffic_ul = \Froxlor\UI\HTML::makecheckbox('traffic_ul', $lng['customer']['unlimited'], '-1', false, $result['traffic'], true, true);
|
|
||||||
if ($result['traffic'] == '-1') {
|
|
||||||
$result['traffic'] = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
$subdomains_ul = \Froxlor\UI\HTML::makecheckbox('subdomains_ul', $lng['customer']['unlimited'], '-1', false, $result['subdomains'], true, true);
|
|
||||||
if ($result['subdomains'] == '-1') {
|
|
||||||
$result['subdomains'] = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
$emails_ul = \Froxlor\UI\HTML::makecheckbox('emails_ul', $lng['customer']['unlimited'], '-1', false, $result['emails'], true, true);
|
|
||||||
if ($result['emails'] == '-1') {
|
|
||||||
$result['emails'] = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
$email_accounts_ul = \Froxlor\UI\HTML::makecheckbox('email_accounts_ul', $lng['customer']['unlimited'], '-1', false, $result['email_accounts'], true, true);
|
|
||||||
if ($result['email_accounts'] == '-1') {
|
|
||||||
$result['email_accounts'] = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
$email_forwarders_ul = \Froxlor\UI\HTML::makecheckbox('email_forwarders_ul', $lng['customer']['unlimited'], '-1', false, $result['email_forwarders'], true, true);
|
|
||||||
if ($result['email_forwarders'] == '-1') {
|
|
||||||
$result['email_forwarders'] = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
$email_quota_ul = \Froxlor\UI\HTML::makecheckbox('email_quota_ul', $lng['customer']['unlimited'], '-1', false, $result['email_quota'], true, true);
|
|
||||||
if ($result['email_quota'] == '-1') {
|
|
||||||
$result['email_quota'] = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
$ftps_ul = \Froxlor\UI\HTML::makecheckbox('ftps_ul', $lng['customer']['unlimited'], '-1', false, $result['ftps'], true, true);
|
|
||||||
if ($result['ftps'] == '-1') {
|
|
||||||
$result['ftps'] = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
$mysqls_ul = \Froxlor\UI\HTML::makecheckbox('mysqls_ul', $lng['customer']['unlimited'], '-1', false, $result['mysqls'], true, true);
|
|
||||||
if ($result['mysqls'] == '-1') {
|
|
||||||
$result['mysqls'] = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
$result = \Froxlor\PhpHelper::htmlentitiesArray($result);
|
$result = \Froxlor\PhpHelper::htmlentitiesArray($result);
|
||||||
|
|
||||||
$gender_options = \Froxlor\UI\HTML::makeoption($lng['gender']['undef'], 0, ($result['gender'] == '0' ? true : false), true, true);
|
$phpconfigs = [];
|
||||||
$gender_options .= \Froxlor\UI\HTML::makeoption($lng['gender']['male'], 1, ($result['gender'] == '1' ? true : false), true, true);
|
|
||||||
$gender_options .= \Froxlor\UI\HTML::makeoption($lng['gender']['female'], 2, ($result['gender'] == '2' ? true : false), true, true);
|
|
||||||
|
|
||||||
$phpconfigs = array();
|
|
||||||
$configs = Database::query("
|
$configs = Database::query("
|
||||||
SELECT c.*, fc.description as interpreter
|
SELECT c.*, fc.description as interpreter
|
||||||
FROM `" . TABLE_PANEL_PHPCONFIGS . "` c
|
FROM `" . TABLE_PANEL_PHPCONFIGS . "` c
|
||||||
@@ -448,38 +367,49 @@ if ($page == 'customers' && $userinfo['customers'] != '0') {
|
|||||||
while ($row = $configs->fetch(PDO::FETCH_ASSOC)) {
|
while ($row = $configs->fetch(PDO::FETCH_ASSOC)) {
|
||||||
if ((int) Settings::Get('phpfpm.enabled') == 1) {
|
if ((int) Settings::Get('phpfpm.enabled') == 1) {
|
||||||
$phpconfigs[] = array(
|
$phpconfigs[] = array(
|
||||||
'label' => $row['description'] . " [" . $row['interpreter'] . "]<br />",
|
'label' => $row['description'] . " [" . $row['interpreter'] . "]",
|
||||||
'value' => $row['id']
|
'value' => $row['id']
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$phpconfigs[] = array(
|
$phpconfigs[] = array(
|
||||||
'label' => $row['description'] . "<br />",
|
'label' => $row['description'],
|
||||||
'value' => $row['id']
|
'value' => $row['id']
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// hosting plans
|
// hosting plans
|
||||||
$hosting_plans = "";
|
|
||||||
$plans = Database::query("
|
$plans = Database::query("
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM `" . TABLE_PANEL_PLANS . "`
|
FROM `" . TABLE_PANEL_PLANS . "`
|
||||||
ORDER BY name ASC
|
ORDER BY name ASC
|
||||||
");
|
");
|
||||||
if (Database::num_rows() > 0) {
|
$hosting_plans = [
|
||||||
$hosting_plans .= \Froxlor\UI\HTML::makeoption("---", 0, 0, true, true);
|
0 => "---"
|
||||||
}
|
];
|
||||||
while ($row = $plans->fetch(PDO::FETCH_ASSOC)) {
|
while ($row = $plans->fetch(PDO::FETCH_ASSOC)) {
|
||||||
$hosting_plans .= \Froxlor\UI\HTML::makeoption($row['name'], $row['id'], 0, true, true);
|
$hosting_plans[$row['id']] = $row['name'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$available_admins_stmt = Database::prepare("
|
||||||
|
SELECT * FROM `" . TABLE_PANEL_ADMINS . "`
|
||||||
|
WHERE (`customers` = '-1' OR `customers` > `customers_used`)
|
||||||
|
AND adminid <> :currentadmin
|
||||||
|
");
|
||||||
|
Database::pexecute($available_admins_stmt, ['currentadmin' => $result['adminid']]);
|
||||||
|
$admin_select = [
|
||||||
|
0 => "---"
|
||||||
|
];
|
||||||
|
while ($available_admin = $available_admins_stmt->fetch()) {
|
||||||
|
$admin_select[$available_admin['adminid']] = $available_admin['name'] . " (" . $available_admin['loginname'] . ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
$customer_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/customer/formfield.customer_edit.php';
|
$customer_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/customer/formfield.customer_edit.php';
|
||||||
$customer_edit_form = \Froxlor\UI\HtmlForm::genHTMLForm($customer_edit_data);
|
|
||||||
|
|
||||||
$title = $customer_edit_data['customer_edit']['title'];
|
UI::TwigBuffer('user/form.html.twig', [
|
||||||
$image = $customer_edit_data['customer_edit']['image'];
|
'formdata' => $customer_edit_data['customer_edit']
|
||||||
|
]);
|
||||||
eval("echo \"" . \Froxlor\UI\Template::getTemplate("customers/customers_edit") . "\";");
|
UI::TwigOutputBuffer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -132,7 +132,6 @@ return array(
|
|||||||
'type' => 'text'
|
'type' => 'text'
|
||||||
),
|
),
|
||||||
'custom_notes' => array(
|
'custom_notes' => array(
|
||||||
'style' => 'align-top',
|
|
||||||
'label' => $lng['usersettings']['custom_notes']['title'],
|
'label' => $lng['usersettings']['custom_notes']['title'],
|
||||||
'desc' => $lng['usersettings']['custom_notes']['description'],
|
'desc' => $lng['usersettings']['custom_notes']['description'],
|
||||||
'type' => 'textarea',
|
'type' => 'textarea',
|
||||||
@@ -168,48 +167,42 @@ return array(
|
|||||||
'type' => 'textul',
|
'type' => 'textul',
|
||||||
'value' => 0,
|
'value' => 0,
|
||||||
'maxlength' => 16,
|
'maxlength' => 16,
|
||||||
'mandatory' => true,
|
'mandatory' => true
|
||||||
'ul_field' => $diskspace_ul
|
|
||||||
),
|
),
|
||||||
'traffic' => array(
|
'traffic' => array(
|
||||||
'label' => $lng['customer']['traffic'] . ' (' . $lng['customer']['gib'] . ')',
|
'label' => $lng['customer']['traffic'] . ' (' . $lng['customer']['gib'] . ')',
|
||||||
'type' => 'textul',
|
'type' => 'textul',
|
||||||
'value' => 0,
|
'value' => 0,
|
||||||
'maxlength' => 14,
|
'maxlength' => 14,
|
||||||
'mandatory' => true,
|
'mandatory' => true
|
||||||
'ul_field' => $traffic_ul
|
|
||||||
),
|
),
|
||||||
'subdomains' => array(
|
'subdomains' => array(
|
||||||
'label' => $lng['customer']['subdomains'],
|
'label' => $lng['customer']['subdomains'],
|
||||||
'type' => 'textul',
|
'type' => 'textul',
|
||||||
'value' => 0,
|
'value' => 0,
|
||||||
'maxlength' => 9,
|
'maxlength' => 9,
|
||||||
'mandatory' => true,
|
'mandatory' => true
|
||||||
'ul_field' => $subdomains_ul
|
|
||||||
),
|
),
|
||||||
'emails' => array(
|
'emails' => array(
|
||||||
'label' => $lng['customer']['emails'],
|
'label' => $lng['customer']['emails'],
|
||||||
'type' => 'textul',
|
'type' => 'textul',
|
||||||
'value' => 0,
|
'value' => 0,
|
||||||
'maxlength' => 9,
|
'maxlength' => 9,
|
||||||
'mandatory' => true,
|
'mandatory' => true
|
||||||
'ul_field' => $emails_ul
|
|
||||||
),
|
),
|
||||||
'email_accounts' => array(
|
'email_accounts' => array(
|
||||||
'label' => $lng['customer']['accounts'],
|
'label' => $lng['customer']['accounts'],
|
||||||
'type' => 'textul',
|
'type' => 'textul',
|
||||||
'value' => 0,
|
'value' => 0,
|
||||||
'maxlength' => 9,
|
'maxlength' => 9,
|
||||||
'mandatory' => true,
|
'mandatory' => true
|
||||||
'ul_field' => $email_accounts_ul
|
|
||||||
),
|
),
|
||||||
'email_forwarders' => array(
|
'email_forwarders' => array(
|
||||||
'label' => $lng['customer']['forwarders'],
|
'label' => $lng['customer']['forwarders'],
|
||||||
'type' => 'textul',
|
'type' => 'textul',
|
||||||
'value' => 0,
|
'value' => 0,
|
||||||
'maxlength' => 9,
|
'maxlength' => 9,
|
||||||
'mandatory' => true,
|
'mandatory' => true
|
||||||
'ul_field' => $email_forwarders_ul
|
|
||||||
),
|
),
|
||||||
'email_quota' => array(
|
'email_quota' => array(
|
||||||
'label' => $lng['customer']['email_quota']. ' (' . $lng['customer']['mib'] . ')',
|
'label' => $lng['customer']['email_quota']. ' (' . $lng['customer']['mib'] . ')',
|
||||||
@@ -217,8 +210,7 @@ return array(
|
|||||||
'value' => 0,
|
'value' => 0,
|
||||||
'maxlength' => 9,
|
'maxlength' => 9,
|
||||||
'visible' => (\Froxlor\Settings::Get('system.mail_quota_enabled') == '1' ? true : false),
|
'visible' => (\Froxlor\Settings::Get('system.mail_quota_enabled') == '1' ? true : false),
|
||||||
'mandatory' => true,
|
'mandatory' => true
|
||||||
'ul_field' => $email_quota_ul
|
|
||||||
),
|
),
|
||||||
'email_imap' => array(
|
'email_imap' => array(
|
||||||
'label' => $lng['customer']['email_imap'],
|
'label' => $lng['customer']['email_imap'],
|
||||||
@@ -238,16 +230,14 @@ return array(
|
|||||||
'label' => $lng['customer']['ftps'],
|
'label' => $lng['customer']['ftps'],
|
||||||
'type' => 'textul',
|
'type' => 'textul',
|
||||||
'value' => 0,
|
'value' => 0,
|
||||||
'maxlength' => 9,
|
'maxlength' => 9
|
||||||
'ul_field' => $ftps_ul
|
|
||||||
),
|
),
|
||||||
'mysqls' => array(
|
'mysqls' => array(
|
||||||
'label' => $lng['customer']['mysqls'],
|
'label' => $lng['customer']['mysqls'],
|
||||||
'type' => 'textul',
|
'type' => 'textul',
|
||||||
'value' => 0,
|
'value' => 0,
|
||||||
'maxlength' => 9,
|
'maxlength' => 9,
|
||||||
'mandatory' => true,
|
'mandatory' => true
|
||||||
'ul_field' => $mysqls_ul
|
|
||||||
),
|
),
|
||||||
'phpenabled' => array(
|
'phpenabled' => array(
|
||||||
'label' => $lng['admin']['phpenabled'] . '?',
|
'label' => $lng['admin']['phpenabled'] . '?',
|
||||||
@@ -261,9 +251,9 @@ return array(
|
|||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'values' => $phpconfigs,
|
'values' => $phpconfigs,
|
||||||
'value' => ((int) \Froxlor\Settings::Get('system.mod_fcgid') == 1 ?
|
'value' => ((int) \Froxlor\Settings::Get('system.mod_fcgid') == 1 ?
|
||||||
\Froxlor\Settings::Get('system.mod_fcgid_defaultini')
|
[\Froxlor\Settings::Get('system.mod_fcgid_defaultini')]
|
||||||
: ((int) \Froxlor\Settings::Get('phpfpm.enabled') == 1 ?
|
: ((int) \Froxlor\Settings::Get('phpfpm.enabled') == 1 ?
|
||||||
\Froxlor\Settings::Get('phpfpm.defaultini')
|
[\Froxlor\Settings::Get('phpfpm.defaultini')]
|
||||||
: null)),
|
: null)),
|
||||||
'is_array' => 1
|
'is_array' => 1
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
return array(
|
return array(
|
||||||
'customer_edit' => array(
|
'customer_edit' => array(
|
||||||
'title' => $lng['admin']['customer_edit'],
|
'title' => $lng['admin']['customer_edit'],
|
||||||
'image' => 'icons/user_edit.png',
|
'image' => 'fa-solid fa-user-pen',
|
||||||
'sections' => array(
|
'sections' => array(
|
||||||
'section_a' => array(
|
'section_a' => array(
|
||||||
'title' => $lng['admin']['accountdata'],
|
'title' => $lng['admin']['accountdata'],
|
||||||
@@ -36,28 +36,14 @@ return array(
|
|||||||
'createstdsubdomain' => array(
|
'createstdsubdomain' => array(
|
||||||
'label' => $lng['admin']['stdsubdomain_add'] . '?',
|
'label' => $lng['admin']['stdsubdomain_add'] . '?',
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'values' => array(
|
'value' => '1',
|
||||||
array(
|
'checked' => ($result['standardsubdomain'] != '0') ? '1' : '0'
|
||||||
'label' => $lng['panel']['yes'],
|
|
||||||
'value' => '1'
|
|
||||||
)
|
|
||||||
),
|
|
||||||
'value' => array(
|
|
||||||
($result['standardsubdomain'] != '0') ? '1' : '0'
|
|
||||||
)
|
|
||||||
),
|
),
|
||||||
'deactivated' => array(
|
'deactivated' => array(
|
||||||
'label' => $lng['admin']['deactivated_user'],
|
'label' => $lng['admin']['deactivated_user'],
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'values' => array(
|
'value' => '1',
|
||||||
array(
|
'checked' => $result['deactivated']
|
||||||
'label' => $lng['panel']['yes'],
|
|
||||||
'value' => '1'
|
|
||||||
)
|
|
||||||
),
|
|
||||||
'value' => array(
|
|
||||||
$result['deactivated']
|
|
||||||
)
|
|
||||||
),
|
),
|
||||||
'new_customer_password' => array(
|
'new_customer_password' => array(
|
||||||
'label' => $lng['login']['password'] . ' (' . $lng['panel']['emptyfornochanges'] . ')',
|
'label' => $lng['login']['password'] . ' (' . $lng['panel']['emptyfornochanges'] . ')',
|
||||||
@@ -73,21 +59,15 @@ return array(
|
|||||||
'def_language' => array(
|
'def_language' => array(
|
||||||
'label' => $lng['login']['language'],
|
'label' => $lng['login']['language'],
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
'select_var' => $language_options
|
'select_var' => $languages,
|
||||||
|
'selected' => $result['def_language']
|
||||||
),
|
),
|
||||||
'api_allowed' => array(
|
'api_allowed' => array(
|
||||||
'label' => $lng['usersettings']['api_allowed']['title'],
|
'label' => $lng['usersettings']['api_allowed']['title'],
|
||||||
'desc' => $lng['usersettings']['api_allowed']['description'],
|
'desc' => $lng['usersettings']['api_allowed']['description'],
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'values' => array(
|
'value' => '1',
|
||||||
array(
|
'checked' => $result['api_allowed'],
|
||||||
'label' => $lng['panel']['yes'],
|
|
||||||
'value' => '1'
|
|
||||||
)
|
|
||||||
),
|
|
||||||
'value' => array(
|
|
||||||
$result['api_allowed']
|
|
||||||
),
|
|
||||||
'visible' => (\Froxlor\Settings::Get('api.enabled') == '1' ? true : false)
|
'visible' => (\Froxlor\Settings::Get('api.enabled') == '1' ? true : false)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -111,7 +91,12 @@ return array(
|
|||||||
'gender' => array(
|
'gender' => array(
|
||||||
'label' => $lng['gender']['title'],
|
'label' => $lng['gender']['title'],
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
'select_var' => $gender_options
|
'select_var' => [
|
||||||
|
0 => $lng['gender']['undef'],
|
||||||
|
1 => $lng['gender']['male'],
|
||||||
|
2 => $lng['gender']['female']
|
||||||
|
],
|
||||||
|
'selected' => $result['gender']
|
||||||
),
|
),
|
||||||
'company' => array(
|
'company' => array(
|
||||||
'label' => $lng['customer']['company'],
|
'label' => $lng['customer']['company'],
|
||||||
@@ -167,15 +152,8 @@ return array(
|
|||||||
'custom_notes_show' => array(
|
'custom_notes_show' => array(
|
||||||
'label' => $lng['usersettings']['custom_notes']['show'],
|
'label' => $lng['usersettings']['custom_notes']['show'],
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'values' => array(
|
'value' => '1',
|
||||||
array(
|
'checked' => $result['custom_notes_show']
|
||||||
'label' => $lng['panel']['yes'],
|
|
||||||
'value' => '1'
|
|
||||||
)
|
|
||||||
),
|
|
||||||
'value' => array(
|
|
||||||
$result['custom_notes_show']
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
@@ -200,48 +178,42 @@ return array(
|
|||||||
'type' => 'textul',
|
'type' => 'textul',
|
||||||
'value' => $result['diskspace'],
|
'value' => $result['diskspace'],
|
||||||
'maxlength' => 16,
|
'maxlength' => 16,
|
||||||
'mandatory' => true,
|
'mandatory' => true
|
||||||
'ul_field' => $diskspace_ul
|
|
||||||
),
|
),
|
||||||
'traffic' => array(
|
'traffic' => array(
|
||||||
'label' => $lng['customer']['traffic'] . ' (' . $lng['customer']['gib'] . ')',
|
'label' => $lng['customer']['traffic'] . ' (' . $lng['customer']['gib'] . ')',
|
||||||
'type' => 'textul',
|
'type' => 'textul',
|
||||||
'value' => $result['traffic'],
|
'value' => $result['traffic'],
|
||||||
'maxlength' => 14,
|
'maxlength' => 14,
|
||||||
'mandatory' => true,
|
'mandatory' => true
|
||||||
'ul_field' => $traffic_ul
|
|
||||||
),
|
),
|
||||||
'subdomains' => array(
|
'subdomains' => array(
|
||||||
'label' => $lng['customer']['subdomains'],
|
'label' => $lng['customer']['subdomains'],
|
||||||
'type' => 'textul',
|
'type' => 'textul',
|
||||||
'value' => $result['subdomains'],
|
'value' => $result['subdomains'],
|
||||||
'maxlength' => 9,
|
'maxlength' => 9,
|
||||||
'mandatory' => true,
|
'mandatory' => true
|
||||||
'ul_field' => $subdomains_ul
|
|
||||||
),
|
),
|
||||||
'emails' => array(
|
'emails' => array(
|
||||||
'label' => $lng['customer']['emails'],
|
'label' => $lng['customer']['emails'],
|
||||||
'type' => 'textul',
|
'type' => 'textul',
|
||||||
'value' => $result['emails'],
|
'value' => $result['emails'],
|
||||||
'maxlength' => 9,
|
'maxlength' => 9,
|
||||||
'mandatory' => true,
|
'mandatory' => true
|
||||||
'ul_field' => $emails_ul
|
|
||||||
),
|
),
|
||||||
'email_accounts' => array(
|
'email_accounts' => array(
|
||||||
'label' => $lng['customer']['accounts'],
|
'label' => $lng['customer']['accounts'],
|
||||||
'type' => 'textul',
|
'type' => 'textul',
|
||||||
'value' => $result['email_accounts'],
|
'value' => $result['email_accounts'],
|
||||||
'maxlength' => 9,
|
'maxlength' => 9,
|
||||||
'mandatory' => true,
|
'mandatory' => true
|
||||||
'ul_field' => $email_accounts_ul
|
|
||||||
),
|
),
|
||||||
'email_forwarders' => array(
|
'email_forwarders' => array(
|
||||||
'label' => $lng['customer']['forwarders'],
|
'label' => $lng['customer']['forwarders'],
|
||||||
'type' => 'textul',
|
'type' => 'textul',
|
||||||
'value' => $result['email_forwarders'],
|
'value' => $result['email_forwarders'],
|
||||||
'maxlength' => 9,
|
'maxlength' => 9,
|
||||||
'mandatory' => true,
|
'mandatory' => true
|
||||||
'ul_field' => $email_forwarders_ul
|
|
||||||
),
|
),
|
||||||
'email_quota' => array(
|
'email_quota' => array(
|
||||||
'label' => $lng['customer']['email_quota'] . ' (' . $lng['customer']['mib'] . ')',
|
'label' => $lng['customer']['email_quota'] . ' (' . $lng['customer']['mib'] . ')',
|
||||||
@@ -249,64 +221,40 @@ return array(
|
|||||||
'value' => $result['email_quota'],
|
'value' => $result['email_quota'],
|
||||||
'maxlength' => 9,
|
'maxlength' => 9,
|
||||||
'visible' => (\Froxlor\Settings::Get('system.mail_quota_enabled') == '1' ? true : false),
|
'visible' => (\Froxlor\Settings::Get('system.mail_quota_enabled') == '1' ? true : false),
|
||||||
'mandatory' => true,
|
'mandatory' => true
|
||||||
'ul_field' => $email_quota_ul
|
|
||||||
),
|
),
|
||||||
'email_imap' => array(
|
'email_imap' => array(
|
||||||
'label' => $lng['customer']['email_imap'],
|
'label' => $lng['customer']['email_imap'],
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'values' => array(
|
'value' => '1',
|
||||||
array(
|
'checked' => $result['imap'],
|
||||||
'label' => $lng['panel']['yes'],
|
|
||||||
'value' => '1'
|
|
||||||
)
|
|
||||||
),
|
|
||||||
'value' => array(
|
|
||||||
$result['imap']
|
|
||||||
),
|
|
||||||
'mandatory' => true
|
'mandatory' => true
|
||||||
),
|
),
|
||||||
'email_pop3' => array(
|
'email_pop3' => array(
|
||||||
'label' => $lng['customer']['email_pop3'],
|
'label' => $lng['customer']['email_pop3'],
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'values' => array(
|
'value' => '1',
|
||||||
array(
|
'checked' => $result['pop3'],
|
||||||
'label' => $lng['panel']['yes'],
|
|
||||||
'value' => '1'
|
|
||||||
)
|
|
||||||
),
|
|
||||||
'value' => array(
|
|
||||||
$result['pop3']
|
|
||||||
),
|
|
||||||
'mandatory' => true
|
'mandatory' => true
|
||||||
),
|
),
|
||||||
'ftps' => array(
|
'ftps' => array(
|
||||||
'label' => $lng['customer']['ftps'],
|
'label' => $lng['customer']['ftps'],
|
||||||
'type' => 'textul',
|
'type' => 'textul',
|
||||||
'value' => $result['ftps'],
|
'value' => $result['ftps'],
|
||||||
'maxlength' => 9,
|
'maxlength' => 9
|
||||||
'ul_field' => $ftps_ul
|
|
||||||
),
|
),
|
||||||
'mysqls' => array(
|
'mysqls' => array(
|
||||||
'label' => $lng['customer']['mysqls'],
|
'label' => $lng['customer']['mysqls'],
|
||||||
'type' => 'textul',
|
'type' => 'textul',
|
||||||
'value' => $result['mysqls'],
|
'value' => $result['mysqls'],
|
||||||
'maxlength' => 9,
|
'maxlength' => 9,
|
||||||
'mandatory' => true,
|
'mandatory' => true
|
||||||
'ul_field' => $mysqls_ul
|
|
||||||
),
|
),
|
||||||
'phpenabled' => array(
|
'phpenabled' => array(
|
||||||
'label' => $lng['admin']['phpenabled'] . '?',
|
'label' => $lng['admin']['phpenabled'] . '?',
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'values' => array(
|
'value' => '1',
|
||||||
array(
|
'checked' => $result['phpenabled']
|
||||||
'label' => $lng['panel']['yes'],
|
|
||||||
'value' => '1'
|
|
||||||
)
|
|
||||||
),
|
|
||||||
'value' => array(
|
|
||||||
$result['phpenabled']
|
|
||||||
)
|
|
||||||
),
|
),
|
||||||
'allowed_phpconfigs' => array(
|
'allowed_phpconfigs' => array(
|
||||||
'visible' => (((int) \Froxlor\Settings::Get('system.mod_fcgid') == 1 || (int) \Froxlor\Settings::Get('phpfpm.enabled') == 1) ? true : false),
|
'visible' => (((int) \Froxlor\Settings::Get('system.mod_fcgid') == 1 || (int) \Froxlor\Settings::Get('phpfpm.enabled') == 1) ? true : false),
|
||||||
@@ -319,49 +267,28 @@ return array(
|
|||||||
'perlenabled' => array(
|
'perlenabled' => array(
|
||||||
'label' => $lng['admin']['perlenabled'] . '?',
|
'label' => $lng['admin']['perlenabled'] . '?',
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'values' => array(
|
'value' => '1',
|
||||||
array(
|
'checked' => $result['perlenabled']
|
||||||
'label' => $lng['panel']['yes'],
|
|
||||||
'value' => '1'
|
|
||||||
)
|
|
||||||
),
|
|
||||||
'value' => array(
|
|
||||||
$result['perlenabled']
|
|
||||||
)
|
|
||||||
),
|
),
|
||||||
'dnsenabled' => array(
|
'dnsenabled' => array(
|
||||||
'label' => $lng['admin']['dnsenabled'] . '?',
|
'label' => $lng['admin']['dnsenabled'] . '?',
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'values' => array(
|
'value' => '1',
|
||||||
array(
|
'checked' => $result['dnsenabled'],
|
||||||
'label' => $lng['panel']['yes'],
|
|
||||||
'value' => '1'
|
|
||||||
)
|
|
||||||
),
|
|
||||||
'value' => array(
|
|
||||||
$result['dnsenabled']
|
|
||||||
),
|
|
||||||
'visible' => (\Froxlor\Settings::Get('system.dnsenabled') == '1' ? true : false)
|
'visible' => (\Froxlor\Settings::Get('system.dnsenabled') == '1' ? true : false)
|
||||||
),
|
),
|
||||||
'logviewenabled' => array(
|
'logviewenabled' => array(
|
||||||
'label' => $lng['admin']['logviewenabled'] . '?',
|
'label' => $lng['admin']['logviewenabled'] . '?',
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'values' => array(
|
'value' => '1',
|
||||||
array(
|
'checked' => $result['logviewenabled']
|
||||||
'label' => $lng['panel']['yes'],
|
|
||||||
'value' => '1'
|
|
||||||
)
|
|
||||||
),
|
|
||||||
'value' => array(
|
|
||||||
$result['logviewenabled']
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'section_d' => array(
|
'section_d' => array(
|
||||||
'title' => $lng['admin']['movetoadmin'],
|
'title' => $lng['admin']['movetoadmin'],
|
||||||
'image' => 'icons/user_edit.png',
|
'image' => 'icons/user_edit.png',
|
||||||
'visible' => ($admin_select_cnt > 1),
|
'visible' => count($admin_select) > 0,
|
||||||
'fields' => array(
|
'fields' => array(
|
||||||
'move_to_admin' => array(
|
'move_to_admin' => array(
|
||||||
'label' => $lng['admin']['movecustomertoadmin'],
|
'label' => $lng['admin']['movecustomertoadmin'],
|
||||||
|
|||||||
@@ -35,6 +35,8 @@
|
|||||||
{{ formfields.select(id, field) }}
|
{{ formfields.select(id, field) }}
|
||||||
{% elseif field.type == 'textarea' %}
|
{% elseif field.type == 'textarea' %}
|
||||||
{{ formfields.textarea(id, field) }}
|
{{ formfields.textarea(id, field) }}
|
||||||
|
{% elseif field.type == 'label' %}
|
||||||
|
{{ formfields.plain(id, field) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
{% macro bool(id, field) %}
|
{% macro bool(id, field) %}
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<label for="{{ id }}" class="col-sm-4 col-form-label">{{ field.label|raw }}</label>
|
<label for="{{ id }}" class="col-sm-4 col-form-label">{{ field.label|raw }}
|
||||||
|
{% if field.desc is defined and field.desc is not empty %}<br><small>{{ field.desc|raw }}</small>
|
||||||
|
{% endif %}
|
||||||
|
</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
{% if field.is_array is defined and field.is_array == 1 and field.values is not empty %}
|
{% if field.is_array is defined and field.is_array == 1 and field.values is not empty %}
|
||||||
{% for subfield in field.values %}
|
{% for subfield in field.values %}
|
||||||
<div class="form-check form-switch">
|
<div class="form-check form-switch">
|
||||||
<input type="checkbox" value="{{ subfield.value }}" name="{{ id }}[]" class="form-check-input" {% if field.value is defined and field.value == subfield.value %} checked="checked" {% endif %} {% if field.visible is defined and field.visible == false %} disabled {% endif %}>
|
<input type="checkbox" value="{{ subfield.value }}" name="{{ id }}[]" class="form-check-input" {% if field.value is defined and subfield.value in field.value %} checked="checked" {% endif %} {% if field.visible is defined and field.visible == false %} disabled {% endif %}>
|
||||||
<label class="form-check-label">
|
<label class="form-check-label">
|
||||||
{{ subfield.label|raw }}
|
{{ subfield.label|raw }}
|
||||||
</label>
|
</label>
|
||||||
@@ -20,9 +23,24 @@
|
|||||||
</div>
|
</div>
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
|
{% macro plain(id, field) %}
|
||||||
|
<div class="row mb-3">
|
||||||
|
<label for="{{ id }}" class="col-sm-4 col-form-label">{{ field.label|raw }}
|
||||||
|
{% if field.desc is defined and field.desc is not empty %}<br><small>{{ field.desc|raw }}</small>
|
||||||
|
{% endif %}
|
||||||
|
</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input type="text" readonly class="form-control-plaintext" id="{{ id }}" value="{{ field.value }}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endmacro %}
|
||||||
|
|
||||||
{% macro input(id, field) %}
|
{% macro input(id, field) %}
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<label for="{{ id }}" class="col-sm-4 col-form-label">{{ field.label|raw }}</label>
|
<label for="{{ id }}" class="col-sm-4 col-form-label">{{ field.label|raw }}
|
||||||
|
{% if field.desc is defined and field.desc is not empty %}<br><small>{{ field.desc|raw }}</small>
|
||||||
|
{% endif %}
|
||||||
|
</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input type="{{ field.type }}" id="{{ id }}" name="{{ id }}" value="{{ field.value }}" class="form-control {% if field.valid is defined and field.valid == false %}is-invalid{% endif %}" {% if field.mandatory is defined and field.mandatory %} required {% endif %} {% if field.visible is defined and field.visible == false %} disabled {% endif %} {% if field.readonly is defined and field.readonly %} readonly {% endif %} {% if field.autocomplete is defined %} autocomplete="{{ field.autocomplete }}" {% endif %} {% if field.placeholder is defined %} placeholder="{{ field.placeholder }}" {% endif %}/>
|
<input type="{{ field.type }}" id="{{ id }}" name="{{ id }}" value="{{ field.value }}" class="form-control {% if field.valid is defined and field.valid == false %}is-invalid{% endif %}" {% if field.mandatory is defined and field.mandatory %} required {% endif %} {% if field.visible is defined and field.visible == false %} disabled {% endif %} {% if field.readonly is defined and field.readonly %} readonly {% endif %} {% if field.autocomplete is defined %} autocomplete="{{ field.autocomplete }}" {% endif %} {% if field.placeholder is defined %} placeholder="{{ field.placeholder }}" {% endif %}/>
|
||||||
</div>
|
</div>
|
||||||
@@ -37,7 +55,10 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<label for="{{ id }}" class="col-sm-4 col-form-label">{{ field.label|raw }}</label>
|
<label for="{{ id }}" class="col-sm-4 col-form-label">{{ field.label|raw }}
|
||||||
|
{% if field.desc is defined and field.desc is not empty %}<br><small>{{ field.desc|raw }}</small>
|
||||||
|
{% endif %}
|
||||||
|
</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input type="number" min="0" {% if max is not empty %} max="{{ max }}" {% endif %} id="{{ id }}" name="{{ id }}" value="{% if field.value >= 0 %}{{ field.value }}{% endif %}" class="form-control {% if field.valid is defined and field.valid == false %}is-invalid{% endif %}" {% if field.mandatory is defined and field.mandatory %} required {% endif %} {% if field.visible is defined and field.visible == false %} disabled {% endif %} {% if field.readonly is defined and field.readonly %} readonly {% endif %} {% if field.autocomplete is defined %} autocomplete="{{ field.autocomplete }}" {% endif %} {% if field.placeholder is defined %} placeholder="{{ field.placeholder }}" {% endif %}/>
|
<input type="number" min="0" {% if max is not empty %} max="{{ max }}" {% endif %} id="{{ id }}" name="{{ id }}" value="{% if field.value >= 0 %}{{ field.value }}{% endif %}" class="form-control {% if field.valid is defined and field.valid == false %}is-invalid{% endif %}" {% if field.mandatory is defined and field.mandatory %} required {% endif %} {% if field.visible is defined and field.visible == false %} disabled {% endif %} {% if field.readonly is defined and field.readonly %} readonly {% endif %} {% if field.autocomplete is defined %} autocomplete="{{ field.autocomplete }}" {% endif %} {% if field.placeholder is defined %} placeholder="{{ field.placeholder }}" {% endif %}/>
|
||||||
@@ -52,7 +73,10 @@
|
|||||||
|
|
||||||
{% macro select(id, field) %}
|
{% macro select(id, field) %}
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<label for="{{ id }}" class="col-sm-4 col-form-label">{{ field.label|raw }}</label>
|
<label for="{{ id }}" class="col-sm-4 col-form-label">{{ field.label|raw }}
|
||||||
|
{% if field.desc is defined and field.desc is not empty %}<br><small>{{ field.desc|raw }}</small>
|
||||||
|
{% endif %}
|
||||||
|
</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<select class="form-select {% if field.valid is defined and field.valid == false %}is-invalid{% endif %}" name="{{ id }}" id="{{ id }}" {% if field.mandatory is defined and field.mandatory %} required {% endif %} {% if field.visible is defined and field.visible == false %} disabled {% endif %}>
|
<select class="form-select {% if field.valid is defined and field.valid == false %}is-invalid{% endif %}" name="{{ id }}" id="{{ id }}" {% if field.mandatory is defined and field.mandatory %} required {% endif %} {% if field.visible is defined and field.visible == false %} disabled {% endif %}>
|
||||||
{% for val,txt in field.select_var %}
|
{% for val,txt in field.select_var %}
|
||||||
|
|||||||
Reference in New Issue
Block a user