From 2c893fef25adefa379a5f6ddcb50440c7c2abad6 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Wed, 19 Dec 2018 14:54:46 +0100 Subject: [PATCH] adjustments in settings-arrays Signed-off-by: Michael Kaufmann --- actions/admin/settings/122.froxlorvhost.php | 30 +++++++------- actions/admin/settings/130.webserver.php | 10 ++--- actions/admin/settings/131.ssl.php | 8 ++-- actions/admin/settings/136.phpfpm.php | 4 +- actions/admin/settings/180.dkim.php | 4 +- lib/Froxlor/FroxlorLogger.php | 12 ------ lib/init.php | 45 ++------------------- templates/Sparkle/header.tpl | 12 ------ 8 files changed, 32 insertions(+), 93 deletions(-) diff --git a/actions/admin/settings/122.froxlorvhost.php b/actions/admin/settings/122.froxlorvhost.php index 6175bb73..b8994b82 100644 --- a/actions/admin/settings/122.froxlorvhost.php +++ b/actions/admin/settings/122.froxlorvhost.php @@ -11,7 +11,7 @@ * @copyright (c) the authors * @author Froxlor team (2016-) * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt - * @package Settings + * @package \Froxlor\Settings * */ return array( @@ -40,7 +40,7 @@ return array( 'type' => 'bool', 'default' => false, 'save_method' => 'storeSettingClearCertificates', - 'visible' => Settings::Get('system.leenabled') + 'visible' => \Froxlor\Settings::Get('system.leenabled') ), 'system_le_froxlor_redirect' => array( 'label' => $lng['serversettings']['le_froxlor_redirect'], @@ -49,7 +49,7 @@ return array( 'type' => 'bool', 'default' => false, 'save_method' => 'storeSettingField', - 'visible' => Settings::Get('system.use_ssl') + 'visible' => \Froxlor\Settings::Get('system.use_ssl') ), 'system_hsts_maxage' => array( 'label' => $lng['admin']['domain_hsts_maxage'], @@ -60,7 +60,7 @@ return array( 'int_max' => 94608000, // 3-years 'default' => 0, 'save_method' => 'storeSettingField', - 'visible' => Settings::Get('system.use_ssl') + 'visible' => \Froxlor\Settings::Get('system.use_ssl') ), 'system_hsts_incsub' => array( 'label' => $lng['admin']['domain_hsts_incsub'], @@ -69,7 +69,7 @@ return array( 'type' => 'bool', 'default' => false, 'save_method' => 'storeSettingField', - 'visible' => Settings::Get('system.use_ssl') + 'visible' => \Froxlor\Settings::Get('system.use_ssl') ), 'system_hsts_preload' => array( 'label' => $lng['admin']['domain_hsts_preload'], @@ -78,7 +78,7 @@ return array( 'type' => 'bool', 'default' => false, 'save_method' => 'storeSettingField', - 'visible' => Settings::Get('system.use_ssl') + 'visible' => \Froxlor\Settings::Get('system.use_ssl') ), /** * FCGID @@ -93,7 +93,7 @@ return array( 'websrv_avail' => array( 'apache2' ), - 'visible' => Settings::Get('system.mod_fcgid') + 'visible' => \Froxlor\Settings::Get('system.mod_fcgid') ), 'system_mod_fcgid_httpuser' => array( 'label' => $lng['admin']['mod_fcgid_user'], @@ -105,7 +105,7 @@ return array( 'websrv_avail' => array( 'apache2' ), - 'visible' => Settings::Get('system.mod_fcgid') + 'visible' => \Froxlor\Settings::Get('system.mod_fcgid') ), 'system_mod_fcgid_httpgroup' => array( 'label' => $lng['admin']['mod_fcgid_group'], @@ -117,7 +117,7 @@ return array( 'websrv_avail' => array( 'apache2' ), - 'visible' => Settings::Get('system.mod_fcgid') + 'visible' => \Froxlor\Settings::Get('system.mod_fcgid') ), 'system_mod_fcgid_defaultini_ownvhost' => array( 'label' => $lng['serversettings']['mod_fcgid']['defaultini_ownvhost'], @@ -131,7 +131,7 @@ return array( 'websrv_avail' => array( 'apache2' ), - 'visible' => Settings::Get('system.mod_fcgid') + 'visible' => \Froxlor\Settings::Get('system.mod_fcgid') ), /** * php-fpm @@ -143,7 +143,7 @@ return array( 'type' => 'bool', 'default' => true, 'save_method' => 'storeSettingField', - 'visible' => Settings::Get('phpfpm.enabled') + 'visible' => \Froxlor\Settings::Get('phpfpm.enabled') ), 'system_phpfpm_httpuser' => array( 'label' => $lng['phpfpm']['vhost_httpuser'], @@ -152,7 +152,7 @@ return array( 'type' => 'string', 'default' => 'froxlorlocal', 'save_method' => 'storeSettingWebserverFcgidFpmUser', - 'visible' => Settings::Get('phpfpm.enabled') + 'visible' => \Froxlor\Settings::Get('phpfpm.enabled') ), 'system_phpfpm_httpgroup' => array( 'label' => $lng['phpfpm']['vhost_httpgroup'], @@ -161,7 +161,7 @@ return array( 'type' => 'string', 'default' => 'froxlorlocal', 'save_method' => 'storeSettingField', - 'visible' => Settings::Get('phpfpm.enabled') + 'visible' => \Froxlor\Settings::Get('phpfpm.enabled') ), 'system_phpfpm_defaultini_ownvhost' => array( 'label' => $lng['serversettings']['mod_fcgid']['defaultini_ownvhost'], @@ -172,7 +172,7 @@ return array( 'option_mode' => 'one', 'option_options_method' => 'getPhpConfigs', 'save_method' => 'storeSettingField', - 'visible' => Settings::Get('phpfpm.enabled') + 'visible' => \Froxlor\Settings::Get('phpfpm.enabled') ), /** * DNS @@ -184,7 +184,7 @@ return array( 'type' => 'bool', 'default' => false, 'save_method' => 'storeSettingField', - 'visible' => Settings::Get('system.bind_enable') + 'visible' => \Froxlor\Settings::Get('system.bind_enable') ) ) ) diff --git a/actions/admin/settings/130.webserver.php b/actions/admin/settings/130.webserver.php index bd3f615f..51baba1a 100644 --- a/actions/admin/settings/130.webserver.php +++ b/actions/admin/settings/130.webserver.php @@ -13,7 +13,7 @@ * @author Florian Lippert (2003-2009) * @author Froxlor team (2010-) * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt - * @package Settings + * @package \Froxlor\Settings * */ return array( @@ -55,7 +55,7 @@ return array( 'type' => 'bool', 'default' => false, 'save_method' => 'storeSettingField', - 'visible' => (Settings::Get('system.mod_fcgid') == 0 && Settings::Get('phpfpm.enabled') == 0), + 'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 0 && \Froxlor\Settings::Get('phpfpm.enabled') == 0), 'websrv_avail' => array( 'apache2' ) @@ -71,7 +71,7 @@ return array( 'apache2', 'nginx' ), - 'visible' => Settings::Get('system.use_ssl') + 'visible' => \Froxlor\Settings::Get('system.use_ssl') ), 'system_dhparams_file' => array( 'label' => $lng['serversettings']['dhparams_file'], @@ -82,7 +82,7 @@ return array( 'string_emptyallowed' => true, 'default' => '', 'save_method' => 'storeSettingField', - 'visible' => Settings::Get('system.use_ssl') + 'visible' => \Froxlor\Settings::Get('system.use_ssl') ), 'system_httpuser' => array( 'label' => $lng['admin']['webserver_user'], @@ -231,7 +231,7 @@ return array( 'type' => 'text', 'default' => '', 'save_method' => 'storeSettingField', - 'visible' => (Settings::Get('system.mod_fcgid') == 0 && Settings::Get('phpfpm.enabled') == 0), + 'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 0 && \Froxlor\Settings::Get('phpfpm.enabled') == 0), 'websrv_avail' => array( 'apache2' ) diff --git a/actions/admin/settings/131.ssl.php b/actions/admin/settings/131.ssl.php index 0411f33d..b645b842 100644 --- a/actions/admin/settings/131.ssl.php +++ b/actions/admin/settings/131.ssl.php @@ -13,7 +13,7 @@ * @author Florian Lippert (2003-2009) * @author Froxlor team (2010-) * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt - * @package Settings + * @package \Froxlor\Settings * */ return array( @@ -102,7 +102,7 @@ return array( 'string_type' => 'string', 'string_emptyallowed' => false, 'default' => 'shmcb:/var/run/apache2/ocsp-stapling.cache(131072)', - 'visible' => Settings::Get('system.webserver') == "apache2" && Settings::Get('system.apache24') == 1, + 'visible' => \Froxlor\Settings::Get('system.webserver') == "apache2" && \Froxlor\Settings::Get('system.apache24') == 1, 'save_method' => 'storeSettingField' ), 'system_leenabled' => array( @@ -144,8 +144,8 @@ return array( 'default' => 'testing', 'option_mode' => 'one', 'option_options' => array( - 'testing' => 'https://acme-staging' . (Settings::Get('system.leapiversion') == '2' ? '-v02' : '') . '.api.letsencrypt.org (Test)', - 'production' => 'https://acme-v0' . Settings::Get('system.leapiversion') . '.api.letsencrypt.org (Live)' + 'testing' => 'https://acme-staging' . (\Froxlor\Settings::Get('system.leapiversion') == '2' ? '-v02' : '') . '.api.letsencrypt.org (Test)', + 'production' => 'https://acme-v0' . \Froxlor\Settings::Get('system.leapiversion') . '.api.letsencrypt.org (Live)' ), 'save_method' => 'storeSettingField' ), diff --git a/actions/admin/settings/136.phpfpm.php b/actions/admin/settings/136.phpfpm.php index c8b6e0ea..a19542d7 100644 --- a/actions/admin/settings/136.phpfpm.php +++ b/actions/admin/settings/136.phpfpm.php @@ -11,7 +11,7 @@ * @copyright (c) the authors * @author Froxlor team (2010-) * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt - * @package Settings + * @package \Froxlor\Settings * */ @@ -95,7 +95,7 @@ return array( 'varname' => 'use_mod_proxy', 'type' => 'bool', 'default' => false, - 'visible' => Settings::Get('system.apache24'), + 'visible' => \Froxlor\Settings::Get('system.apache24'), 'save_method' => 'storeSettingField' ), 'system_phpfpm_ini_flags' => array( diff --git a/actions/admin/settings/180.dkim.php b/actions/admin/settings/180.dkim.php index 79b2879e..33135365 100644 --- a/actions/admin/settings/180.dkim.php +++ b/actions/admin/settings/180.dkim.php @@ -13,7 +13,7 @@ * @author Florian Lippert (2003-2009) * @author Froxlor team (2010-) * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt - * @package Settings + * @package \Froxlor\Settings * */ @@ -81,7 +81,7 @@ return array( 'dkim_keylength' => array( 'label' => array( 'title' => $lng['dkim']['dkim_keylength']['title'], - 'description' => sprintf($lng['dkim']['dkim_keylength']['description'], Settings::Get('dkim.dkim_prefix')) + 'description' => sprintf($lng['dkim']['dkim_keylength']['description'], \Froxlor\Settings::Get('dkim.dkim_prefix')) ), 'settinggroup' => 'dkim', 'varname' => 'dkim_keylength', diff --git a/lib/Froxlor/FroxlorLogger.php b/lib/Froxlor/FroxlorLogger.php index c22e33aa..ed94af8b 100644 --- a/lib/Froxlor/FroxlorLogger.php +++ b/lib/Froxlor/FroxlorLogger.php @@ -183,18 +183,6 @@ class FroxlorLogger self::$crondebug_flag = (bool) $_flag; } - /** - * setter for crondebug-flag - * - * @param bool $_flag - * - * @return void - */ - public function setCronDebugFlag($_flag = false) - { - self::$crondebug_flag = (bool) $_flag; - } - private function getLogLevelDesc($type) { switch ($type) { diff --git a/lib/init.php b/lib/init.php index 7c18bae6..64049087 100644 --- a/lib/init.php +++ b/lib/init.php @@ -303,18 +303,18 @@ if (isset($userinfo['language']) && isset($languages[$userinfo['language']])) { // include every english language file we can get foreach ($langs['English'] as $key => $value) { - include_once makeSecurePath($value['file']); + include_once \Froxlor\FileDir::makeSecurePath($value['file']); } // now include the selected language if its not english if ($language != 'English') { foreach ($langs[$language] as $key => $value) { - include_once makeSecurePath($value['file']); + include_once \Froxlor\FileDir::makeSecurePath($value['file']); } } // last but not least include language references file -include_once makeSecurePath('lng/lng_references.php'); +include_once \Froxlor\FileDir::makeSecurePath('lng/lng_references.php'); // Initialize our new link - class $linker = new linker('index.php', $s); @@ -394,7 +394,7 @@ if (isset($userinfo['loginname']) */ $navigation = ""; if (AREA == 'admin' || AREA == 'customer') { - if (hasUpdates($version) || hasDbUpdates($dbversion)) { + if (\Froxlor\Froxlor::hasUpdates() || \Froxlor\Froxlor::hasDbUpdates()) { /* * if froxlor-files have been updated * but not yet configured by the admin @@ -436,43 +436,6 @@ if (AREA == 'admin' || AREA == 'customer') { unset($navigation_data); } -/** - * header information about open tickets (only if used) - */ -$awaitingtickets = 0; -$awaitingtickets_text = ''; -if (Settings::Get('ticket.enabled') == '1') { - - $opentickets = 0; - - if (AREA == 'admin' && isset($userinfo['adminid'])) { - $opentickets_stmt = Database::prepare(" - SELECT COUNT(`id`) as `count` FROM `" . TABLE_PANEL_TICKETS . "` - WHERE `answerto` = '0' AND (`status` = '0' OR `status` = '1') - AND `lastreplier` = '0' AND `adminid` = :adminid - "); - $opentickets = Database::pexecute_first($opentickets_stmt, array('adminid' => $userinfo['adminid'])); - $awaitingtickets = $opentickets['count']; - - if ($opentickets > 0) { - $awaitingtickets_text = strtr($lng['ticket']['awaitingticketreply'], array('%s' => '' . $opentickets['count'] . '')); - } - } - elseif (AREA == 'customer' && isset($userinfo['customerid'])) { - $opentickets_stmt = Database::prepare(" - SELECT COUNT(`id`) as `count` FROM `" . TABLE_PANEL_TICKETS . "` - WHERE `answerto` = '0' AND (`status` = '0' OR `status` = '2') - AND `lastreplier` = '1' AND `customerid` = :customerid - "); - $opentickets = Database::pexecute_first($opentickets_stmt, array('customerid' => $userinfo['customerid'])); - $awaitingtickets = $opentickets['count']; - - if ($opentickets > 0) { - $awaitingtickets_text = strtr($lng['ticket']['awaitingticketreply'], array('%s' => '' . $opentickets['count'] . '')); - } - } -} - $js = ""; if (array_key_exists('js', $_themeoptions['variants'][$themevariant]) && is_array($_themeoptions['variants'][$themevariant]['js'])) { foreach ($_themeoptions['variants'][$themevariant]['js'] as $jsfile) { diff --git a/templates/Sparkle/header.tpl b/templates/Sparkle/header.tpl index dc899984..1b1e9fe8 100644 --- a/templates/Sparkle/header.tpl +++ b/templates/Sparkle/header.tpl @@ -48,18 +48,6 @@ {$lng['panel']['not_configured']} - -
  • - - - {$lng['menue']['ticket']['ticket']} - {$awaitingtickets} - - {$lng['menue']['ticket']['ticket']} - - -
  • -
  • {$userinfo['loginname']}
  • {$lng['panel']['dashboard']}
  • {$lng['panel']['options']} ▾