refactor global array

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2018-12-21 20:31:17 +01:00
parent 5fa0f4b87e
commit c5a58e3f36
68 changed files with 646 additions and 613 deletions

View File

@@ -40,26 +40,26 @@ return array(
'value' => array(
$result['deactivated']
),
'visible' => ($result['adminid'] == $userinfo['userid'] ? false : true)
'visible' => ($result['adminid'] == \Froxlor\User::getAll()['userid'] ? false : true)
),
'admin_password' => array(
'label' => $lng['login']['password'] . '&nbsp;(' . $lng['panel']['emptyfornochanges'] . ')',
'type' => 'password',
'autocomplete' => 'off',
'visible' => ($result['adminid'] == $userinfo['userid'] ? false : true)
'visible' => ($result['adminid'] == \Froxlor\User::getAll()['userid'] ? false : true)
),
'admin_password_suggestion' => array(
'label' => $lng['customer']['generated_pwd'],
'type' => 'text',
'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''),
'value' => \Froxlor\System\Crypt::generatePassword(),
'visible' => ($result['adminid'] == $userinfo['userid'] ? false : true)
'visible' => ($result['adminid'] == \Froxlor\User::getAll()['userid'] ? false : true)
),
'def_language' => array(
'label' => $lng['login']['language'],
'type' => 'select',
'select_var' => $language_options,
'visible' => ($result['adminid'] == $userinfo['userid'] ? false : true)
'visible' => ($result['adminid'] == \Froxlor\User::getAll()['userid'] ? false : true)
)
)
),
@@ -106,7 +106,7 @@ return array(
'section_c' => array(
'title' => $lng['admin']['servicedata'],
'image' => 'icons/user_add.png',
'visible' => ($result['adminid'] != $userinfo['userid'] ? true : false),
'visible' => ($result['adminid'] != \Froxlor\User::getAll()['userid'] ? true : false),
'fields' => array(
'ipaddress' => array(
'label' => $lng['serversettings']['ipaddress']['title'],

View File

@@ -35,7 +35,7 @@ return array(
'mandatory' => true
),
'adminid' => array(
'visible' => ($userinfo['customers_see_all'] == '1' ? true : false),
'visible' => (\Froxlor\User::getAll()['customers_see_all'] == '1' ? true : false),
'label' => $lng['admin']['admin'],
'type' => 'select',
'select_var' => $admins,
@@ -91,7 +91,7 @@ return array(
'image' => 'icons/domain_add.png',
'fields' => array(
'documentroot' => array(
'visible' => ($userinfo['change_serversettings'] == '1' ? true : false),
'visible' => (\Froxlor\User::getAll()['change_serversettings'] == '1' ? true : false),
'label' => 'DocumentRoot',
'desc' => $lng['panel']['emptyfordefault'],
'type' => 'text'
@@ -124,7 +124,7 @@ return array(
'value' => array()
),
'specialsettings' => array(
'visible' => ($userinfo['change_serversettings'] == '1' ? true : false),
'visible' => (\Froxlor\User::getAll()['change_serversettings'] == '1' ? true : false),
'style' => 'align-top',
'label' => $lng['admin']['ownvhostsettings'],
'desc' => $lng['serversettings']['default_vhostconf']['description'],
@@ -133,7 +133,7 @@ return array(
'rows' => 12
),
'notryfiles' => array(
'visible' => (\Froxlor\Settings::Get('system.webserver') == 'nginx' && $userinfo['change_serversettings'] == '1'),
'visible' => (\Froxlor\Settings::Get('system.webserver') == 'nginx' && \Froxlor\User::getAll()['change_serversettings'] == '1'),
'label' => $lng['admin']['notryfiles']['title'],
'desc' => $lng['admin']['notryfiles']['description'],
'type' => 'checkbox',
@@ -286,7 +286,7 @@ return array(
'section_c' => array(
'title' => $lng['admin']['phpserversettings'],
'image' => 'icons/domain_add.png',
'visible' => (($userinfo['change_serversettings'] == '1' || $userinfo['caneditphpsettings'] == '1') ? true : false),
'visible' => ((\Froxlor\User::getAll()['change_serversettings'] == '1' || \Froxlor\User::getAll()['caneditphpsettings'] == '1') ? true : false),
'fields' => array(
'openbasedir' => array(
'label' => 'OpenBasedir',
@@ -335,7 +335,7 @@ return array(
'section_d' => array(
'title' => $lng['admin']['nameserversettings'],
'image' => 'icons/domain_add.png',
'visible' => (\Froxlor\Settings::Get('system.bind_enable') == '1' && $userinfo['change_serversettings'] == '1' ? true : false),
'visible' => (\Froxlor\Settings::Get('system.bind_enable') == '1' && \Froxlor\User::getAll()['change_serversettings'] == '1' ? true : false),
'fields' => array(
'isbinddomain' => array(
'label' => 'Nameserver',

View File

@@ -37,7 +37,7 @@ return array(
'mandatory' => true
),
'adminid' => array(
'visible' => ($userinfo['customers_see_all'] == '1' ? true : false),
'visible' => (\Froxlor\User::getAll()['customers_see_all'] == '1' ? true : false),
'label' => $lng['admin']['admin'],
'type' => (\Froxlor\Settings::Get('panel.allow_domain_change_admin') == '1' ? 'select' : 'label'),
'select_var' => (isset($admins) ? $admins : null),
@@ -102,7 +102,7 @@ return array(
'image' => 'icons/domain_edit.png',
'fields' => array(
'documentroot' => array(
'visible' => ($userinfo['change_serversettings'] == '1' ? true : false),
'visible' => (\Froxlor\User::getAll()['change_serversettings'] == '1' ? true : false),
'label' => 'DocumentRoot',
'desc' => $lng['panel']['emptyfordefault'],
'type' => 'text',
@@ -138,7 +138,7 @@ return array(
)
),
'specialsettings' => array(
'visible' => ($userinfo['change_serversettings'] == '1' ? true : false),
'visible' => (\Froxlor\User::getAll()['change_serversettings'] == '1' ? true : false),
'style' => 'align-top',
'label' => $lng['admin']['ownvhostsettings'],
'desc' => $lng['serversettings']['default_vhostconf']['description'],
@@ -148,7 +148,7 @@ return array(
'rows' => 12
),
'specialsettingsforsubdomains' => array(
'visible' => ($userinfo['change_serversettings'] == '1' ? true : false),
'visible' => (\Froxlor\User::getAll()['change_serversettings'] == '1' ? true : false),
'label' => $lng['admin']['specialsettingsforsubdomains'],
'desc' => $lng['serversettings']['specialsettingsforsubdomains']['description'],
'type' => 'checkbox',
@@ -163,7 +163,7 @@ return array(
)
),
'notryfiles' => array(
'visible' => (\Froxlor\Settings::Get('system.webserver') == 'nginx' && $userinfo['change_serversettings'] == '1'),
'visible' => (\Froxlor\Settings::Get('system.webserver') == 'nginx' && \Froxlor\User::getAll()['change_serversettings'] == '1'),
'label' => $lng['admin']['notryfiles']['title'],
'desc' => $lng['admin']['notryfiles']['description'],
'type' => 'checkbox',
@@ -330,7 +330,7 @@ return array(
'section_c' => array(
'title' => $lng['admin']['phpserversettings'],
'image' => 'icons/domain_edit.png',
'visible' => (($userinfo['change_serversettings'] == '1' || $userinfo['caneditphpsettings'] == '1') ? true : false),
'visible' => ((\Froxlor\User::getAll()['change_serversettings'] == '1' || \Froxlor\User::getAll()['caneditphpsettings'] == '1') ? true : false),
'fields' => array(
'openbasedir' => array(
'label' => 'OpenBasedir',
@@ -365,7 +365,7 @@ return array(
'select_var' => $phpconfigs
),
'phpsettingsforsubdomains' => array(
'visible' => ($userinfo['change_serversettings'] == '1' ? true : false),
'visible' => (\Froxlor\User::getAll()['change_serversettings'] == '1' ? true : false),
'label' => $lng['admin']['phpsettingsforsubdomains'],
'desc' => $lng['serversettings']['phpsettingsforsubdomains']['description'],
'type' => 'checkbox',
@@ -396,7 +396,7 @@ return array(
'section_d' => array(
'title' => $lng['admin']['nameserversettings'],
'image' => 'icons/domain_edit.png',
'visible' => (\Froxlor\Settings::Get('system.bind_enable') == '1' && $userinfo['change_serversettings'] == '1' ? true : false),
'visible' => (\Froxlor\Settings::Get('system.bind_enable') == '1' && \Froxlor\User::getAll()['change_serversettings'] == '1' ? true : false),
'fields' => array(
'isbinddomain' => array(
'label' => 'Nameserver',