From 9eb7b343b2db5bb757e07c84322b2fe30bea9229 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Wed, 27 Oct 2010 16:22:49 -0400
Subject: [PATCH] Fixed: FS#1365 - hard disk quota in the frontend wrong
---
interface/web/sites/user_quota_stats.php | 26 ++++++++++++++++++++++++--
1 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/interface/web/sites/user_quota_stats.php b/interface/web/sites/user_quota_stats.php
index f3b7f0d..0109dc9 100644
--- a/interface/web/sites/user_quota_stats.php
+++ b/interface/web/sites/user_quota_stats.php
@@ -45,12 +45,34 @@
$rec['soft'] = $monitor_data['user'][$username]['soft'];
$rec['hard'] = $monitor_data['user'][$username]['hard'];
+ if($rec['used'] > 1024) {
+ $rec['used'] = round($rec['used'] / 1024,2).' MB';
+ } else {
+ $rec['used'] .= ' KB';
+ }
+
+ if($rec['soft'] > 1024) {
+ $rec['soft'] = round($rec['soft'] / 1024,2).' MB';
+ } else {
+ $rec['soft'] .= ' KB';
+ }
+
+ if($rec['hard'] > 1024) {
+ $rec['hard'] = round($rec['hard'] / 1024,2).' MB';
+ } else {
+ $rec['hard'] .= ' KB';
+ }
+
+
+
+ /*
if(!strstr($rec['used'],'M') && !strstr($rec['used'],'K')) $rec['used'].= ' B';
if(!strstr($rec['soft'],'M') && !strstr($rec['soft'],'K')) $rec['soft'].= ' B';
if(!strstr($rec['hard'],'M') && !strstr($rec['hard'],'K')) $rec['hard'].= ' B';
+ */
- if($rec['soft'] == '0 B' || $rec['soft'] == '0K' || $rec['soft'] == '0') $rec['soft'] = $app->lng('unlimited');
- if($rec['hard'] == '0 B' || $rec['hard'] == '0K' || $rec['hard'] == '0') $rec['hard'] = $app->lng('unlimited');
+ if($rec['soft'] == '0 B' || $rec['soft'] == '0 KB' || $rec['soft'] == '0') $rec['soft'] = $app->lng('unlimited');
+ if($rec['hard'] == '0 B' || $rec['hard'] == '0 KB' || $rec['hard'] == '0') $rec['hard'] = $app->lng('unlimited');
//* The variable "id" contains always the index variable
$rec['id'] = $rec[$this->idx_key];
--
Gitblit v1.9.1