diff --git a/customer_email.php b/customer_email.php index 2cba4c35..b44b9caf 100644 --- a/customer_email.php +++ b/customer_email.php @@ -56,8 +56,7 @@ if ($page == 'overview') { if (!isset($emails[$row['domain']]) || !is_array($emails[$row['domain']])) { $emails[$row['domain']] = array(); } - - $row['mboxsize'] = size_readable($row['mboxsize']); + $emails[$row['domain']][$row['email_full']] = $row; } @@ -106,6 +105,8 @@ if ($page == 'overview') { if (strlen($row['destination']) > 35) { $row['destination'] = substr($row['destination'], 0, 32) . '... (' . $destinations_count . ')'; } + + $row['mboxsize'] = size_readable($row['mboxsize'], 'GiB', 'bi', '%01.'.(int)$settings['panel']['decimal_places'].'f %s'); $row = htmlentities_array($row); eval("\$accounts.=\"" . getTemplate("email/emails_email") . "\";"); diff --git a/customer_mysql.php b/customer_mysql.php index bfbe905c..eb14cd5a 100644 --- a/customer_mysql.php +++ b/customer_mysql.php @@ -66,13 +66,13 @@ if ($page == 'overview') { while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) { if ($paging->checkDisplay($i)) { $row = htmlentities_array($row); - $mbdata_stmt = Database::prepare("SELECT SUM( data_length + index_length) / 1024 / 1024 'MB' FROM information_schema.TABLES + $mbdata_stmt = Database::prepare("SELECT SUM(data_length + index_length) FROM information_schema.TABLES WHERE table_schema = :table_schema GROUP BY table_schema" ); Database::pexecute($mbdata_stmt, array("table_schema" => $row['databasename'])); $mbdata = $mbdata_stmt->fetch(PDO::FETCH_ASSOC); - $row['size'] = number_format($mbdata['MB'], 3, '.', ''); + $row['size'] = size_readable($mbdata['MB'], 'GiB', 'bi', '%01.'.(int)$settings['panel']['decimal_places'].'f %s'); eval("\$mysqls.=\"" . getTemplate('mysql/mysqls_database') . "\";"); $count++; } diff --git a/customer_traffic.php b/customer_traffic.php index 3bb3e853..083e6abe 100644 --- a/customer_traffic.php +++ b/customer_traffic.php @@ -79,17 +79,17 @@ if (!is_null($month) && !is_null($year)) { $traf['day'] = $row['day'] . '.'; if (extension_loaded('bcmath')) { - $traf['ftptext'] = bcdiv($row['ftp_up'], 1024, $settings['panel']['decimal_places']) . " MB up/ " . bcdiv($row['ftp_down'], 1024, $settings['panel']['decimal_places']) . " MB down (FTP)"; - $traf['httptext'] = bcdiv($http, 1024, $settings['panel']['decimal_places']) . " MB (HTTP)"; - $traf['mailtext'] = bcdiv($mail, 1024, $settings['panel']['decimal_places']) . " MB (Mail)"; + $traf['ftptext'] = bcdiv($row['ftp_up'], 1024, $settings['panel']['decimal_places']) . " MiB up/ " . bcdiv($row['ftp_down'], 1024, $settings['panel']['decimal_places']) . " MiB down (FTP)"; + $traf['httptext'] = bcdiv($http, 1024, $settings['panel']['decimal_places']) . " MiB (HTTP)"; + $traf['mailtext'] = bcdiv($mail, 1024, $settings['panel']['decimal_places']) . " MiB (Mail)"; $traf['ftp'] = bcdiv($ftp, 1024, $settings['panel']['decimal_places']); $traf['http'] = bcdiv($http, 1024, $settings['panel']['decimal_places']); $traf['mail'] = bcdiv($mail, 1024, $settings['panel']['decimal_places']); $traf['byte'] = bcdiv($traf['byte'], 1024, $settings['panel']['decimal_places']); } else { - $traf['ftptext'] = round($row['ftp_up'] / 1024, $settings['panel']['decimal_places']) . " MB up/ " . round($row['ftp_down'] / 1024, $settings['panel']['decimal_places']) . " MB down (FTP)"; - $traf['httptext'] = round($http / 1024, $settings['panel']['decimal_places']) . " MB (HTTP)"; - $traf['mailtext'] = round($mail / 1024, $settings['panel']['decimal_places']) . " MB (Mail)"; + $traf['ftptext'] = round($row['ftp_up'] / 1024, $settings['panel']['decimal_places']) . " MiB up/ " . round($row['ftp_down'] / 1024, $settings['panel']['decimal_places']) . " MiB down (FTP)"; + $traf['httptext'] = round($http / 1024, $settings['panel']['decimal_places']) . " MiB (HTTP)"; + $traf['mailtext'] = round($mail / 1024, $settings['panel']['decimal_places']) . " MiB (Mail)"; $traf['http'] = round($http, $settings['panel']['decimal_places']); $traf['ftp'] = round($ftp, $settings['panel']['decimal_places']); $traf['mail'] = round($mail, $settings['panel']['decimal_places']); @@ -99,16 +99,10 @@ if (!is_null($month) && !is_null($year)) { eval("\$traffic.=\"" . getTemplate('traffic/traffic_month') . "\";"); $show = $lng['traffic']['months'][intval($row['month'])] . ' ' . $row['year']; } - - if (extension_loaded('bcmath')) { - $traffic_complete['http'] = bcdiv($traffic_complete['http'], 1024, $settings['panel']['decimal_places']); - $traffic_complete['ftp'] = bcdiv($traffic_complete['ftp'], 1024, $settings['panel']['decimal_places']); - $traffic_complete['mail'] = bcdiv($traffic_complete['mail'], 1024, $settings['panel']['decimal_places']); - } else { - $traffic_complete['http'] = round($traffic_complete['http'] / 1024, $settings['panel']['decimal_places']); - $traffic_complete['ftp'] = round($traffic_complete['ftp'] / 1024, $settings['panel']['decimal_places']); - $traffic_complete['mail'] = round($traffic_complete['mail'] / 1024, $settings['panel']['decimal_places']); - } + + $traffic_complete['http'] = size_readable($traffic_complete['http'] * 1024, 'GiB', 'bi', '%01.'.(int)$settings['panel']['decimal_places'].'f %s'); + $traffic_complete['ftp'] = size_readable($traffic_complete['ftp'] * 1024, 'GiB', 'bi', '%01.'.(int)$settings['panel']['decimal_places'].'f %s'); + $traffic_complete['mail'] = size_readable($traffic_complete['mail'] * 1024, 'GiB', 'bi', '%01.'.(int)$settings['panel']['decimal_places'].'f %s'); eval("echo \"" . getTemplate('traffic/traffic_details') . "\";"); } else { @@ -138,17 +132,17 @@ if (!is_null($month) && !is_null($year)) { $traf['byte'] = $http + $ftp_up + $ftp_down + $mail; if (extension_loaded('bcmath')) { - $traf['ftptext'] = bcdiv($ftp_up, 1024, $settings['panel']['decimal_places']) . " MB up/ " . bcdiv($ftp_down, 1024, $settings['panel']['decimal_places']) . " MB down (FTP)"; - $traf['httptext'] = bcdiv($http, 1024, $settings['panel']['decimal_places']) . " MB (HTTP)"; - $traf['mailtext'] = bcdiv($mail, 1024, $settings['panel']['decimal_places']) . " MB (Mail)"; + $traf['ftptext'] = bcdiv($ftp_up, 1024, $settings['panel']['decimal_places']) . " MiB up/ " . bcdiv($ftp_down, 1024, $settings['panel']['decimal_places']) . " MiB down (FTP)"; + $traf['httptext'] = bcdiv($http, 1024, $settings['panel']['decimal_places']) . " MiB (HTTP)"; + $traf['mailtext'] = bcdiv($mail, 1024, $settings['panel']['decimal_places']) . " MiB (Mail)"; $traf['ftp'] = bcdiv(($ftp_up + $ftp_down), 1024, $settings['panel']['decimal_places']); $traf['http'] = bcdiv($http, 1024, $settings['panel']['decimal_places']); $traf['mail'] = bcdiv($mail, 1024, $settings['panel']['decimal_places']); $traf['byte'] = bcdiv($traf['byte'], 1024 * 1024, $settings['panel']['decimal_places']); } else { - $traf['ftptext'] = round($ftp_up / 1024, $settings['panel']['decimal_places']) . " MB up/ " . round($ftp_down / 1024, $settings['panel']['decimal_places']) . " MB down (FTP)"; - $traf['httptext'] = round($http / 1024, $settings['panel']['decimal_places']) . " MB (HTTP)"; - $traf['mailtext'] = round($mail / 1024, $settings['panel']['decimal_places']) . " MB (Mail)"; + $traf['ftptext'] = round($ftp_up / 1024, $settings['panel']['decimal_places']) . " MiB up/ " . round($ftp_down / 1024, $settings['panel']['decimal_places']) . " MiB down (FTP)"; + $traf['httptext'] = round($http / 1024, $settings['panel']['decimal_places']) . " MiB (HTTP)"; + $traf['mailtext'] = round($mail / 1024, $settings['panel']['decimal_places']) . " MiB (Mail)"; $traf['ftp'] = round(($ftp_up + $ftp_down) / 1024, $settings['panel']['decimal_places']); $traf['http'] = round($http / 1024, $settings['panel']['decimal_places']); $traf['mail'] = round($mail / 1024, $settings['panel']['decimal_places']); @@ -158,15 +152,9 @@ if (!is_null($month) && !is_null($year)) { eval("\$traffic.=\"" . getTemplate('traffic/traffic_traffic') . "\";"); } - if (extension_loaded('bcmath')) { - $traffic_complete['http'] = bcdiv($traffic_complete['http'], 1024 * 1024, $settings['panel']['decimal_places']); - $traffic_complete['ftp'] = bcdiv($traffic_complete['ftp'], 1024 * 1024, $settings['panel']['decimal_places']); - $traffic_complete['mail'] = bcdiv($traffic_complete['mail'], 1024 * 1024, $settings['panel']['decimal_places']); - } else { - $traffic_complete['http'] = round($traffic_complete['http'] / (1024 * 1024), $settings['panel']['decimal_places']); - $traffic_complete['ftp'] = round($traffic_complete['ftp'] / (1024 * 1024), $settings['panel']['decimal_places']); - $traffic_complete['mail'] = round($traffic_complete['mail'] / (1024 * 1024), $settings['panel']['decimal_places']); - } + $traffic_complete['http'] = size_readable($traffic_complete['http'] * 1024, 'GiB', 'bi', '%01.'.(int)$settings['panel']['decimal_places'].'f %s'); + $traffic_complete['ftp'] = size_readable($traffic_complete['ftp'] * 1024, 'GiB', 'bi', '%01.'.(int)$settings['panel']['decimal_places'].'f %s'); + $traffic_complete['mail'] = size_readable($traffic_complete['mail'] * 1024, 'GiB', 'bi', '%01.'.(int)$settings['panel']['decimal_places'].'f %s'); eval("echo \"" . getTemplate('traffic/traffic') . "\";"); } diff --git a/lng/english.lng.php b/lng/english.lng.php index 9122d13e..8bd8503f 100644 --- a/lng/english.lng.php +++ b/lng/english.lng.php @@ -61,8 +61,8 @@ $lng['customer']['phone'] = 'Phone'; $lng['customer']['fax'] = 'Fax'; $lng['customer']['email'] = 'Email'; $lng['customer']['customernumber'] = 'Customer ID'; -$lng['customer']['diskspace'] = 'Webspace (MB)'; -$lng['customer']['traffic'] = 'Traffic (GB)'; +$lng['customer']['diskspace'] = 'Webspace (MiB)'; +$lng['customer']['traffic'] = 'Traffic (GiB)'; $lng['customer']['mysqls'] = 'MySQL-databases'; $lng['customer']['emails'] = 'Email-addresses'; $lng['customer']['accounts'] = 'Email-accounts'; @@ -720,11 +720,11 @@ $lng['traffic']['months'][9] = "September"; $lng['traffic']['months'][10] = "October"; $lng['traffic']['months'][11] = "November"; $lng['traffic']['months'][12] = "December"; -$lng['traffic']['mb'] = "Traffic (MB)"; +$lng['traffic']['mb'] = "Traffic (MiB)"; $lng['traffic']['distribution'] = 'FTP | HTTP | Mail'; -$lng['traffic']['sumhttp'] = 'Summation HTTP-Traffic in'; -$lng['traffic']['sumftp'] = 'Summation FTP-Traffic in'; -$lng['traffic']['summail'] = 'Summation Mail-Traffic in'; +$lng['traffic']['sumhttp'] = 'Total HTTP-Traffic'; +$lng['traffic']['sumftp'] = 'Total FTP-Traffic'; +$lng['traffic']['summail'] = 'Total Mail-Traffic'; // ADDED IN 1.2.19-svn4.5 @@ -1870,13 +1870,13 @@ $lng['error']['session_timeout_desc'] = 'You should not set the session timeout $lng['admin']['assignedmax'] = 'Assigned / Max'; $lng['admin']['usedmax'] = 'Used / Max'; $lng['admin']['used'] = 'Used'; -$lng['mysql']['size'] = 'Database size (MB)'; +$lng['mysql']['size'] = 'Size'; $lng['error']['invalidhostname'] = 'Hostname can\'t be empty nor can it consist only of whitespaces'; -$lng['traffic']['http'] = 'HTTP (MB)'; -$lng['traffic']['ftp'] = 'FTP (MB)'; -$lng['traffic']['mail'] = 'Mail (MB)'; +$lng['traffic']['http'] = 'HTTP (MiB)'; +$lng['traffic']['ftp'] = 'FTP (MiB)'; +$lng['traffic']['mail'] = 'Mail (MiB)'; // ADDED IN 0.9.27-svn1 $lng['serversettings']['mod_fcgid']['idle_timeout']['title'] = 'Idle Timeout'; diff --git a/lng/german.lng.php b/lng/german.lng.php index 81577091..1639b666 100644 --- a/lng/german.lng.php +++ b/lng/german.lng.php @@ -61,8 +61,8 @@ $lng['customer']['phone'] = 'Telefon'; $lng['customer']['fax'] = 'Fax'; $lng['customer']['email'] = 'E-Mail'; $lng['customer']['customernumber'] = 'Kundennummer'; -$lng['customer']['diskspace'] = 'Webspace (MB)'; -$lng['customer']['traffic'] = 'Traffic (GB)'; +$lng['customer']['diskspace'] = 'Webspace (MiB)'; +$lng['customer']['traffic'] = 'Traffic (GiB)'; $lng['customer']['mysqls'] = 'MySQL-Datenbanken'; $lng['customer']['emails'] = 'E-Mail-Adressen'; $lng['customer']['accounts'] = 'E-Mail-Konten'; @@ -718,12 +718,12 @@ $lng['traffic']['months'][9] = "September"; $lng['traffic']['months'][10] = "Oktober"; $lng['traffic']['months'][11] = "November"; $lng['traffic']['months'][12] = "Dezember"; -$lng['traffic']['mb'] = "Traffic (MB)"; +$lng['traffic']['mb'] = "Traffic (MiB)"; $lng['traffic']['day'] = "Tag"; $lng['traffic']['distribution'] = 'FTP | HTTP | Mail'; -$lng['traffic']['sumhttp'] = 'Summe HTTP-Traffic in'; -$lng['traffic']['sumftp'] = 'Summe FTP-Traffic in'; -$lng['traffic']['summail'] = 'Summe Mail-Traffic in'; +$lng['traffic']['sumhttp'] = 'Gesamt HTTP-Traffic'; +$lng['traffic']['sumftp'] = 'Gesamt FTP-Traffic'; +$lng['traffic']['summail'] = 'Gesamt Mail-Traffic'; // ADDED IN 1.2.19-svn4.5 @@ -1597,13 +1597,13 @@ $lng['error']['session_timeout_desc'] = 'Der Wert der Session-Timeout sollte nic $lng['admin']['assignedmax'] = 'Zugewiesen / Max.'; $lng['admin']['usedmax'] = 'Benutzt / Max.'; $lng['admin']['used'] = 'Benutzt'; -$lng['mysql']['size'] = 'Datenbankgröße (MB)'; +$lng['mysql']['size'] = 'Datenbankgröße'; $lng['error']['invalidhostname'] = 'Hostname darf nicht leer sein oder nur aus Leerzeichen bestehen'; -$lng['traffic']['http'] = 'HTTP (MB)'; -$lng['traffic']['ftp'] = 'FTP (MB)'; -$lng['traffic']['mail'] = 'Mail (MB)'; +$lng['traffic']['http'] = 'HTTP (MiB)'; +$lng['traffic']['ftp'] = 'FTP (MiB)'; +$lng['traffic']['mail'] = 'Mail (MiB)'; // ADDED IN 0.9.27-svn1 $lng['serversettings']['mod_fcgid']['idle_timeout']['title'] = 'Idle-Timeout'; diff --git a/templates/Froxlor/customer/email/emails_email.tpl b/templates/Froxlor/customer/email/emails_email.tpl index 6fccd44f..7ea2a423 100644 --- a/templates/Froxlor/customer/email/emails_email.tpl +++ b/templates/Froxlor/customer/email/emails_email.tpl @@ -3,7 +3,7 @@
| {$lng['traffic']['sumftp']} GB | -{$lng['traffic']['sumhttp']} GB | -{$lng['traffic']['summail']} GB | +{$lng['traffic']['sumftp']} | +{$lng['traffic']['sumhttp']} | +{$lng['traffic']['summail']} | ||||||||
{$traffic_complete['ftp']} |
diff --git a/templates/Froxlor/customer/traffic/traffic_details.tpl b/templates/Froxlor/customer/traffic/traffic_details.tpl
index 5546abe0..5d21564a 100644
--- a/templates/Froxlor/customer/traffic/traffic_details.tpl
+++ b/templates/Froxlor/customer/traffic/traffic_details.tpl
@@ -15,9 +15,9 @@ $header
| {$lng['traffic']['sumftp']} MB | -{$lng['traffic']['sumhttp']} MB | -{$lng['traffic']['summail']} MB | +{$lng['traffic']['sumftp']} | +{$lng['traffic']['sumhttp']} | +{$lng['traffic']['summail']} | |
{$traffic_complete['ftp']} |
diff --git a/templates/Sparkle/customer/email/emails_email.tpl b/templates/Sparkle/customer/email/emails_email.tpl
index 6fccd44f..7ea2a423 100644
--- a/templates/Sparkle/customer/email/emails_email.tpl
+++ b/templates/Sparkle/customer/email/emails_email.tpl
@@ -3,7 +3,7 @@
|