major refactoring of almost all files

This commit is contained in:
envoyr
2022-04-28 20:48:00 +02:00
parent a2e95b960f
commit 4f4c71d79b
285 changed files with 21716 additions and 18766 deletions

View File

@@ -4,31 +4,39 @@
* This file is part of the Froxlor project.
* 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
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Formfields
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you can also view it online at
* https://files.froxlor.org/misc/COPYING.txt
*
* @copyright the authors
* @author Froxlor team <team@froxlor.org>
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
*/
use Froxlor\Settings;
return array(
'domain_add' => array(
'title' => $lng['domains']['subdomain_add'],
return [
'domain_add' => [
'title' => lng('domains.subdomain_add'),
'image' => 'fa-solid fa-plus',
'self_overview' => ['section' => 'domains', 'page' => 'domains'],
'sections' => array(
'section_a' => array(
'title' => $lng['domains']['subdomain_add'],
'sections' => [
'section_a' => [
'title' => lng('domains.subdomain_add'),
'image' => 'icons/domain_add.png',
'fields' => array(
'subdomain' => array(
'label' => $lng['domains']['domainname'],
'fields' => [
'subdomain' => [
'label' => lng('domains.domainname'),
'type' => 'text',
'next_to' => [
'domain' => [
@@ -37,110 +45,110 @@ return array(
'select_var' => $domains
]
]
),
'alias' => array(
'label' => $lng['domains']['aliasdomain'],
],
'alias' => [
'label' => lng('domains.aliasdomain'),
'type' => 'select',
'select_var' => $aliasdomains
),
'path' => array(
'label' => $lng['panel']['path'],
'desc' => (Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescriptionSubdomain'] : null),
],
'path' => [
'label' => lng('panel.path'),
'desc' => (Settings::Get('panel.pathedit') != 'Dropdown' ? lng('panel.pathDescriptionSubdomain') : null),
'type' => $pathSelect['type'],
'select_var' => $pathSelect['select_var'] ?? '',
'value' => $pathSelect['value'],
'note' => $pathSelect['note'] ?? '',
),
'url' => array(
],
'url' => [
'visible' => Settings::Get('panel.pathedit') == 'Dropdown',
'label' => $lng['panel']['urloverridespath'],
'label' => lng('panel.urloverridespath'),
'type' => 'text'
),
'redirectcode' => array(
],
'redirectcode' => [
'visible' => Settings::Get('customredirect.enabled') == '1',
'label' => $lng['domains']['redirectifpathisurl'],
'desc' => $lng['domains']['redirectifpathisurlinfo'],
'label' => lng('domains.redirectifpathisurl'),
'desc' => lng('domains.redirectifpathisurlinfo'),
'type' => 'select',
'select_var' => isset($redirectcode) ? $redirectcode : null
),
'selectserveralias' => array(
'label' => $lng['admin']['selectserveralias'],
'desc' => $lng['admin']['selectserveralias_desc'],
],
'selectserveralias' => [
'label' => lng('admin.selectserveralias'),
'desc' => lng('admin.selectserveralias_desc'),
'type' => 'label',
'value' => $lng['customer']['selectserveralias_addinfo']
),
'openbasedir_path' => array(
'label' => $lng['domain']['openbasedirpath'],
'value' => lng('customer.selectserveralias_addinfo')
],
'openbasedir_path' => [
'label' => lng('domain.openbasedirpath'),
'type' => 'select',
'select_var' => $openbasedir
),
'phpsettingid' => array(
'visible' => ((int) Settings::Get('system.mod_fcgid') == 1 || (int) Settings::Get('phpfpm.enabled') == 1) && count($phpconfigs) > 0,
'label' => $lng['admin']['phpsettings']['title'],
],
'phpsettingid' => [
'visible' => ((int)Settings::Get('system.mod_fcgid') == 1 || (int)Settings::Get('phpfpm.enabled') == 1) && count($phpconfigs) > 0,
'label' => lng('admin.phpsettings.title'),
'type' => 'select',
'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'],
'selected' => (int)Settings::Get('phpfpm.enabled') == 1 ? Settings::Get('phpfpm.defaultini') : Settings::Get('system.mod_fcgid_defaultini')
]
]
],
'section_bssl' => [
'title' => lng('admin.webserversettings_ssl'),
'image' => 'icons/domain_add.png',
'visible' => Settings::Get('system.use_ssl') == '1' && $ssl_ipsandports,
'fields' => array(
'sslenabled' => array(
'label' => $lng['admin']['domain_sslenabled'],
'fields' => [
'sslenabled' => [
'label' => lng('admin.domain_sslenabled'),
'type' => 'checkbox',
'value' => '1',
'checked' => true
),
'ssl_redirect' => array(
'label' => $lng['domains']['ssl_redirect']['title'],
'desc' => $lng['domains']['ssl_redirect']['description'],
],
'ssl_redirect' => [
'label' => lng('domains.ssl_redirect.title'),
'desc' => lng('domains.ssl_redirect.description'),
'type' => 'checkbox',
'value' => '1',
'checked' => false
),
'letsencrypt' => array(
],
'letsencrypt' => [
'visible' => Settings::Get('system.leenabled') == '1',
'label' => $lng['customer']['letsencrypt']['title'],
'desc' => $lng['customer']['letsencrypt']['description'],
'label' => lng('customer.letsencrypt.title'),
'desc' => lng('customer.letsencrypt.description'),
'type' => 'checkbox',
'value' => '1',
'checked' => false
),
'http2' => array(
],
'http2' => [
'visible' => $ssl_ipsandports && Settings::Get('system.webserver') != 'lighttpd' && Settings::Get('system.http2_support') == '1',
'label' => $lng['admin']['domain_http2']['title'],
'desc' => $lng['admin']['domain_http2']['description'],
'label' => lng('admin.domain_http2.title'),
'desc' => lng('admin.domain_http2.description'),
'type' => 'checkbox',
'value' => '1',
'checked' => false
),
'hsts_maxage' => array(
'label' => $lng['admin']['domain_hsts_maxage']['title'],
'desc' => $lng['admin']['domain_hsts_maxage']['description'],
],
'hsts_maxage' => [
'label' => lng('admin.domain_hsts_maxage.title'),
'desc' => lng('admin.domain_hsts_maxage.description'),
'type' => 'number',
'min' => 0,
'max' => 94608000, // 3-years
'value' => 0
),
'hsts_sub' => array(
'label' => $lng['admin']['domain_hsts_incsub']['title'],
'desc' => $lng['admin']['domain_hsts_incsub']['description'],
],
'hsts_sub' => [
'label' => lng('admin.domain_hsts_incsub.title'),
'desc' => lng('admin.domain_hsts_incsub.description'),
'type' => 'checkbox',
'value' => '1',
'checked' => false
),
'hsts_preload' => array(
'label' => $lng['admin']['domain_hsts_preload']['title'],
'desc' => $lng['admin']['domain_hsts_preload']['description'],
],
'hsts_preload' => [
'label' => lng('admin.domain_hsts_preload.title'),
'desc' => lng('admin.domain_hsts_preload.description'),
'type' => 'checkbox',
'value' => '1',
'checked' => false
)
)
)
)
)
);
]
]
]
]
]
];

View File

@@ -4,153 +4,165 @@
* This file is part of the Froxlor project.
* 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
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Formfields
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you can also view it online at
* https://files.froxlor.org/misc/COPYING.txt
*
* @copyright the authors
* @author Froxlor team <team@froxlor.org>
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
*/
return array(
'domain_edit' => array(
'title' => $lng['domains']['subdomain_edit'],
use Froxlor\Domain\Domain;
use Froxlor\Settings;
return [
'domain_edit' => [
'title' => lng('domains.subdomain_edit'),
'image' => 'fa-solid fa-pen',
'self_overview' => ['section' => 'domains', 'page' => 'domains'],
'sections' => array(
'section_a' => array(
'title' => $lng['domains']['subdomain_edit'],
'sections' => [
'section_a' => [
'title' => lng('domains.subdomain_edit'),
'image' => 'icons/domain_edit.png',
'fields' => array(
'domain' => array(
'label' => $lng['domains']['domainname'],
'fields' => [
'domain' => [
'label' => lng('domains.domainname'),
'type' => 'label',
'value' => $result['domain']
),
'dns' => array(
'label' => $lng['dns']['destinationip'],
],
'dns' => [
'label' => lng('dns.destinationip'),
'type' => 'itemlist',
'values' => $domainips
),
'alias' => array(
],
'alias' => [
'visible' => $alias_check == '0',
'label' => $lng['domains']['aliasdomain'],
'label' => lng('domains.aliasdomain'),
'type' => 'select',
'select_var' => $domains,
'selected' => $result['aliasdomain']
),
'path' => array(
'label' => $lng['panel']['path'],
'desc' => (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescriptionSubdomain'] : null) . (isset($pathSelect['note']) ? '<br />' . $pathSelect['value'] : ''),
],
'path' => [
'label' => lng('panel.path'),
'desc' => (Settings::Get('panel.pathedit') != 'Dropdown' ? lng('panel.pathDescriptionSubdomain') : null) . (isset($pathSelect['note']) ? '<br />' . $pathSelect['value'] : ''),
'type' => $pathSelect['type'],
'select_var' => $pathSelect['value'],
'selected' => $pathSelect['value']
),
'url' => array(
'visible' => \Froxlor\Settings::Get('panel.pathedit') == 'Dropdown',
'label' => $lng['panel']['urloverridespath'],
],
'url' => [
'visible' => Settings::Get('panel.pathedit') == 'Dropdown',
'label' => lng('panel.urloverridespath'),
'type' => 'text',
'value' => $urlvalue
),
'redirectcode' => array(
'visible' => \Froxlor\Settings::Get('customredirect.enabled') == '1',
'label' => $lng['domains']['redirectifpathisurl'],
'desc' => $lng['domains']['redirectifpathisurlinfo'],
],
'redirectcode' => [
'visible' => Settings::Get('customredirect.enabled') == '1',
'label' => lng('domains.redirectifpathisurl'),
'desc' => lng('domains.redirectifpathisurlinfo'),
'type' => 'select',
'select_var' => $redirectcode,
'selected' => $def_code
),
'selectserveralias' => array(
],
'selectserveralias' => [
'visible' => ($result['parentdomainid'] == '0' && $userinfo['subdomains'] != '0') || $result['parentdomainid'] != '0',
'label' => $lng['admin']['selectserveralias'],
'desc' => $lng['admin']['selectserveralias_desc'],
'label' => lng('admin.selectserveralias'),
'desc' => lng('admin.selectserveralias_desc'),
'type' => 'select',
'select_var' => $serveraliasoptions,
'selected' => $serveraliasoptions_selected
),
'isemaildomain' => array(
],
'isemaildomain' => [
'visible' => ($result['subcanemaildomain'] == '1' || $result['subcanemaildomain'] == '2') && $result['parentdomainid'] != '0',
'label' => 'Emaildomain',
'type' => 'checkbox',
'value' => '1',
'checked' => $result['isemaildomain']
),
'openbasedir_path' => array(
],
'openbasedir_path' => [
'visible' => $result['openbasedir'] == '1',
'label' => $lng['domain']['openbasedirpath'],
'label' => lng('domain.openbasedirpath'),
'type' => 'select',
'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) && count($phpconfigs) > 0,
'label' => $lng['admin']['phpsettings']['title'],
],
'phpsettingid' => [
'visible' => ((int)Settings::Get('system.mod_fcgid') == 1 || (int)Settings::Get('phpfpm.enabled') == 1) && count($phpconfigs) > 0,
'label' => lng('admin.phpsettings.title'),
'type' => 'select',
'select_var' => $phpconfigs,
'selected' => $result['phpsettingid']
)
)
),
'section_bssl' => array(
'title' => $lng['admin']['webserversettings_ssl'],
]
]
],
'section_bssl' => [
'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']),
'fields' => array(
'sslenabled' => array(
'label' => $lng['admin']['domain_sslenabled'],
'visible' => Settings::Get('system.use_ssl') == '1' && $ssl_ipsandports && Domain::domainHasSslIpPort($result['id']),
'fields' => [
'sslenabled' => [
'label' => lng('admin.domain_sslenabled'),
'type' => 'checkbox',
'value' => '1',
'checked' => $result['ssl_enabled']
),
'ssl_redirect' => array(
'label' => $lng['domains']['ssl_redirect']['title'],
'desc' => $lng['domains']['ssl_redirect']['description'] . ($result['temporary_ssl_redirect'] > 1 ? $lng['domains']['ssl_redirect_temporarilydisabled'] : ''),
],
'ssl_redirect' => [
'label' => lng('domains.ssl_redirect.title'),
'desc' => lng('domains.ssl_redirect.description') . ($result['temporary_ssl_redirect'] > 1 ? lng('domains.ssl_redirect_temporarilydisabled') : ''),
'type' => 'checkbox',
'value' => '1',
'checked' => $result['ssl_redirect']
),
'letsencrypt' => array(
'visible' => \Froxlor\Settings::Get('system.leenabled') == '1',
'label' => $lng['customer']['letsencrypt']['title'],
'desc' => $lng['customer']['letsencrypt']['description'],
],
'letsencrypt' => [
'visible' => Settings::Get('system.leenabled') == '1',
'label' => lng('customer.letsencrypt.title'),
'desc' => lng('customer.letsencrypt.description'),
'type' => 'checkbox',
'value' => '1',
'checked' => $result['letsencrypt']
),
'http2' => array(
'visible' => $ssl_ipsandports && \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'],
],
'http2' => [
'visible' => $ssl_ipsandports && Settings::Get('system.webserver') != 'lighttpd' && Settings::Get('system.http2_support') == '1',
'label' => lng('admin.domain_http2.title'),
'desc' => lng('admin.domain_http2.description'),
'type' => 'checkbox',
'value' => '1',
'checked' => $result['http2']
),
'hsts_maxage' => array(
'label' => $lng['admin']['domain_hsts_maxage']['title'],
'desc' => $lng['admin']['domain_hsts_maxage']['description'],
],
'hsts_maxage' => [
'label' => lng('admin.domain_hsts_maxage.title'),
'desc' => lng('admin.domain_hsts_maxage.description'),
'type' => 'number',
'min' => 0,
'max' => 94608000, // 3-years
'value' => $result['hsts']
),
'hsts_sub' => array(
'label' => $lng['admin']['domain_hsts_incsub']['title'],
'desc' => $lng['admin']['domain_hsts_incsub']['description'],
],
'hsts_sub' => [
'label' => lng('admin.domain_hsts_incsub.title'),
'desc' => lng('admin.domain_hsts_incsub.description'),
'type' => 'checkbox',
'value' => '1',
'checked' => $result['hsts_sub']
),
'hsts_preload' => array(
'label' => $lng['admin']['domain_hsts_preload']['title'],
'desc' => $lng['admin']['domain_hsts_preload']['description'],
],
'hsts_preload' => [
'label' => lng('admin.domain_hsts_preload.title'),
'desc' => lng('admin.domain_hsts_preload.description'),
'type' => 'checkbox',
'value' => '1',
'checked' => $result['hsts_preload']
)
)
)
)
)
);
]
]
]
]
]
];

View File

@@ -4,43 +4,55 @@
* This file is part of the Froxlor project.
* 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
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Formfields
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you can also view it online at
* https://files.froxlor.org/misc/COPYING.txt
*
* @copyright the authors
* @author Froxlor team <team@froxlor.org>
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
*/
return array(
'emails_accountchangepasswd' => array(
'title' => $lng['menue']['main']['changepassword'],
use Froxlor\Settings;
use Froxlor\System\Crypt;
return [
'emails_accountchangepasswd' => [
'title' => lng('menue.main.changepassword'),
'image' => 'icons/email_edit.png',
'sections' => array(
'section_a' => array(
'title' => $lng['menue']['main']['changepassword'],
'sections' => [
'section_a' => [
'title' => lng('menue.main.changepassword'),
'image' => 'icons/email_edit.png',
'fields' => array(
'email_full' => array(
'label' => $lng['emails']['emailaddress'],
'fields' => [
'email_full' => [
'label' => lng('emails.emailaddress'),
'type' => 'label',
'value' => $result['email_full']
),
'email_password' => array(
'label' => $lng['login']['password'],
],
'email_password' => [
'label' => lng('login.password'),
'type' => 'password',
'autocomplete' => 'off'
),
'email_password_suggestion' => array(
'label' => $lng['customer']['generated_pwd'],
],
'email_password_suggestion' => [
'label' => lng('customer.generated_pwd'),
'type' => 'text',
'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''),
'value' => \Froxlor\System\Crypt::generatePassword()
)
)
)
)
)
);
'visible' => (Settings::Get('panel.password_regex') == ''),
'value' => Crypt::generatePassword()
]
]
]
]
]
];

View File

@@ -4,37 +4,46 @@
* This file is part of the Froxlor project.
* 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
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Formfields
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you can also view it online at
* https://files.froxlor.org/misc/COPYING.txt
*
* @copyright the authors
* @author Froxlor team <team@froxlor.org>
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
*/
return array(
'emails_accountchangequota' => array(
'title' => $lng['emails']['quota_edit'],
return [
'emails_accountchangequota' => [
'title' => lng('emails.quota_edit'),
'image' => 'icons/email_edit.png',
'sections' => array(
'section_a' => array(
'title' => $lng['emails']['quota_edit'],
'sections' => [
'section_a' => [
'title' => lng('emails.quota_edit'),
'image' => 'icons/email_edit.png',
'fields' => array(
'email_full' => array(
'label' => $lng['emails']['emailaddress'],
'fields' => [
'email_full' => [
'label' => lng('emails.emailaddress'),
'type' => 'label',
'value' => $result['email_full']
),
'email_quota' => array(
'label' => $lng['emails']['quota'] . ' (MiB)',
],
'email_quota' => [
'label' => lng('emails.quota') . ' (MiB)',
'type' => 'text',
'value' => $result['quota']
)
)
)
)
)
);
]
]
]
]
]
];

View File

@@ -4,28 +4,37 @@
* This file is part of the Froxlor project.
* 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
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Formfields
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you can also view it online at
* https://files.froxlor.org/misc/COPYING.txt
*
* @copyright the authors
* @author Froxlor team <team@froxlor.org>
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
*/
return array(
'emails_add' => array(
'title' => $lng['emails']['emails_add'],
return [
'emails_add' => [
'title' => lng('emails.emails_add'),
'image' => 'fa-solid fa-plus',
'self_overview' => ['section' => 'email', 'page' => 'emails'],
'sections' => array(
'section_a' => array(
'title' => $lng['emails']['emails_add'],
'sections' => [
'section_a' => [
'title' => lng('emails.emails_add'),
'image' => 'icons/email_add.png',
'fields' => array(
'email_part' => array(
'label' => $lng['emails']['emailaddress'],
'fields' => [
'email_part' => [
'label' => lng('emails.emailaddress'),
'type' => 'text',
'next_to' => [
'domain' => [
@@ -34,15 +43,15 @@ return array(
'select_var' => $domains
]
]
),
'iscatchall' => array(
'label' => $lng['emails']['iscatchall'],
],
'iscatchall' => [
'label' => lng('emails.iscatchall'),
'type' => 'checkbox',
'value' => '1',
'checked' => false
)
)
)
)
)
);
]
]
]
]
]
];

View File

@@ -4,58 +4,70 @@
* This file is part of the Froxlor project.
* 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
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Formfields
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you can also view it online at
* https://files.froxlor.org/misc/COPYING.txt
*
* @copyright the authors
* @author Froxlor team <team@froxlor.org>
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
*/
return array(
'emails_addaccount' => array(
'title' => $lng['emails']['account_add'],
use Froxlor\Settings;
use Froxlor\System\Crypt;
return [
'emails_addaccount' => [
'title' => lng('emails.account_add'),
'image' => 'fa-solid fa-plus',
'sections' => array(
'section_a' => array(
'title' => $lng['emails']['account_add'],
'sections' => [
'section_a' => [
'title' => lng('emails.account_add'),
'image' => 'icons/email_add.png',
'fields' => array(
'emailaddr' => array(
'label' => $lng['emails']['emailaddress'],
'fields' => [
'emailaddr' => [
'label' => lng('emails.emailaddress'),
'type' => 'label',
'value' => $result['email_full']
),
'email_password' => array(
'label' => $lng['login']['password'],
],
'email_password' => [
'label' => lng('login.password'),
'type' => 'password',
'autocomplete' => 'off',
'next_to' => [
'admin_password_suggestion' => array(
'next_to_prefix' => $lng['customer']['generated_pwd'].':',
'admin_password_suggestion' => [
'next_to_prefix' => lng('customer.generated_pwd') . ':',
'type' => 'text',
'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''),
'value' => \Froxlor\System\Crypt::generatePassword(),
'visible' => (Settings::Get('panel.password_regex') == ''),
'value' => Crypt::generatePassword(),
'readonly' => true
)
]
]
),
'email_quota' => array(
'visible' => \Froxlor\Settings::Get('system.mail_quota_enabled') == '1',
'label' => $lng['emails']['quota'],
],
'email_quota' => [
'visible' => Settings::Get('system.mail_quota_enabled') == '1',
'label' => lng('emails.quota'),
'desc' => "MiB",
'type' => 'number',
'value' => $quota
),
'alternative_email' => array(
'visible' => \Froxlor\Settings::Get('panel.sendalternativemail') == '1',
'label' => $lng['emails']['alternative_emailaddress'],
],
'alternative_email' => [
'visible' => Settings::Get('panel.sendalternativemail') == '1',
'label' => lng('emails.alternative_emailaddress'),
'type' => 'text'
)
)
)
)
)
);
]
]
]
]
]
];

View File

@@ -4,36 +4,45 @@
* This file is part of the Froxlor project.
* 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
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Formfields
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you can also view it online at
* https://files.froxlor.org/misc/COPYING.txt
*
* @copyright the authors
* @author Froxlor team <team@froxlor.org>
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
*/
return array(
'emails_addforwarder' => array(
'title' => $lng['emails']['forwarder_add'],
return [
'emails_addforwarder' => [
'title' => lng('emails.forwarder_add'),
'image' => 'fa-solid fa-plus',
'sections' => array(
'section_a' => array(
'title' => $lng['emails']['forwarder_add'],
'sections' => [
'section_a' => [
'title' => lng('emails.forwarder_add'),
'image' => 'icons/autoresponder_add.png',
'fields' => array(
'emailaddr' => array(
'label' => $lng['emails']['from'],
'fields' => [
'emailaddr' => [
'label' => lng('emails.from'),
'type' => 'label',
'value' => $result['email_full']
),
'destination' => array(
'label' => $lng['emails']['to'],
],
'destination' => [
'label' => lng('emails.to'),
'type' => 'email'
)
)
)
)
)
);
]
]
]
]
]
];

View File

@@ -4,109 +4,120 @@
* This file is part of the Froxlor project.
* 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
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Formfields
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you can also view it online at
* https://files.froxlor.org/misc/COPYING.txt
*
* @copyright the authors
* @author Froxlor team <team@froxlor.org>
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
*/
use Froxlor\Settings;
return array(
'emails_edit' => array(
'title' => $lng['emails']['emails_edit'],
'title' => lng('emails.emails_edit'),
'image' => 'fa-solid fa-pen',
'self_overview' => ['section' => 'email', 'page' => 'emails'],
'sections' => array(
'section_a' => array(
'title' => $lng['emails']['emails_edit'],
'title' => lng('emails.emails_edit'),
'image' => 'icons/email_edit.png',
'nobuttons' => true,
'fields' => array(
'email_full' => array(
'label' => $lng['emails']['emailaddress'],
'email_full' => [
'label' => lng('emails.emailaddress'),
'type' => 'label',
'value' => $result['email_full']
),
'account_yes' => array(
'visible' => (int) $result['popaccountid'] != 0,
'label' => $lng['emails']['account'],
],
'account_yes' => [
'visible' => (int)$result['popaccountid'] != 0,
'label' => lng('emails.account'),
'type' => 'label',
'value' => $lng['panel']['yes'],
'value' => lng('panel.yes'),
'next_to' => [
'edit_link' => [
'type' => 'link',
'href' => $filename . '?page=accounts&amp;action=changepw&amp;id=' . $result['id'],
'label' => $lng['menue']['main']['changepassword'],
'label' => lng('menue.main.changepassword'),
'classes' => 'btn btn-sm btn-secondary'
],
'del_link' => [
'type' => 'link',
'href' => $filename . '?page=accounts&amp;action=delete&amp;id=' . $result['id'],
'label' => $lng['emails']['account_delete'],
'label' => lng('emails.account_delete'),
'classes' => 'btn btn-sm btn-danger'
]
]
),
'account_no' => array(
'visible' => (int) $result['popaccountid'] == 0,
'label' => $lng['emails']['account'],
],
'account_no' => [
'visible' => (int)$result['popaccountid'] == 0,
'label' => lng('emails.account'),
'type' => 'label',
'value' => $lng['panel']['no'],
'value' => lng('panel.no'),
'next_to' => [
'add_link' => [
'type' => 'link',
'href' => $filename . '?page=accounts&amp;action=add&amp;id=' . $result['id'],
'label' => $lng['emails']['account_add'],
'label' => lng('emails.account_add'),
'classes' => 'btn btn-sm btn-primary'
]
]
),
'mail_quota' => array(
'visible' => ((int) $result['popaccountid'] != 0 && \Froxlor\Settings::Get('system.mail_quota_enabled')),
'label' => $lng['customer']['email_quota'],
],
'mail_quota' => [
'visible' => ((int)$result['popaccountid'] != 0 && Settings::Get('system.mail_quota_enabled')),
'label' => lng('customer.email_quota'),
'type' => 'label',
'value' => $result['quota'] . ' MiB',
'next_to' => [
'add_link' => [
'visible' => ((int)$result['popaccountid'] != 0 && \Froxlor\Settings::Get('system.mail_quota_enabled')),
'visible' => ((int)$result['popaccountid'] != 0 && Settings::Get('system.mail_quota_enabled')),
'type' => 'link',
'href' => $filename . '?page=accounts&amp;action=changequota&amp;id=' . $result['id'],
'label' => $lng['emails']['quota_edit'],
'label' => lng('emails.quota_edit'),
'classes' => 'btn btn-sm btn-secondary'
]
]
),
],
'mail_catchall' => array(
'label' => $lng['emails']['catchall'],
'label' => lng('emails.catchall'),
'type' => 'label',
'value' => ((int)$result['iscatchall'] == 0 ? $lng['panel']['no'] : $lng['panel']['yes']),
'value' => ((int)$result['iscatchall'] == 0 ? lng('panel.no'] : lng('panel')['yes')),
'next_to' => [
'add_link' => [
'type' => 'link',
'href' => $filename . '?page=' . $page . '&amp;action=togglecatchall&amp;id=' . $result['id'],
'label' => '<i class="fa-solid fa-arrow-right-arrow-left"></i> ' . $lng['panel']['toggle'],
'classes' => 'btn btn-sm btn-secondary'
]
]
'add_link' => [
'type' => 'link',
'href' => $filename . '?page=' . $page . '&amp;action=togglecatchall&amp;id=' . $result['id'],
'label' => '<i class="fa-solid fa-arrow-right-arrow-left"></i> ' . lng('panel.toggle'),
'classes' => 'btn btn-sm btn-secondary'
]
]
),
'mail_fwds' => array(
'label' => $lng['emails']['forwarders'] . ' (' . $forwarders_count . ')',
'type' => 'itemlist',
'values' => $forwarders,
'next_to' => [
'add_link' => [
'type' => 'link',
'href' => $filename . '?page=forwarders&amp;action=add&amp;id=' . $result['id'],
'label' => $lng['emails']['forwarder_add'],
'classes' => 'btn btn-sm btn-primary'
]
]
)
'mail_fwds' => [
'label' => lng('emails.forwarders') . ' (' . $forwarders_count . ')',
'type' => 'itemlist',
'values' => $forwarders,
'next_to' => [
'add_link' => [
'type' => 'link',
'href' => $filename . '?page=forwarders&amp;action=add&amp;id=' . $result['id'],
'label' => lng('emails.forwarder_add'),
'classes' => 'btn btn-sm btn-primary'
]
]
]
)
)
)
)
);
)

View File

@@ -6,57 +6,60 @@
*
* 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
* COPYING file online at https://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Formfields
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 https://files.froxlor.org/misc/COPYING.txt
* @package Formfields
*
*/
return array(
'backup' => array(
'title' => $lng['extras']['backup'],
use Froxlor\Settings;
return [
'backup' => [
'title' => lng('extras.backup'),
'image' => 'fa-solid fa-server',
'sections' => array(
'section_a' => array(
'title' => $lng['extras']['backup'],
'sections' => [
'section_a' => [
'title' => lng('extras.backup'),
'image' => 'icons/backup_big.png',
'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),
'fields' => [
'path' => [
'label' => lng('panel.backuppath.title'),
'desc' => lng('panel.backuppath.description') . '<br>' . (Settings::Get('panel.pathedit') != 'Dropdown' ? lng('panel.pathDescription') : null),
'type' => $pathSelect['type'],
'select_var' => $pathSelect['select_var'] ?? '',
'value' => $pathSelect['value'],
'note' => $pathSelect['note'] ?? '',
),
'path_protection_info' => array(
'label' => $lng['extras']['path_protection_label'],
],
'path_protection_info' => [
'label' => lng('extras.path_protection_label'),
'type' => 'infotext',
'value' => $lng['extras']['path_protection_info'],
'value' => lng('extras.path_protection_info'),
'classes' => 'fw-bold text-danger'
),
'backup_web' => array(
'label' => $lng['extras']['backup_web'],
],
'backup_web' => [
'label' => lng('extras.backup_web'),
'type' => 'checkbox',
'value' => '1',
'checked' => true
),
'backup_mail' => array(
'label' => $lng['extras']['backup_mail'],
],
'backup_mail' => [
'label' => lng('extras.backup_mail'),
'type' => 'checkbox',
'value' => '1',
'checked' => true
),
'backup_dbs' => array(
'label' => $lng['extras']['backup_dbs'],
],
'backup_dbs' => [
'label' => lng('extras.backup_dbs'),
'type' => 'checkbox',
'value' => '1',
'checked' => true
)
)
)
)
)
);
]
]
]
]
]
];

