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,156 +4,167 @@
* 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(
'ipsandports_add' => array(
'title' => $lng['admin']['ipsandports']['add'],
use Froxlor\Settings;
return [
'ipsandports_add' => [
'title' => lng('admin.ipsandports.add'),
'image' => 'fa-solid fa-plus',
'self_overview' => ['section' => 'ipsandports', 'page' => 'ipsandports'],
'sections' => array(
'section_a' => array(
'title' => $lng['admin']['ipsandports']['ipandport'],
'sections' => [
'section_a' => [
'title' => lng('admin.ipsandports.ipandport'),
'image' => 'icons/ipsports_add.png',
'fields' => array(
'ip' => array(
'label' => $lng['admin']['ipsandports']['ip'],
'fields' => [
'ip' => [
'label' => lng('admin.ipsandports.ip'),
'type' => 'text',
'mandatory' => true
),
'port' => array(
'label' => $lng['admin']['ipsandports']['port'],
],
'port' => [
'label' => lng('admin.ipsandports.port'),
'type' => 'number',
'min' => 1,
'max' => 65535,
'value' => 80,
'mandatory' => true
)
)
),
'section_b' => array(
'title' => $lng['admin']['ipsandports']['webserverdefaultconfig'],
]
]
],
'section_b' => [
'title' => lng('admin.ipsandports.webserverdefaultconfig'),
'image' => 'icons/ipsports_add.png',
'fields' => array(
'listen_statement' => array(
'visible' => ! \Froxlor\Settings::Get('system.webserver') == 'nginx',
'label' => $lng['admin']['ipsandports']['create_listen_statement'],
'fields' => [
'listen_statement' => [
'visible' => !Settings::Get('system.webserver') == 'nginx',
'label' => lng('admin.ipsandports.create_listen_statement'),
'type' => 'checkbox',
'value' => '1',
'checked' => false
),
'namevirtualhost_statement' => array(
'visible' => \Froxlor\Settings::Get('system.webserver') == 'apache2' && (int) \Froxlor\Settings::Get('system.apache24') == 0,
'label' => $lng['admin']['ipsandports']['create_namevirtualhost_statement'],
],
'namevirtualhost_statement' => [
'visible' => Settings::Get('system.webserver') == 'apache2' && (int)Settings::Get('system.apache24') == 0,
'label' => lng('admin.ipsandports.create_namevirtualhost_statement'),
'type' => 'checkbox',
'value' => '1',
'checked' => \Froxlor\Settings::Get('system.webserver') == 'apache2' && (int) \Froxlor\Settings::Get('system.apache24') == 0
),
'vhostcontainer' => array(
'label' => $lng['admin']['ipsandports']['create_vhostcontainer'],
'checked' => Settings::Get('system.webserver') == 'apache2' && (int)Settings::Get('system.apache24') == 0
],
'vhostcontainer' => [
'label' => lng('admin.ipsandports.create_vhostcontainer'),
'type' => 'checkbox',
'value' => '1',
'checked' => true
),
'docroot' => array(
'label' => $lng['admin']['ipsandports']['docroot']['title'],
'desc' => $lng['admin']['ipsandports']['docroot']['description'],
],
'docroot' => [
'label' => lng('admin.ipsandports.docroot.title'),
'desc' => lng('admin.ipsandports.docroot.description'),
'type' => 'text'
),
'specialsettings' => array(
'label' => $lng['admin']['ownvhostsettings'],
'desc' => $lng['serversettings']['default_vhostconf']['description'],
],
'specialsettings' => [
'label' => lng('admin.ownvhostsettings'),
'desc' => lng('serversettings.default_vhostconf.description'),
'type' => 'textarea',
'cols' => 60,
'rows' => 12
),
'vhostcontainer_servername_statement' => array(
'visible' => \Froxlor\Settings::Get('system.webserver') == 'apache2',
'label' => $lng['admin']['ipsandports']['create_vhostcontainer_servername_statement'],
],
'vhostcontainer_servername_statement' => [
'visible' => Settings::Get('system.webserver') == 'apache2',
'label' => lng('admin.ipsandports.create_vhostcontainer_servername_statement'),
'type' => 'checkbox',
'value' => '1',
'checked' => true
)
)
),
'section_c' => array(
'title' => $lng['admin']['ipsandports']['webserverdomainconfig'],
]
]
],
'section_c' => [
'title' => lng('admin.ipsandports.webserverdomainconfig'),
'image' => 'icons/ipsports_add.png',
'fields' => array(
'default_vhostconf_domain' => array(
'label' => $lng['admin']['ipsandports']['default_vhostconf_domain'],
'desc' => $lng['serversettings']['default_vhostconf_domain']['description'],
'fields' => [
'default_vhostconf_domain' => [
'label' => lng('admin.ipsandports.default_vhostconf_domain'),
'desc' => lng('serversettings.default_vhostconf_domain.description'),
'type' => 'textarea',
'cols' => 60,
'rows' => 12
),
'ssl_default_vhostconf_domain' => array(
'visible' => \Froxlor\Settings::Get('system.use_ssl') == 1,
'label' => $lng['admin']['ipsandports']['ssl_default_vhostconf_domain'],
'desc' => $lng['serversettings']['default_vhostconf_domain']['description'],
],
'ssl_default_vhostconf_domain' => [
'visible' => Settings::Get('system.use_ssl') == 1,
'label' => lng('admin.ipsandports.ssl_default_vhostconf_domain'),
'desc' => lng('serversettings.default_vhostconf_domain.description'),
'type' => 'textarea',
'cols' => 60,
'rows' => 12
),
'include_default_vhostconf_domain' => array(
'label' => $lng['admin']['include_ownvhostsettings'],
],
'include_default_vhostconf_domain' => [
'label' => lng('admin.include_ownvhostsettings'),
'type' => 'checkbox',
'value' => '1',
'checked' => false
)
)
),
'section_d' => array(
'title' => $lng['admin']['ipsandports']['webserverssldomainconfig'],
]
]
],
'section_d' => [
'title' => lng('admin.ipsandports.webserverssldomainconfig'),
'image' => 'icons/ipsports_add.png',
'visible' => \Froxlor\Settings::Get('system.use_ssl') == 1,
'fields' => array(
'ssl' => array(
'label' => $lng['admin']['ipsandports']['enable_ssl'],
'visible' => Settings::Get('system.use_ssl') == 1,
'fields' => [
'ssl' => [
'label' => lng('admin.ipsandports.enable_ssl'),
'type' => 'checkbox',
'value' => '1',
'checked' => false
),
'ssl_cert_file' => array(
'label' => $lng['admin']['ipsandports']['ssl_cert_file'],
],
'ssl_cert_file' => [
'label' => lng('admin.ipsandports.ssl_cert_file'),
'type' => 'text'
),
'ssl_key_file' => array(
'label' => $lng['admin']['ipsandports']['ssl_key_file'],
],
'ssl_key_file' => [
'label' => lng('admin.ipsandports.ssl_key_file'),
'type' => 'text'
),
'ssl_ca_file' => array(
'label' => $lng['admin']['ipsandports']['ssl_ca_file'],
],
'ssl_ca_file' => [
'label' => lng('admin.ipsandports.ssl_ca_file'),
'type' => 'text'
),
'ssl_cert_chainfile' => array(
'label' => $lng['admin']['ipsandports']['ssl_cert_chainfile']['title'],
'desc' => $lng['admin']['ipsandports']['ssl_cert_chainfile']['description'],
],
'ssl_cert_chainfile' => [
'label' => lng('admin.ipsandports.ssl_cert_chainfile.title'),
'desc' => lng('admin.ipsandports.ssl_cert_chainfile.description'),
'type' => 'text'
),
'ssl_specialsettings' => array(
'label' => $lng['admin']['ownsslvhostsettings'],
'desc' => $lng['serversettings']['default_vhostconf']['description'],
],
'ssl_specialsettings' => [
'label' => lng('admin.ownsslvhostsettings'),
'desc' => lng('serversettings.default_vhostconf.description'),
'type' => 'textarea',
'cols' => 60,
'rows' => 12
),
'include_specialsettings' => array(
'label' => $lng['admin']['include_ownvhostsettings'],
],
'include_specialsettings' => [
'label' => lng('admin.include_ownvhostsettings'),
'type' => 'checkbox',
'value' => '1',
'checked' => false
)
)
)
)
)
);
]
]
]
]
]
];

