From 79056f20ee9024f9a000cfd81b28a572976ed00c Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Wed, 16 Oct 2019 12:44:23 +0200 Subject: [PATCH] display API in the list of features the customer is allowed to use; display total diskspace used by customer (web, mail and mysql) on customers dashboard, fixes #733 Signed-off-by: Michael Kaufmann --- customer_index.php | 4 ++++ lng/english.lng.php | 1 + lng/german.lng.php | 1 + templates/Sparkle/customer/index/index.tpl | 14 ++++++++++++++ 4 files changed, 20 insertions(+) diff --git a/customer_index.php b/customer_index.php index 784a3fc3..a164a16e 100644 --- a/customer_index.php +++ b/customer_index.php @@ -98,10 +98,12 @@ if ($page == 'overview') { $userinfo['diskspace_used'] = round($usages['webspace'] / 1024, Settings::Get('panel.decimal_places')); $userinfo['mailspace_used'] = round($usages['mail'] / 1024, Settings::Get('panel.decimal_places')); $userinfo['dbspace_used'] = round($usages['mysql'] / 1024, Settings::Get('panel.decimal_places')); + $userinfo['total_used'] = round(($usages['webspace'] + $usages['mail'] + $usages['mysql']) / 1024, Settings::Get('panel.decimal_places')); } else { $userinfo['diskspace_used'] = 0; $userinfo['mailspace_used'] = 0; $userinfo['dbspace_used'] = 0; + $userinfo['total_used'] = 0; } $userinfo['diskspace'] = round($userinfo['diskspace'] / 1024, Settings::Get('panel.decimal_places')); $userinfo['traffic'] = round($userinfo['traffic'] / (1024 * 1024), Settings::Get('panel.decimal_places')); @@ -120,6 +122,8 @@ if ($page == 'overview') { $se[] = "PHP"; if ($userinfo['perlenabled'] == '1') $se[] = "Perl/CGI"; + if ($userinfo['api_allowed'] == '1') + $se[] = 'API'; $services_enabled = implode(", ", $se); eval("echo \"" . \Froxlor\UI\Template::getTemplate('index/index') . "\";"); diff --git a/lng/english.lng.php b/lng/english.lng.php index c07b2493..223064f3 100644 --- a/lng/english.lng.php +++ b/lng/english.lng.php @@ -2076,3 +2076,4 @@ $lng['serversettings']['default_sslvhostconf']['title'] = 'Default SSL vHost-set $lng['serversettings']['includedefault_sslvhostconf'] = 'Include non-SSL vHost-settings in SSL-vHost'; $lng['admin']['ownsslvhostsettings'] = 'Own SSL vHost-settings'; $lng['admin']['ipsandports']['ssl_default_vhostconf_domain'] = 'Default SSL vHost-settings for every domain container'; +$lng['customer']['total_diskspace'] = 'Total diskspace (MiB)'; diff --git a/lng/german.lng.php b/lng/german.lng.php index 112ae9a0..9587d6e2 100644 --- a/lng/german.lng.php +++ b/lng/german.lng.php @@ -1723,3 +1723,4 @@ $lng['serversettings']['default_sslvhostconf']['title'] = 'Standard SSL vHost-Ei $lng['serversettings']['includedefault_sslvhostconf'] = 'Nicht-SSL vHost-Einstellungen in SSL-vHost inkludieren'; $lng['admin']['ownsslvhostsettings'] = 'Eigene SSL vHost-Einstellungen'; $lng['admin']['ipsandports']['ssl_default_vhostconf_domain'] = 'Standard SSL vHost-Einstellungen für jeden Domain-Container'; +$lng['customer']['total_diskspace'] = 'Gesamtspeicherplatz (MiB)'; diff --git a/templates/Sparkle/customer/index/index.tpl b/templates/Sparkle/customer/index/index.tpl index f350fa4d..0f128703 100644 --- a/templates/Sparkle/customer/index/index.tpl +++ b/templates/Sparkle/customer/index/index.tpl @@ -7,6 +7,20 @@ $header
+ +
+ +
+ {$lng['customer']['total_diskspace']}
+ + {$userinfo['total_used']} {$lng['panel']['used']}
+ + {$userinfo['diskspace']} {$lng['panel']['available']} + +
+
+
+