View File

@@ -4,66 +4,77 @@
* This file is part of the Froxlor project.
* 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
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Formfields
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you can also view it online at
* https://files.froxlor.org/misc/COPYING.txt
*
* @copyright the authors
* @author Froxlor team <team@froxlor.org>
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
*/
return array(
'htaccess_add' => array(
'title' => $lng['extras']['pathoptions_add'],
use Froxlor\Settings;
return [
'htaccess_add' => [
'title' => lng('extras.pathoptions_add'),
'image' => 'fa-solid fa-folder',
'self_overview' => ['section' => 'extras', 'page' => 'htaccess'],
'sections' => array(
'section_a' => array(
'title' => $lng['extras']['pathoptions_add'],
'sections' => [
'section_a' => [
'title' => lng('extras.pathoptions_add'),
'image' => 'icons/htpasswd_add.png',
'fields' => array(
'path' => array(
'label' => $lng['panel']['path'],
'desc' => (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescription'] : null),
'fields' => [
'path' => [
'label' => lng('panel.path'),
'desc' => (Settings::Get('panel.pathedit') != 'Dropdown' ? lng('panel.pathDescription') : null),
'type' => $pathSelect['type'],
'select_var' => $pathSelect['select_var'] ?? '',
'value' => $pathSelect['value'],
'note' => $pathSelect['note'] ?? '',
),
'options_indexes' => array(
'label' => $lng['extras']['directory_browsing'],
],
'options_indexes' => [
'label' => lng('extras.directory_browsing'),
'type' => 'checkbox',
'value' => '1',
'checked' => false
),
'error404path' => array(
'label' => $lng['extras']['errordocument404path'],
'desc' => $lng['panel']['descriptionerrordocument'],
],
'error404path' => [
'label' => lng('extras.errordocument404path'),
'desc' => lng('panel.descriptionerrordocument'),
'type' => 'text'
),
'error403path' => array(
'visible' => (\Froxlor\Settings::Get('system.webserver') == 'apache2'),
'label' => $lng['extras']['errordocument403path'],
'desc' => $lng['panel']['descriptionerrordocument'],
],
'error403path' => [
'visible' => (Settings::Get('system.webserver') == 'apache2'),
'label' => lng('extras.errordocument403path'),
'desc' => lng('panel.descriptionerrordocument'),
'type' => 'text'
),
'error500path' => array(
'visible' => (\Froxlor\Settings::Get('system.webserver') == 'apache2'),
'label' => $lng['extras']['errordocument500path'],
'desc' => $lng['panel']['descriptionerrordocument'],
],
'error500path' => [
'visible' => (Settings::Get('system.webserver') == 'apache2'),
'label' => lng('extras.errordocument500path'),
'desc' => lng('panel.descriptionerrordocument'),
'type' => 'text'
),
'options_cgi' => array(
],
'options_cgi' => [
'visible' => ($cperlenabled == 1),
'label' => $lng['extras']['execute_perl'],
'label' => lng('extras.execute_perl'),
'type' => 'checkbox',
'value' => '1',
'checked' => false
)
)
)
)
)
);
]
]
]
]
]
];

View File

@@ -4,66 +4,77 @@
* This file is part of the Froxlor project.
* 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
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Formfields
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you can also view it online at
* https://files.froxlor.org/misc/COPYING.txt
*
* @copyright the authors
* @author Froxlor team <team@froxlor.org>
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
*/
return array(
'htaccess_edit' => array(
'title' => $lng['extras']['pathoptions_edit'],
use Froxlor\Settings;
return [
'htaccess_edit' => [
'title' => lng('extras.pathoptions_edit'),
'image' => 'fa-solid fa-folder',
'self_overview' => ['section' => 'extras', 'page' => 'htaccess'],
'sections' => array(
'section_a' => array(
'title' => $lng['extras']['pathoptions_edit'],
'sections' => [
'section_a' => [
'title' => lng('extras.pathoptions_edit'),
'image' => 'icons/htpasswd_edit.png',
'fields' => array(
'path' => array(
'label' => $lng['panel']['path'],
'fields' => [
'path' => [
'label' => lng('panel.path'),
'type' => 'label',
'value' => $result['path']
),
'options_indexes' => array(
'label' => $lng['extras']['directory_browsing'],
],
'options_indexes' => [
'label' => lng('extras.directory_browsing'),
'type' => 'checkbox',
'value' => '1',
'checked' => $result['options_indexes']
),
'error404path' => array(
'label' => $lng['extras']['errordocument404path'],
'desc' => $lng['panel']['descriptionerrordocument'],
],
'error404path' => [
'label' => lng('extras.errordocument404path'),
'desc' => lng('panel.descriptionerrordocument'),
'type' => 'text',
'value' => $result['error404path']
),
'error403path' => array(
'visible' => (\Froxlor\Settings::Get('system.webserver') == 'apache2'),
'label' => $lng['extras']['errordocument403path'],
'desc' => $lng['panel']['descriptionerrordocument'],
],
'error403path' => [
'visible' => (Settings::Get('system.webserver') == 'apache2'),
'label' => lng('extras.errordocument403path'),
'desc' => lng('panel.descriptionerrordocument'),
'type' => 'text',
'value' => $result['error403path']
),
'error500path' => array(
'visible' => (\Froxlor\Settings::Get('system.webserver') == 'apache2'),
'label' => $lng['extras']['errordocument500path'],
'desc' => $lng['panel']['descriptionerrordocument'],
],
'error500path' => [
'visible' => (Settings::Get('system.webserver') == 'apache2'),
'label' => lng('extras.errordocument500path'),
'desc' => lng('panel.descriptionerrordocument'),
'type' => 'text',
'value' => $result['error500path']
),
'options_cgi' => array(
],
'options_cgi' => [
'visible' => ($cperlenabled == 1),
'label' => $lng['extras']['execute_perl'],
'label' => lng('extras.execute_perl'),
'type' => 'checkbox',
'value' => '1',
'checked' => $result['options_cgi']
)
)
)
)
)
);
]
]
]
]
]
];

View File

@@ -4,55 +4,67 @@
* This file is part of the Froxlor project.
* 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
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Formfields
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you can also view it online at
* https://files.froxlor.org/misc/COPYING.txt
*
* @copyright the authors
* @author Froxlor team <team@froxlor.org>
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
*/
return array(
'htpasswd_add' => array(
'title' => $lng['extras']['directoryprotection_add'],
use Froxlor\Settings;
use Froxlor\System\Crypt;
return [
'htpasswd_add' => [
'title' => lng('extras.directoryprotection_add'),
'image' => 'fa-solid fa-lock',
'self_overview' => ['section' => 'extras', 'page' => 'htpasswds'],
'sections' => array(
'section_a' => array(
'title' => $lng['extras']['directoryprotection_add'],
'sections' => [
'section_a' => [
'title' => lng('extras.directoryprotection_add'),
'image' => 'icons/htpasswd_add.png',
'fields' => array(
'path' => array(
'label' => $lng['panel']['path'],
'desc' => (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescription'] : null),
'fields' => [
'path' => [
'label' => lng('panel.path'),
'desc' => (Settings::Get('panel.pathedit') != 'Dropdown' ? lng('panel.pathDescription') : null),
'type' => $pathSelect['type'],
'select_var' => $pathSelect['select_var'] ?? '',
'value' => $pathSelect['value'],
'note' => $pathSelect['note'] ?? '',
),
'username' => array(
'label' => $lng['login']['username'],
],
'username' => [
'label' => lng('login.username'),
'type' => 'text'
),
'directory_password' => array(
'label' => $lng['login']['password'],
],
'directory_password' => [
'label' => lng('login.password'),
'type' => 'password',
'autocomplete' => 'off'
),
'directory_password_suggestion' => array(
'label' => $lng['customer']['generated_pwd'],
],
'directory_password_suggestion' => [
'label' => lng('customer.generated_pwd'),
'type' => 'text',
'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''),
'value' => \Froxlor\System\Crypt::generatePassword()
),
'directory_authname' => array(
'label' => $lng['extras']['htpasswdauthname'],
'visible' => (Settings::Get('panel.password_regex') == ''),
'value' => Crypt::generatePassword()
],
'directory_authname' => [
'label' => lng('extras.htpasswdauthname'),
'type' => 'text'
)
)
)
)
)
);
]
]
]
]
]
];

View File

@@ -4,54 +4,66 @@
* This file is part of the Froxlor project.
* 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
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Formfields
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you can also view it online at
* https://files.froxlor.org/misc/COPYING.txt
*
* @copyright the authors
* @author Froxlor team <team@froxlor.org>
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
*/
return array(
'htpasswd_edit' => array(
'title' => $lng['extras']['directoryprotection_edit'],
use Froxlor\Settings;
use Froxlor\System\Crypt;
return [
'htpasswd_edit' => [
'title' => lng('extras.directoryprotection_edit'),
'image' => 'fa-solid fa-lock',
'self_overview' => ['section' => 'extras', 'page' => 'htpasswds'],
'sections' => array(
'section_a' => array(
'title' => $lng['extras']['directoryprotection_edit'],
'sections' => [
'section_a' => [
'title' => lng('extras.directoryprotection_edit'),
'image' => 'icons/htpasswd_edit.png',
'fields' => array(
'path' => array(
'label' => $lng['panel']['path'],
'fields' => [
'path' => [
'label' => lng('panel.path'),
'type' => 'label',
'value' => $result['path']
),
'username' => array(
'label' => $lng['login']['username'],
],
'username' => [
'label' => lng('login.username'),
'type' => 'label',
'value' => $result['username']
),
'directory_password' => array(
'label' => $lng['login']['password'],
],
'directory_password' => [
'label' => lng('login.password'),
'type' => 'password',
'autocomplete' => 'off'
),
'directory_password_suggestion' => array(
'label' => $lng['customer']['generated_pwd'],
],
'directory_password_suggestion' => [
'label' => lng('customer.generated_pwd'),
'type' => 'text',
'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''),
'value' => \Froxlor\System\Crypt::generatePassword()
),
'directory_authname' => array(
'label' => $lng['extras']['htpasswdauthname'],
'visible' => (Settings::Get('panel.password_regex') == ''),
'value' => Crypt::generatePassword()
],
'directory_authname' => [
'label' => lng('extras.htpasswdauthname'),
'type' => 'text',
'value' => $result['authname']
)
)
)
)
)
);
]
]
]
]
]
];

View File

@@ -6,75 +6,79 @@
*
* 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
* COPYING file online at https://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Formfields
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 https://files.froxlor.org/misc/COPYING.txt
* @package Formfields
*/
return array(
'ftp_add' => array(
'title' => $lng['ftp']['account_add'],
use Froxlor\Settings;
use Froxlor\System\Crypt;
return [
'ftp_add' => [
'title' => lng('ftp.account_add'),
'image' => 'icons/user_add.png',
'self_overview' => ['section' => 'ftp', 'page' => 'accounts'],
'sections' => array(
'section_a' => array(
'title' => $lng['ftp']['account_add'],
'sections' => [
'section_a' => [
'title' => lng('ftp.account_add'),
'image' => 'icons/user_add.png',
'fields' => array(
'ftp_username' => array(
'visible' => \Froxlor\Settings::Get('customer.ftpatdomain') == '1',
'label' => $lng['login']['username'],
'fields' => [
'ftp_username' => [
'visible' => Settings::Get('customer.ftpatdomain') == '1',
'label' => lng('login.username'),
'type' => 'text',
'next_to' => (\Froxlor\Settings::Get('customer.ftpatdomain') == '1' && count($domainlist) > 0 ? [
'ftp_domain' => array(
'next_to' => (Settings::Get('customer.ftpatdomain') == '1' && count($domainlist) > 0 ? [
'ftp_domain' => [
'next_to_prefix' => '@',
'label' => $lng['domains']['domainname'],
'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),
],
'path' => [
'label' => lng('panel.path'),
'desc' => (Settings::Get('panel.pathedit') != 'Dropdown' ? lng('panel.pathDescription') : null),
'type' => $pathSelect['type'],
'select_var' => $pathSelect['select_var'] ?? '',
'value' => $pathSelect['value'],
'note' => $pathSelect['note'] ?? '',
),
'ftp_password' => array(
'label' => $lng['login']['password'],
],
'ftp_password' => [
'label' => lng('login.password'),
'type' => 'password',
'autocomplete' => 'off'
),
'ftp_password_suggestion' => array(
'label' => $lng['customer']['generated_pwd'],
],
'ftp_password_suggestion' => [
'label' => lng('customer.generated_pwd'),
'type' => 'text',
'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''),
'value' => \Froxlor\System\Crypt::generatePassword()
),
'sendinfomail' => array(
'label' => $lng['customer']['sendinfomail'],
'visible' => (Settings::Get('panel.password_regex') == ''),
'value' => Crypt::generatePassword()
],
'sendinfomail' => [
'label' => lng('customer.sendinfomail'),
'type' => 'checkbox',
'value' => '1',
'checked' => false
),
'shell' => array(
'visible' => \Froxlor\Settings::Get('system.allow_customer_shell') == '1',
'label' => $lng['panel']['shell'],
],
'shell' => [
'visible' => Settings::Get('system.allow_customer_shell') == '1',
'label' => lng('panel.shell'),
'type' => 'select',
'select_var' => $shells_avail,
'selected' => '/bin/false'
)
)
)
)
)
);
]
]
]
]
]
];

View File

@@ -6,62 +6,66 @@
*
* 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
* COPYING file online at https://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Formfields
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 https://files.froxlor.org/misc/COPYING.txt
* @package Formfields
*/
return array(
'ftp_edit' => array(
'title' => $lng['ftp']['account_edit'],
use Froxlor\Settings;
use Froxlor\System\Crypt;
return [
'ftp_edit' => [
'title' => lng('ftp.account_edit'),
'image' => 'icons/user_edit.png',
'self_overview' => ['section' => 'ftp', 'page' => 'accounts'],
'sections' => array(
'section_a' => array(
'title' => $lng['ftp']['account_edit'],
'sections' => [
'section_a' => [
'title' => lng('ftp.account_edit'),
'image' => 'icons/user_edit.png',
'fields' => array(
'username' => array(
'label' => $lng['login']['username'],
'fields' => [
'username' => [
'label' => lng('login.username'),
'type' => 'label',
'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),
],
'path' => [
'label' => lng('panel.path'),
'desc' => (Settings::Get('panel.pathedit') != 'Dropdown' ? lng('panel.pathDescription') : null),
'type' => $pathSelect['type'],
'select_var' => $pathSelect['select_var'] ?? '',
'value' => $pathSelect['value'],
'note' => $pathSelect['note'] ?? '',
),
'ftp_password' => array(
'label' => $lng['login']['password'],
'desc' => $lng['ftp']['editpassdescription'],
],
'ftp_password' => [
'label' => lng('login.password'),
'desc' => lng('ftp.editpassdescription'),
'type' => 'password',
'autocomplete' => 'off'
),
'ftp_password_suggestion' => array(
'label' => $lng['customer']['generated_pwd'],
],
'ftp_password_suggestion' => [
'label' => lng('customer.generated_pwd'),
'type' => 'text',
'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''),
'value' => \Froxlor\System\Crypt::generatePassword()
),
'shell' => array(
'visible' => \Froxlor\Settings::Get('system.allow_customer_shell') == '1',
'label' => $lng['panel']['shell'],
'visible' => (Settings::Get('panel.password_regex') == ''),
'value' => Crypt::generatePassword()
],
'shell' => [
'visible' => Settings::Get('system.allow_customer_shell') == '1',
'label' => lng('panel.shell'),
'type' => 'select',
'select_var' => $shells_avail,
'selected' => $result['shell'] ?? '/bin/false'
)
)
)
)
)
);
]
]
]
]
]
];

View File

@@ -1,6 +1,7 @@
<?php
use Froxlor\Settings;
use Froxlor\System\Crypt;
/**
* This file is part of the Froxlor project.
@@ -8,57 +9,58 @@ use Froxlor\Settings;
*
* 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
* COPYING file online at https://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Formfields
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 https://files.froxlor.org/misc/COPYING.txt
* @package Formfields
*/
return array(
'mysql_add' => array(
'title' => $lng['mysql']['database_create'],
return [
'mysql_add' => [
'title' => lng('mysql.database_create'),
'image' => 'icons/mysql_add.png',
'self_overview' => ['section' => 'mysql', 'page' => 'mysqls'],
'sections' => array(
'section_a' => array(
'title' => $lng['mysql']['database_create'],
'sections' => [
'section_a' => [
'title' => lng('mysql.database_create'),
'image' => 'icons/mysql_add.png',
'fields' => array(
'custom_suffix' => array(
'fields' => [
'custom_suffix' => [
'visible' => strtoupper(Settings::Get('customer.mysqlprefix')) == 'DBNAME',
'label' => $lng['mysql']['databasename'],
'label' => lng('mysql.databasename'),
'type' => 'text'
),
'description' => array(
'label' => $lng['mysql']['databasedescription'],
],
'description' => [
'label' => lng('mysql.databasedescription'),
'type' => 'text'
),
'mysql_server' => array(
],
'mysql_server' => [
'visible' => count($mysql_servers) > 1,
'label' => $lng['mysql']['mysql_server'],
'label' => lng('mysql.mysql_server'),
'type' => 'select',
'select_var' => $mysql_servers
),
'mysql_password' => array(
'label' => $lng['login']['password'],
],
'mysql_password' => [
'label' => lng('login.password'),
'type' => 'password',
'autocomplete' => 'off'
),
'mysql_password_suggestion' => array(
'label' => $lng['customer']['generated_pwd'],
],
'mysql_password_suggestion' => [
'label' => lng('customer.generated_pwd'),
'type' => 'text',
'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''),
'value' => \Froxlor\System\Crypt::generatePassword()
),
'sendinfomail' => array(
'label' => $lng['customer']['sendinfomail'],
'visible' => (Settings::Get('panel.password_regex') == ''),
'value' => Crypt::generatePassword()
],
'sendinfomail' => [
'label' => lng('customer.sendinfomail'),
'type' => 'checkbox',
'value' => '1',
'checked' => false
)
)
)
)
)
);
]
]
]
]
]
];

View File

@@ -6,52 +6,56 @@
*
* 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
* COPYING file online at https://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Formfields
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 https://files.froxlor.org/misc/COPYING.txt
* @package Formfields
*/
return array(
'mysql_edit' => array(
'title' => $lng['mysql']['database_edit'],
use Froxlor\Settings;
use Froxlor\System\Crypt;
return [
'mysql_edit' => [
'title' => lng('mysql.database_edit'),
'image' => 'icons/mysql_edit.png',
'self_overview' => ['section' => 'mysql', 'page' => 'mysqls'],
'sections' => array(
'section_a' => array(
'title' => $lng['mysql']['database_edit'],
'sections' => [
'section_a' => [
'title' => lng('mysql.database_edit'),
'image' => 'icons/mysql_edit.png',
'fields' => array(
'databasename' => array(
'label' => $lng['mysql']['databasename'],
'fields' => [
'databasename' => [
'label' => lng('mysql.databasename'),
'type' => 'label',
'value' => $result['databasename']
),
'description' => array(
'label' => $lng['mysql']['databasedescription'],
],
'description' => [
'label' => lng('mysql.databasedescription'),
'type' => 'text',
'value' => $result['description']
),
'mysql_server' => array(
],
'mysql_server' => [
'visible' => $count_mysql_servers > 1,
'label' => $lng['mysql']['mysql_server'],
'label' => lng('mysql.mysql_server'),
'type' => 'label',
'value' => $sql_root['caption']
),
'mysql_password' => array(
'label' => $lng['changepassword']['new_password_ifnotempty'],
],
'mysql_password' => [
'label' => lng('changepassword.new_password_ifnotempty'),
'type' => 'password',
'autocomplete' => 'off'
),
'mysql_password_suggestion' => array(
'label' => $lng['customer']['generated_pwd'],
],
'mysql_password_suggestion' => [
'label' => lng('customer.generated_pwd'),
'type' => 'text',
'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''),
'value' => \Froxlor\System\Crypt::generatePassword()
)
)
)
)
)
);
'visible' => (Settings::Get('panel.password_regex') == ''),
'value' => Crypt::generatePassword()
]
]
]
]
]
];