View File

@@ -4,166 +4,177 @@
* 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(
'ipsandports_edit' => array(
'title' => $lng['admin']['ipsandports']['edit'],
use Froxlor\Settings;
return [
'ipsandports_edit' => [
'title' => lng('admin.ipsandports.edit'),
'image' => 'fa-solid fa-pen',
'self_overview' => ['section' => 'ipsandports', 'page' => 'ipsandports'],
'sections' => array(
'section_a' => array(
'title' => $lng['admin']['ipsandports']['ipandport'],
'sections' => [
'section_a' => [
'title' => lng('admin.ipsandports.ipandport'),
'image' => 'icons/ipsports_add.png',
'fields' => array(
'ip' => array(
'label' => $lng['admin']['ipsandports']['ip'],
'fields' => [
'ip' => [
'label' => lng('admin.ipsandports.ip'),
'type' => 'text',
'value' => $result['ip'],
'mandatory' => true
),
'port' => array(
'label' => $lng['admin']['ipsandports']['port'],
],
'port' => [
'label' => lng('admin.ipsandports.port'),
'type' => 'number',
'value' => $result['port'],
'min' => 1,
'max' => 65535,
'mandatory' => true
)
)
),
'section_b' => array(
'title' => $lng['admin']['ipsandports']['webserverdefaultconfig'],
]
]
],
'section_b' => [
'title' => lng('admin.ipsandports.webserverdefaultconfig'),
'image' => 'icons/ipsports_edit.png',
'fields' => array(
'listen_statement' => array(
'visible' => ! \Froxlor\Settings::Get('system.webserver') == 'nginx',
'label' => $lng['admin']['ipsandports']['create_listen_statement'],
'fields' => [
'listen_statement' => [
'visible' => !Settings::Get('system.webserver') == 'nginx',
'label' => lng('admin.ipsandports.create_listen_statement'),
'type' => 'checkbox',
'value' => '1',
'checked' => $result['listen_statement']
),
'namevirtualhost_statement' => array(
'visible' => \Froxlor\Settings::Get('system.webserver') == 'apache2' && (int) \Froxlor\Settings::Get('system.apache24') == 0,
'label' => $lng['admin']['ipsandports']['create_namevirtualhost_statement'],
],
'namevirtualhost_statement' => [
'visible' => Settings::Get('system.webserver') == 'apache2' && (int)Settings::Get('system.apache24') == 0,
'label' => lng('admin.ipsandports.create_namevirtualhost_statement'),
'type' => 'checkbox',
'value' => '1',
'checked' => $result['namevirtualhost_statement']
),
'vhostcontainer' => array(
'label' => $lng['admin']['ipsandports']['create_vhostcontainer'],
],
'vhostcontainer' => [
'label' => lng('admin.ipsandports.create_vhostcontainer'),
'type' => 'checkbox',
'value' => '1',
'checked' => $result['vhostcontainer']
),
'docroot' => array(
'label' => $lng['admin']['ipsandports']['docroot']['title'],
'desc' => $lng['admin']['ipsandports']['docroot']['description'],
],
'docroot' => [
'label' => lng('admin.ipsandports.docroot.title'),
'desc' => lng('admin.ipsandports.docroot.description'),
'type' => 'text',
'value' => $result['docroot']
),
'specialsettings' => array(
'label' => $lng['admin']['ownvhostsettings'],
'desc' => $lng['serversettings']['default_vhostconf']['description'],
],
'specialsettings' => [
'label' => lng('admin.ownvhostsettings'),
'desc' => lng('serversettings.default_vhostconf.description'),
'type' => 'textarea',
'cols' => 60,
'rows' => 12,
'value' => $result['specialsettings']
),
'vhostcontainer_servername_statement' => array(
'visible' => \Froxlor\Settings::Get('system.webserver') == 'apache2',
'label' => $lng['admin']['ipsandports']['create_vhostcontainer_servername_statement'],
],
'vhostcontainer_servername_statement' => [
'visible' => Settings::Get('system.webserver') == 'apache2',
'label' => lng('admin.ipsandports.create_vhostcontainer_servername_statement'),
'type' => 'checkbox',
'value' => '1',
'checked' => $result['vhostcontainer_servername_statement']
)
)
),
'section_c' => array(
'title' => $lng['admin']['ipsandports']['webserverdomainconfig'],
]
]
],
'section_c' => [
'title' => lng('admin.ipsandports.webserverdomainconfig'),
'image' => 'icons/ipsports_edit.png',
'fields' => array(
'default_vhostconf_domain' => array(
'label' => $lng['admin']['ipsandports']['default_vhostconf_domain'],
'desc' => $lng['serversettings']['default_vhostconf_domain']['description'],
'fields' => [
'default_vhostconf_domain' => [
'label' => lng('admin.ipsandports.default_vhostconf_domain'),
'desc' => lng('serversettings.default_vhostconf_domain.description'),
'type' => 'textarea',
'cols' => 60,
'rows' => 12,
'value' => $result['default_vhostconf_domain']
),
'ssl_default_vhostconf_domain' => array(
'visible' => \Froxlor\Settings::Get('system.use_ssl') == 1,
'label' => $lng['admin']['ipsandports']['ssl_default_vhostconf_domain'],
'desc' => $lng['serversettings']['default_vhostconf_domain']['description'],
],
'ssl_default_vhostconf_domain' => [
'visible' => Settings::Get('system.use_ssl') == 1,
'label' => lng('admin.ipsandports.ssl_default_vhostconf_domain'),
'desc' => lng('serversettings.default_vhostconf_domain.description'),
'type' => 'textarea',
'cols' => 60,
'rows' => 12,
'value' => $result['ssl_default_vhostconf_domain']
),
'include_default_vhostconf_domain' => array(
'label' => $lng['admin']['include_ownvhostsettings'],
],
'include_default_vhostconf_domain' => [
'label' => lng('admin.include_ownvhostsettings'),
'type' => 'checkbox',
'value' => '1',
'checked' => $result['include_default_vhostconf_domain']
)
)
),
'section_d' => array(
'title' => $lng['admin']['ipsandports']['webserverssldomainconfig'],
]
]
],
'section_d' => [
'title' => lng('admin.ipsandports.webserverssldomainconfig'),
'image' => 'icons/ipsports_edit.png',
'visible' => \Froxlor\Settings::Get('system.use_ssl') == 1,
'fields' => array(
'ssl' => array(
'label' => $lng['admin']['ipsandports']['enable_ssl'],
'visible' => Settings::Get('system.use_ssl') == 1,
'fields' => [
'ssl' => [
'label' => lng('admin.ipsandports.enable_ssl'),
'type' => 'checkbox',
'value' => '1',
'checked' => $result['ssl']
),
'ssl_cert_file' => array(
'label' => $lng['admin']['ipsandports']['ssl_cert_file'],
],
'ssl_cert_file' => [
'label' => lng('admin.ipsandports.ssl_cert_file'),
'type' => 'text',
'value' => $result['ssl_cert_file']
),
'ssl_key_file' => array(
'label' => $lng['admin']['ipsandports']['ssl_key_file'],
],
'ssl_key_file' => [
'label' => lng('admin.ipsandports.ssl_key_file'),
'type' => 'text',
'value' => $result['ssl_key_file']
),
'ssl_ca_file' => array(
'label' => $lng['admin']['ipsandports']['ssl_ca_file'],
],
'ssl_ca_file' => [
'label' => lng('admin.ipsandports.ssl_ca_file'),
'type' => 'text',
'value' => $result['ssl_ca_file']
),
'ssl_cert_chainfile' => array(
'label' => $lng['admin']['ipsandports']['ssl_cert_chainfile']['title'],
'desc' => $lng['admin']['ipsandports']['ssl_cert_chainfile']['description'],
],
'ssl_cert_chainfile' => [
'label' => lng('admin.ipsandports.ssl_cert_chainfile.title'),
'desc' => lng('admin.ipsandports.ssl_cert_chainfile.description'),
'type' => 'text',
'value' => $result['ssl_cert_chainfile']
),
'ssl_specialsettings' => array(
'label' => $lng['admin']['ownsslvhostsettings'],
'desc' => $lng['serversettings']['default_vhostconf']['description'],
],
'ssl_specialsettings' => [
'label' => lng('admin.ownsslvhostsettings'),
'desc' => lng('serversettings.default_vhostconf.description'),
'type' => 'textarea',
'cols' => 60,
'rows' => 12,
'value' => $result['ssl_specialsettings']
),
'include_specialsettings' => array(
'label' => $lng['admin']['include_ownvhostsettings'],
],
'include_specialsettings' => [
'label' => lng('admin.include_ownvhostsettings'),
'type' => 'checkbox',
'value' => '1',
'checked' => $result['include_specialsettings']
)
)
)
)
)
);
]
]
]
]
]
];