lot of formfield corrections; form-adjustments; implementing of add/edit for most customer_* pages

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2022-02-21 17:42:04 +01:00
parent 1e4da4850e
commit 322719fec8
30 changed files with 455 additions and 684 deletions

View File

@@ -41,10 +41,11 @@ return array(
),
'path' => array(
'label' => $lng['panel']['path'],
'desc' => (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescriptionSubdomain'] : null) . (isset($pathSelect['note']) ? $pathSelect['note'] . '<br />' . $pathSelect['value'] : ''),
'desc' => (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescriptionSubdomain'] : null),
'type' => $pathSelect['type'],
'select_var' => $pathSelect['value'],
'selected' => $pathSelect['value']
'select_var' => $pathSelect['select_var'] ?? '',
'value' => $pathSelect['value'],
'note' => $pathSelect['note'] ?? '',
),
'url' => array(
'visible' => (\Froxlor\Settings::Get('panel.pathedit') == 'Dropdown' ? true : false),
@@ -70,17 +71,18 @@ return array(
'select_var' => $openbasedir
),
'phpsettingid' => array(
'visible' => (((int) \Froxlor\Settings::Get('system.mod_fcgid') == 1 || (int) \Froxlor\Settings::Get('phpfpm.enabled') == 1) && $has_phpconfigs ? true : false),
'visible' => (((int) \Froxlor\Settings::Get('system.mod_fcgid') == 1 || (int) \Froxlor\Settings::Get('phpfpm.enabled') == 1) && count($phpconfigs) > 0 ? true : false),
'label' => $lng['admin']['phpsettings']['title'],
'type' => 'select',
'select_var' => $phpconfigs
'select_var' => $phpconfigs,
'selected' => (int) Settings::Get('phpfpm.enabled') == 1) ? Settings::Get('phpfpm.defaultini') : Settings::Get('system.mod_fcgid_defaultini')
)
)
),
'section_bssl' => array(
'title' => $lng['admin']['webserversettings_ssl'],
'image' => 'icons/domain_add.png',
'visible' => \Froxlor\Settings::Get('system.use_ssl') == '1' ? ($ssl_ipsandports != '' ? true : false) : false,
'visible' => \Froxlor\Settings::Get('system.use_ssl') == '1' ? ($ssl_ipsandports ? true : false) : false,
'fields' => array(
'sslenabled' => array(
'label' => $lng['admin']['domain_sslenabled'],
@@ -104,7 +106,7 @@ return array(
'checked' => false
),
'http2' => array(
'visible' => ($ssl_ipsandports != '' ? true : false) && \Froxlor\Settings::Get('system.webserver') != 'lighttpd' && \Froxlor\Settings::Get('system.http2_support') == '1',
'visible' => ($ssl_ipsandports ? true : false) && \Froxlor\Settings::Get('system.webserver') != 'lighttpd' && \Froxlor\Settings::Get('system.http2_support') == '1',
'label' => $lng['admin']['domain_http2']['title'],
'desc' => $lng['admin']['domain_http2']['description'],
'type' => 'checkbox',

View File

@@ -30,14 +30,15 @@ return array(
),
'dns' => array(
'label' => $lng['dns']['destinationip'],
'type' => 'label',
'value' => $domainip
'type' => 'itemlist',
'values' => $domainips
),
'alias' => array(
'visible' => ($alias_check == '0' ? true : false),
'label' => $lng['domains']['aliasdomain'],
'type' => 'select',
'select_var' => $domains
'select_var' => $domains,
'selected' => $result['aliasdomain']
),
'path' => array(
'label' => $lng['panel']['path'],
@@ -57,14 +58,16 @@ return array(
'label' => $lng['domains']['redirectifpathisurl'],
'desc' => $lng['domains']['redirectifpathisurlinfo'],
'type' => 'select',
'select_var' => $redirectcode
'select_var' => $redirectcode,
'selected' => $def_code
),
'selectserveralias' => array(
'visible' => ((($result['parentdomainid'] == '0' && $userinfo['subdomains'] != '0') || $result['parentdomainid'] != '0') ? true : false),
'label' => $lng['admin']['selectserveralias'],
'desc' => $lng['admin']['selectserveralias_desc'],
'type' => 'select',
'select_var' => $serveraliasoptions
'select_var' => $serveraliasoptions,
'selected' => $serveraliasoptions_selected
),
'isemaildomain' => array(
'visible' => ((($result['subcanemaildomain'] == '1' || $result['subcanemaildomain'] == '2') && $result['parentdomainid'] != '0') ? true : false),
@@ -77,20 +80,22 @@ return array(
'visible' => ($result['openbasedir'] == '1') ? true : false,
'label' => $lng['domain']['openbasedirpath'],
'type' => 'select',
'select_var' => $openbasedir
'select_var' => $openbasedir,
'selected' => $result['openbasedir_path']
),
'phpsettingid' => array(
'visible' => (((int) \Froxlor\Settings::Get('system.mod_fcgid') == 1 || (int) \Froxlor\Settings::Get('phpfpm.enabled') == 1) && $has_phpconfigs ? true : false),
'visible' => (((int) \Froxlor\Settings::Get('system.mod_fcgid') == 1 || (int) \Froxlor\Settings::Get('phpfpm.enabled') == 1) && count($phpconfigs) > 0 ? true : false),
'label' => $lng['admin']['phpsettings']['title'],
'type' => 'select',
'select_var' => $phpconfigs
'select_var' => $phpconfigs,
'selected' => $result['phpsettingid']
)
)
),
'section_bssl' => array(
'title' => $lng['admin']['webserversettings_ssl'],
'image' => 'icons/domain_edit.png',
'visible' => \Froxlor\Settings::Get('system.use_ssl') == '1' ? ($ssl_ipsandports != '' ? (\Froxlor\Domain\Domain::domainHasSslIpPort($result['id']) ? true : false) : false) : false,
'visible' => \Froxlor\Settings::Get('system.use_ssl') == '1' ? ($ssl_ipsandports ? (\Froxlor\Domain\Domain::domainHasSslIpPort($result['id']) ? true : false) : false) : false,
'fields' => array(
'sslenabled' => array(
'label' => $lng['admin']['domain_sslenabled'],
@@ -114,7 +119,7 @@ return array(
'checked' => $result['letsencrypt']
),
'http2' => array(
'visible' => ($ssl_ipsandports != '' ? true : false) && \Froxlor\Settings::Get('system.webserver') != 'lighttpd' && \Froxlor\Settings::Get('system.http2_support') == '1',
'visible' => ($ssl_ipsandports ? true : false) && \Froxlor\Settings::Get('system.webserver') != 'lighttpd' && \Froxlor\Settings::Get('system.http2_support') == '1',
'label' => $lng['admin']['domain_http2']['title'],
'desc' => $lng['admin']['domain_http2']['description'],
'type' => 'checkbox',

View File

@@ -25,10 +25,11 @@ return array(
'fields' => array(
'path' => array(
'label' => $lng['panel']['backuppath']['title'],
'desc' => $lng['panel']['backuppath']['description'] . '<br>' . (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescription'] : null) . (isset($pathSelect['note']) ? '<br />' . $pathSelect['value'] : ''),
'desc' => $lng['panel']['backuppath']['description'] . '<br>' . (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescription'] : null),
'type' => $pathSelect['type'],
'select_var' => $pathSelect['value'],
'value' => $pathSelect['value']
'select_var' => $pathSelect['select_var'] ?? '',
'value' => $pathSelect['value'],
'note' => $pathSelect['note'] ?? '',
),
'path_protection_info' => array(
'label' => $lng['extras']['path_protection_label'],
@@ -38,41 +39,20 @@ return array(
'backup_web' => array(
'label' => $lng['extras']['backup_web'],
'type' => 'checkbox',
'values' => array(
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array(
'1'
)
'value' => '1',
'checked' => true
),
'backup_mail' => array(
'label' => $lng['extras']['backup_mail'],
'type' => 'checkbox',
'values' => array(
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array(
'1'
)
'value' => '1',
'checked' => true
),
'backup_dbs' => array(
'label' => $lng['extras']['backup_dbs'],
'type' => 'checkbox',
'values' => array(
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array(
'1'
)
'value' => '1',
'checked' => true
)
)
)

View File

@@ -25,21 +25,17 @@ return array(
'fields' => array(
'path' => array(
'label' => $lng['panel']['path'],
'desc' => (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescription'] : null) . (isset($pathSelect['note']) ? '<br />' . $pathSelect['value'] : ''),
'desc' => (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescription'] : null),
'type' => $pathSelect['type'],
'select_var' => $pathSelect['value'],
'value' => $pathSelect['value']
'select_var' => $pathSelect['select_var'] ?? '',
'value' => $pathSelect['value'],
'note' => $pathSelect['note'] ?? '',
),
'options_indexes' => array(
'label' => $lng['extras']['directory_browsing'],
'type' => 'checkbox',
'values' => array(
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array()
'value' => '1',
'checked' => false
),
'error404path' => array(
'label' => $lng['extras']['errordocument404path'],
@@ -62,13 +58,8 @@ return array(
'visible' => ($cperlenabled == 1),
'label' => $lng['extras']['execute_perl'],
'type' => 'checkbox',
'values' => array(
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array()
'value' => '1',
'checked' => false
)
)
)

View File

@@ -31,15 +31,8 @@ return array(
'options_indexes' => array(
'label' => $lng['extras']['directory_browsing'],
'type' => 'checkbox',
'values' => array(
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array(
$result['options_indexes']
)
'value' => '1',
'checked' => $result['options_indexes']
),
'error404path' => array(
'label' => $lng['extras']['errordocument404path'],
@@ -65,15 +58,8 @@ return array(
'visible' => ($cperlenabled == 1),
'label' => $lng['extras']['execute_perl'],
'type' => 'checkbox',
'values' => array(
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array(
$result['options_cgi']
)
'value' => '1',
'checked' => $result['options_cgi']
)
)
)

View File

@@ -25,10 +25,11 @@ return array(
'fields' => array(
'path' => array(
'label' => $lng['panel']['path'],
'desc' => (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescription'] : null) . (isset($pathSelect['note']) ? '<br />' . $pathSelect['value'] : ''),
'desc' => (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescription'] : null),
'type' => $pathSelect['type'],
'select_var' => $pathSelect['value'],
'value' => $pathSelect['value']
'select_var' => $pathSelect['select_var'] ?? '',
'value' => $pathSelect['value'],
'note' => $pathSelect['note'] ?? '',
),
'username' => array(
'label' => $lng['login']['username'],

View File

@@ -25,24 +25,28 @@ return array(
'ftp_username' => array(
'visible' => (\Froxlor\Settings::Get('customer.ftpatdomain') == '1' ? true : false),
'label' => $lng['login']['username'],
'type' => 'text'
),
'ftp_domain' => array(
'visible' => (\Froxlor\Settings::Get('customer.ftpatdomain') == '1' ? true : false),
'label' => $lng['domains']['domainname'],
'type' => 'select',
'select_var' => (isset($domains) ? $domains : "")
'type' => 'text',
'next_to' => (\Froxlor\Settings::Get('customer.ftpatdomain') == '1' && count($domainlist) > 0 ? [
'ftp_domain' => array(
'next_to_prefix' => '@',
'label' => $lng['domains']['domainname'],
'type' => 'select',
'select_var' => $domainlist
),
]
: [])
),
'ftp_description' => array(
'label' => $lng['panel']['ftpdesc'] = 'FTP description',
'label' => $lng['panel']['ftpdesc'],
'type' => 'text'
),
'path' => array(
'label' => $lng['panel']['path'],
'desc' => (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescription'] : null) . (isset($pathSelect['note']) ? '<br />' . $pathSelect['value'] : ''),
'desc' => (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescription'] : null),
'type' => $pathSelect['type'],
'select_var' => $pathSelect['value'],
'value' => $pathSelect['value']
'select_var' => $pathSelect['select_var'] ?? '',
'value' => $pathSelect['value'],
'note' => $pathSelect['note'] ?? '',
),
'ftp_password' => array(
'label' => $lng['login']['password'],
@@ -58,19 +62,15 @@ return array(
'sendinfomail' => array(
'label' => $lng['customer']['sendinfomail'],
'type' => 'checkbox',
'values' => array(
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array()
'value' => '1',
'checked' => false
),
'shell' => array(
'visible' => (\Froxlor\Settings::Get('system.allow_customer_shell') == '1' ? true : false),
'label' => $lng['panel']['shell'],
'type' => 'select',
'select_var' => (isset($shells) ? $shells : "")
'select_var' => $shells_avail,
'selected' => '/bin/false'
)
)
)

View File

@@ -28,16 +28,17 @@ return array(
'value' => $result['username']
),
'ftp_description' => array(
'label' => $lng['panel']['ftpdesc'] = 'FTP description',
'label' => $lng['panel']['ftpdesc'],
'type' => 'text',
'value' => $result['description']
),
'path' => array(
'label' => $lng['panel']['path'],
'desc' => (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescription'] : null) . (isset($pathSelect['note']) ? '<br />' . $pathSelect['value'] : ''),
'desc' => (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescription'] : null),
'type' => $pathSelect['type'],
'select_var' => $pathSelect['value'],
'value' => $pathSelect['value']
'select_var' => $pathSelect['select_var'] ?? '',
'value' => $pathSelect['value'],
'note' => $pathSelect['note'] ?? '',
),
'ftp_password' => array(
'label' => $lng['login']['password'],
@@ -55,7 +56,8 @@ return array(
'visible' => (\Froxlor\Settings::Get('system.allow_customer_shell') == '1' ? true : false),
'label' => $lng['panel']['shell'],
'type' => 'select',
'select_var' => (isset($shells) ? $shells : "")
'select_var' => $shells_avail,
'selected' => $result['shell'] ?? '/bin/false'
)
)
)

View File

@@ -34,7 +34,7 @@ return array(
'type' => 'text'
),
'mysql_server' => array(
'visible' => (1 < $count_mysqlservers ? true : false),
'visible' => (count($mysql_servers) > 1 ? true : false),
'label' => $lng['mysql']['mysql_server'],
'type' => 'select',
'select_var' => $mysql_servers
@@ -53,13 +53,8 @@ return array(
'sendinfomail' => array(
'label' => $lng['customer']['sendinfomail'],
'type' => 'checkbox',
'values' => array(
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array()
'value' => '1',
'checked' => false
)
)
)

View File

@@ -33,7 +33,7 @@ return array(
'value' => $result['description']
),
'mysql_server' => array(
'visible' => (1 < $count_mysqlservers ? true : false),
'visible' => ($count_mysql_servers > 1 ? true : false),
'label' => $lng['mysql']['mysql_server'],
'type' => 'label',
'value' => $sql_root['caption']