From a25150babf24da69d7b81347c3dc0977da3771d2 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Tue, 18 Dec 2018 15:53:08 +0100 Subject: [PATCH] use correct Settings-class in templates Signed-off-by: Michael Kaufmann --- actions/admin/settings/000.version.php | 72 ----------------- admin_settings.php | 1 - .../settings/function.loadSettings.php | 81 ------------------- .../function.getAvailablePasswordHashes.php | 40 ++++----- lib/functions/system/function.isFreeBSD.php | 33 -------- .../validate/function.setCycleOfCronjob.php | 2 +- .../Sparkle/admin/admins/admins_admin.tpl | 8 +- .../Sparkle/admin/configfiles/wizard.tpl | 2 +- .../admin/customers/customers_customer.tpl | 8 +- .../Sparkle/admin/domains/domains_domain.tpl | 4 +- .../Sparkle/admin/domains/domains_edit.tpl | 2 +- templates/Sparkle/admin/index/index.tpl | 6 +- .../Sparkle/admin/phpconfig/overview.tpl | 2 +- .../admin/phpconfig/overview_overview.tpl | 2 +- templates/Sparkle/admin/settings/testmail.tpl | 4 +- .../settings/updatecounters_row_admin.tpl | 4 +- .../settings/updatecounters_row_customer.tpl | 4 +- .../admin/templates/templates_add_2.tpl | 2 +- .../admin/templates/templates_edit.tpl | 2 +- .../customer/domains/domains_domain.tpl | 2 +- .../Sparkle/customer/domains/domains_edit.tpl | 2 +- templates/Sparkle/customer/email/emails.tpl | 4 +- .../Sparkle/customer/email/emails_email.tpl | 4 +- templates/Sparkle/customer/ftp/accounts.tpl | 2 +- .../Sparkle/customer/ftp/accounts_account.tpl | 2 +- templates/Sparkle/customer/index/index.tpl | 6 +- .../Sparkle/customer/tickets/tickets.tpl | 4 +- .../Sparkle/customer/traffic/traffic.tpl | 6 +- .../customer/traffic/traffic_details.tpl | 6 +- templates/Sparkle/footer.tpl | 2 +- templates/Sparkle/header.tpl | 14 ++-- templates/Sparkle/login/login.tpl | 2 +- 32 files changed, 74 insertions(+), 261 deletions(-) delete mode 100644 actions/admin/settings/000.version.php delete mode 100644 lib/functions/settings/function.loadSettings.php delete mode 100644 lib/functions/system/function.isFreeBSD.php diff --git a/actions/admin/settings/000.version.php b/actions/admin/settings/000.version.php deleted file mode 100644 index 12065743..00000000 --- a/actions/admin/settings/000.version.php +++ /dev/null @@ -1,72 +0,0 @@ - (2003-2009) - * @author Froxlor team (2010-) - * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt - * @package Settings - * - */ - -return array( - 'groups' => array( - 'version' => array( - 'fields' => array( - 'panel_version' => array( - 'settinggroup' => 'panel', - 'varname' => 'version', - 'type' => 'hidden', - 'default' => '', - ), - 'panel_frontend' => array( - 'settinggroup' => 'panel', - 'varname' => 'frontend', - 'type' => 'hidden', - 'default' => '', - ), - 'system_last_tasks_run' => array( - 'settinggroup' => 'system', - 'varname' => 'last_tasks_run', - 'type' => 'hidden', - 'default' => '', - 'save_method' => 'storeSettingField', - ), - 'system_last_traffic_run' => array( - 'settinggroup' => 'system', - 'varname' => 'last_traffic_run', - 'type' => 'hidden', - 'default' => '', - ), - 'system_lastcronrun' => array( - 'settinggroup' => 'system', - 'varname' => 'lastcronrun', - 'type' => 'hidden', - 'default' => '', - ), - 'system_lastguid' => array( - 'settinggroup' => 'system', - 'varname' => 'lastguid', - 'type' => 'hidden', - 'default' => 9999, - ), - 'system_lastaccountnumber' => array( - 'settinggroup' => 'system', - 'varname' => 'lastaccountnumber', - 'type' => 'hidden', - 'default' => 0, - ), - ), - ), - ), - ); - -?> diff --git a/admin_settings.php b/admin_settings.php index 298b8ca6..d6101db8 100644 --- a/admin_settings.php +++ b/admin_settings.php @@ -33,7 +33,6 @@ Database::needRoot(false); if ($page == 'overview' && $userinfo['change_serversettings'] == '1') { $settings_data = loadConfigArrayDir('./actions/admin/settings/'); - $settings = loadSettings($settings_data); if (isset($_POST['send']) && $_POST['send'] == 'send' diff --git a/lib/functions/settings/function.loadSettings.php b/lib/functions/settings/function.loadSettings.php deleted file mode 100644 index 430897db..00000000 --- a/lib/functions/settings/function.loadSettings.php +++ /dev/null @@ -1,81 +0,0 @@ - (2003-2009) - * @author Froxlor team (2010-) - * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt - * @package Functions - * - */ - -/** - * @FIXME remove when fully migrated to new Settings class - * - * @param array $settings_data - * - * @return array - */ -function loadSettings(&$settings_data) { - - $settings = array(); - - if (is_array($settings_data) - && isset($settings_data['groups']) - && is_array($settings_data['groups']) - ) { - - // prepare for use in for-loop - $row_stmt = Database::prepare(" - SELECT `settinggroup`, `varname`, `value` - FROM `" . TABLE_PANEL_SETTINGS . "` - WHERE `settinggroup` = :group AND `varname` = :varname - "); - - foreach ($settings_data['groups'] as $settings_part => $settings_part_details) { - - if (is_array($settings_part_details) - && isset($settings_part_details['fields']) - && is_array($settings_part_details['fields']) - ) { - - foreach ($settings_part_details['fields'] as $field_name => $field_details) { - - if (isset($field_details['settinggroup']) - && isset($field_details['varname']) - && isset($field_details['default']) - ) { - // execute prepared statement - $row = Database::pexecute_first($row_stmt, array( - 'group' => $field_details['settinggroup'], - 'varname' => $field_details['varname'] - )); - - if (!empty($row)) { - $varvalue = $row['value']; - } else { - $varvalue = $field_details['default']; - } - - $settings[$field_details['settinggroup']][$field_details['varname']] = $varvalue; - - } else { - $varvalue = false; - } - - $settings_data['groups'][$settings_part]['fields'][$field_name]['value'] = $varvalue; - } - } - } - } - - return $settings; -} diff --git a/lib/functions/system/function.getAvailablePasswordHashes.php b/lib/functions/system/function.getAvailablePasswordHashes.php index 4975d264..63fc1360 100644 --- a/lib/functions/system/function.getAvailablePasswordHashes.php +++ b/lib/functions/system/function.getAvailablePasswordHashes.php @@ -23,24 +23,24 @@ */ function getAvailablePasswordHashes() { - global $lng; - - // get available pwd-hases - $available_pwdhashes = array( - 0 => $lng['serversettings']['systemdefault'] - ); - if (defined('CRYPT_MD5') && CRYPT_MD5 == 1) { - $available_pwdhashes[1] = 'MD5'; - } - if (defined('CRYPT_BLOWFISH') && CRYPT_BLOWFISH == 1) { - $available_pwdhashes[2] = 'BLOWFISH'; - } - if (defined('CRYPT_SHA256') && CRYPT_SHA256 == 1) { - $available_pwdhashes[3] = 'SHA-256'; - } - if (defined('CRYPT_SHA512') && CRYPT_SHA512 == 1) { - $available_pwdhashes[4] = 'SHA-512'; - } - - return $available_pwdhashes; + global $lng; + + // get available pwd-hases + $available_pwdhashes = array( + 0 => $lng['serversettings']['systemdefault'] + ); + if (defined('CRYPT_MD5') && CRYPT_MD5 == 1) { + $available_pwdhashes[1] = 'MD5'; + } + if (defined('CRYPT_BLOWFISH') && CRYPT_BLOWFISH == 1) { + $available_pwdhashes[2] = 'BLOWFISH'; + } + if (defined('CRYPT_SHA256') && CRYPT_SHA256 == 1) { + $available_pwdhashes[3] = 'SHA-256'; + } + if (defined('CRYPT_SHA512') && CRYPT_SHA512 == 1) { + $available_pwdhashes[4] = 'SHA-512'; + } + + return $available_pwdhashes; } diff --git a/lib/functions/system/function.isFreeBSD.php b/lib/functions/system/function.isFreeBSD.php deleted file mode 100644 index 5f2245fa..00000000 --- a/lib/functions/system/function.isFreeBSD.php +++ /dev/null @@ -1,33 +0,0 @@ - (2014-) - * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt - * @package Functions - * - */ - -/** - * check if the system is FreeBSD (if exact) - * or BSD-based (NetBSD, OpenBSD, etc. if exact = false [default]) - * - * @param boolean $exact whether to check explicitly for FreeBSD or *BSD - * - * @return boolean - */ -function isFreeBSD($exact = false) { - if (($exact && PHP_OS == 'FreeBSD') - || (!$exact && stristr(PHP_OS, 'BSD')) - ) { - return true; - } - return false; -} diff --git a/lib/functions/validate/function.setCycleOfCronjob.php b/lib/functions/validate/function.setCycleOfCronjob.php index dcc935eb..abcdc018 100644 --- a/lib/functions/validate/function.setCycleOfCronjob.php +++ b/lib/functions/validate/function.setCycleOfCronjob.php @@ -36,7 +36,7 @@ function setCycleOfCronjob($fieldname, $fielddata, $newfieldvalue, $allnewfieldv break; } - Database::query("UPDATE `cronjobs_run` SET `interval` = '1 ".$interval."' WHERE `cronfile` = 'cron_used_tickets_reset.php';"); + Database::query("UPDATE `cronjobs_run` SET `interval` = '1 ".$interval."' WHERE `cronfile` = 'used_tickets_reset';"); return array(FORMFIELDS_PLAUSIBILITY_CHECK_OK); } diff --git a/templates/Sparkle/admin/admins/admins_admin.tpl b/templates/Sparkle/admin/admins/admins_admin.tpl index 7e720a30..c009ff30 100644 --- a/templates/Sparkle/admin/admins/admins_admin.tpl +++ b/templates/Sparkle/admin/admins/admins_admin.tpl @@ -18,12 +18,12 @@ Webspace: - +
- +
@@ -42,12 +42,12 @@ Traffic: - +
- +
diff --git a/templates/Sparkle/admin/configfiles/wizard.tpl b/templates/Sparkle/admin/configfiles/wizard.tpl index 326cb69d..a20c129d 100644 --- a/templates/Sparkle/admin/configfiles/wizard.tpl +++ b/templates/Sparkle/admin/configfiles/wizard.tpl @@ -59,7 +59,7 @@ $header - + {$lng['panel']['done_configuring']}:

{$lng['panel']['ihave_configured']}

{$lng['panel']['system_is_configured']} diff --git a/templates/Sparkle/admin/customers/customers_customer.tpl b/templates/Sparkle/admin/customers/customers_customer.tpl index 444b3760..6a939ca3 100644 --- a/templates/Sparkle/admin/customers/customers_customer.tpl +++ b/templates/Sparkle/admin/customers/customers_customer.tpl @@ -25,12 +25,12 @@ Webspace: - +
- +
@@ -49,12 +49,12 @@ Traffic: - +
- +
diff --git a/templates/Sparkle/admin/domains/domains_domain.tpl b/templates/Sparkle/admin/domains/domains_domain.tpl index 62adfef0..527d6746 100644 --- a/templates/Sparkle/admin/domains/domains_domain.tpl +++ b/templates/Sparkle/admin/domains/domains_domain.tpl @@ -26,7 +26,7 @@ {$lng['panel']['viewlogs']} - +   {$lng['dnseditor']['edit']} @@ -34,7 +34,7 @@  {$lng['panel']['letsencrypt']} - +   {$lng['panel']['delete']} diff --git a/templates/Sparkle/admin/domains/domains_edit.tpl b/templates/Sparkle/admin/domains/domains_edit.tpl index 0fb4b1cd..7c8fba08 100644 --- a/templates/Sparkle/admin/domains/domains_edit.tpl +++ b/templates/Sparkle/admin/domains/domains_edit.tpl @@ -4,7 +4,7 @@ $header

{$title}  {$title} - +  ({$lng['dnseditor']['edit']})

diff --git a/templates/Sparkle/admin/index/index.tpl b/templates/Sparkle/admin/index/index.tpl index 02a5b6fe..261a8201 100644 --- a/templates/Sparkle/admin/index/index.tpl +++ b/templates/Sparkle/admin/index/index.tpl @@ -122,7 +122,7 @@ $header - +

@@ -150,7 +150,7 @@ $header
- +

@@ -167,7 +167,7 @@ $header
- + diff --git a/templates/Sparkle/admin/phpconfig/overview.tpl b/templates/Sparkle/admin/phpconfig/overview.tpl index aac895ac..403753b3 100644 --- a/templates/Sparkle/admin/phpconfig/overview.tpl +++ b/templates/Sparkle/admin/phpconfig/overview.tpl @@ -19,7 +19,7 @@ $header - + diff --git a/templates/Sparkle/admin/phpconfig/overview_overview.tpl b/templates/Sparkle/admin/phpconfig/overview_overview.tpl index 2376cb22..18059d57 100644 --- a/templates/Sparkle/admin/phpconfig/overview_overview.tpl +++ b/templates/Sparkle/admin/phpconfig/overview_overview.tpl @@ -1,7 +1,7 @@ - + diff --git a/templates/Sparkle/admin/settings/testmail.tpl b/templates/Sparkle/admin/settings/testmail.tpl index 6b882563..3b2f1243 100644 --- a/templates/Sparkle/admin/settings/testmail.tpl +++ b/templates/Sparkle/admin/settings/testmail.tpl @@ -29,8 +29,8 @@ $header - - + +
{$lng['admin']['phpsettings']['description']} {$lng['admin']['phpsettings']['activedomains']}{$lng['admin']['phpsettings']['fpmdesc']} {$lng['admin']['phpsettings']['binary']}
{$row['description']} {$domains}+ {$subdomains_count} {$lng['customer']['subdomains']}{$row['fpmdesc']} {$row['binary']}{$mail_smtp_user} {$mail_smtp_host} {$mail_smtp_port}

diff --git a/templates/Sparkle/admin/settings/updatecounters_row_admin.tpl b/templates/Sparkle/admin/settings/updatecounters_row_admin.tpl index 88482e85..a944a4b1 100644 --- a/templates/Sparkle/admin/settings/updatecounters_row_admin.tpl +++ b/templates/Sparkle/admin/settings/updatecounters_row_admin.tpl @@ -14,11 +14,11 @@ {$lng['customer']['emails']}: class="green"class="red"
>{$admin['emails_used']} -> {$admin['emails_used_new']}
{$lng['customer']['accounts']}: class="green"class="red"
>{$admin['email_accounts_used']} -> {$admin['email_accounts_used_new']}
{$lng['customer']['forwarders']}: class="green"class="red">{$admin['email_forwarders_used']} -> {$admin['email_forwarders_used_new']}
- + {$lng['customer']['email_quota']}: class="green"class="red">{$admin['email_quota_used']} -> {$admin['email_quota_used_new']}
{$lng['customer']['ftps']}: class="green"class="red">{$admin['ftps_used']} -> {$admin['ftps_used_new']}
- + {$lng['customer']['tickets']}: class="green"class="red">{$admin['tickets_used']} -> {$admin['tickets_used_new']}
diff --git a/templates/Sparkle/admin/settings/updatecounters_row_customer.tpl b/templates/Sparkle/admin/settings/updatecounters_row_customer.tpl index ed076452..a1857a2f 100644 --- a/templates/Sparkle/admin/settings/updatecounters_row_customer.tpl +++ b/templates/Sparkle/admin/settings/updatecounters_row_customer.tpl @@ -10,11 +10,11 @@ {$lng['customer']['forwarders']}: class="green"class="red">{$customer['email_forwarders_used']} -> {$customer['email_forwarders_used_new']}
- + {$lng['customer']['email_quota']}: class="green"class="red">{$customer['email_quota_used']} -> {$customer['email_quota_used_new']}
{$lng['customer']['ftps']}: class="green"class="red">{$customer['ftps_used']} -> {$customer['ftps_used_new']}
- + {$lng['customer']['tickets']}: class="green"class="red">{$customer['tickets_used']} -> {$customer['tickets_used_new']}
diff --git a/templates/Sparkle/admin/templates/templates_add_2.tpl b/templates/Sparkle/admin/templates/templates_add_2.tpl index e00dab52..74f26f2a 100644 --- a/templates/Sparkle/admin/templates/templates_add_2.tpl +++ b/templates/Sparkle/admin/templates/templates_add_2.tpl @@ -71,7 +71,7 @@ $header {EMAIL} {$lng['admin']['templates']['EMAIL']} - + {$lng['admin']['templates']['pop_success_alternative']} diff --git a/templates/Sparkle/admin/templates/templates_edit.tpl b/templates/Sparkle/admin/templates/templates_edit.tpl index 59661d42..d10dca89 100644 --- a/templates/Sparkle/admin/templates/templates_edit.tpl +++ b/templates/Sparkle/admin/templates/templates_edit.tpl @@ -73,7 +73,7 @@ $header {EMAIL} {$lng['admin']['templates']['EMAIL']} - + {$lng['admin']['templates']['pop_success_alternative']} diff --git a/templates/Sparkle/customer/domains/domains_domain.tpl b/templates/Sparkle/customer/domains/domains_domain.tpl index 7f43c220..321b45b9 100644 --- a/templates/Sparkle/customer/domains/domains_domain.tpl +++ b/templates/Sparkle/customer/domains/domains_domain.tpl @@ -33,7 +33,7 @@ {$lng['panel']['delete']}   - + {$lng['dnseditor']['edit']}   diff --git a/templates/Sparkle/customer/domains/domains_edit.tpl b/templates/Sparkle/customer/domains/domains_edit.tpl index 1732d73d..4435ba66 100644 --- a/templates/Sparkle/customer/domains/domains_edit.tpl +++ b/templates/Sparkle/customer/domains/domains_edit.tpl @@ -4,7 +4,7 @@ $header

{$title}  {$title} - +  ({$lng['dnseditor']['edit']})

diff --git a/templates/Sparkle/customer/email/emails.tpl b/templates/Sparkle/customer/email/emails.tpl index c4408788..3ee17e54 100644 --- a/templates/Sparkle/customer/email/emails.tpl +++ b/templates/Sparkle/customer/email/emails.tpl @@ -30,8 +30,8 @@ {$lng['emails']['emailaddress']} {$arrowcode['m.email_full']} {$lng['emails']['forwarders']} {$arrowcode['m.destination']} {$lng['emails']['account']} - {$lng['emails']['catchall']} - + {$lng['emails']['catchall']} + {$lng['emails']['quota']} {$lng['panel']['options']} diff --git a/templates/Sparkle/customer/email/emails_email.tpl b/templates/Sparkle/customer/email/emails_email.tpl index 8e002763..18522ef0 100644 --- a/templates/Sparkle/customer/email/emails_email.tpl +++ b/templates/Sparkle/customer/email/emails_email.tpl @@ -2,8 +2,8 @@ {$row['email_full']}  {$row['destination']} {$lng['panel']['yes']} ({$row['mboxsize']}){$lng['panel']['no']} - {$lng['panel']['yes']}{$lng['panel']['no']} - {$lng['emails']['noquota']}{$row['quota']} MiB + {$lng['panel']['yes']}{$lng['panel']['no']} + {$lng['emails']['noquota']}{$row['quota']} MiB {$lng['panel']['edit']} diff --git a/templates/Sparkle/customer/ftp/accounts.tpl b/templates/Sparkle/customer/ftp/accounts.tpl index 339bfe62..ce431599 100644 --- a/templates/Sparkle/customer/ftp/accounts.tpl +++ b/templates/Sparkle/customer/ftp/accounts.tpl @@ -30,7 +30,7 @@ {$lng['login']['username']} {$arrowcode['username']} {$lng['panel']['ftpdesc']} {$arrowcode['description']} {$lng['panel']['path']} {$arrowcode['homedir']} - + {$lng['panel']['shell']} {$lng['panel']['options']} diff --git a/templates/Sparkle/customer/ftp/accounts_account.tpl b/templates/Sparkle/customer/ftp/accounts_account.tpl index 254894fe..cca5a11c 100644 --- a/templates/Sparkle/customer/ftp/accounts_account.tpl +++ b/templates/Sparkle/customer/ftp/accounts_account.tpl @@ -2,7 +2,7 @@ {$row['username']} {$row['description']} {$row['documentroot']} - + {$row['shell']} diff --git a/templates/Sparkle/customer/index/index.tpl b/templates/Sparkle/customer/index/index.tpl index 1ba1a5cb..c89473f9 100644 --- a/templates/Sparkle/customer/index/index.tpl +++ b/templates/Sparkle/customer/index/index.tpl @@ -92,7 +92,7 @@ $header
- +

@@ -135,7 +135,7 @@ $header
- +

@@ -151,7 +151,7 @@ $header
- + diff --git a/templates/Sparkle/customer/tickets/tickets.tpl b/templates/Sparkle/customer/tickets/tickets.tpl index 0bae4fb9..c2f445d9 100644 --- a/templates/Sparkle/customer/tickets/tickets.tpl +++ b/templates/Sparkle/customer/tickets/tickets.tpl @@ -32,7 +32,7 @@ $header {$searchcode} - +
  {$lng['ticket']['ticket_new']} @@ -66,7 +66,7 @@ $header
- +
  {$lng['ticket']['ticket_new']} diff --git a/templates/Sparkle/customer/traffic/traffic.tpl b/templates/Sparkle/customer/traffic/traffic.tpl index fd4d9ef9..14a2c683 100644 --- a/templates/Sparkle/customer/traffic/traffic.tpl +++ b/templates/Sparkle/customer/traffic/traffic.tpl @@ -37,15 +37,15 @@ $header