From e7bb41002639db224b6302bba9a6795110b1972f Mon Sep 17 00:00:00 2001
From: Florian Schaal <florian@schaal-24.de>
Date: Fri, 27 Dec 2013 14:53:31 -0500
Subject: [PATCH] changed hard-coded conversion to formatBytes for user-quota web-stats

---
 interface/web/sites/user_quota_stats.php |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/interface/web/sites/user_quota_stats.php b/interface/web/sites/user_quota_stats.php
index aed8e22..76dd0df 100644
--- a/interface/web/sites/user_quota_stats.php
+++ b/interface/web/sites/user_quota_stats.php
@@ -15,6 +15,8 @@
 //* Check permissions for module
 $app->auth->check_module_permissions('sites');
 
+$app->uses('functions');
+
 $app->load('listform_actions');
 
 // $tmp_rec = $app->db->queryOneRecord("SELECT data from monitor_data WHERE type = 'harddisk_quota' ORDER BY created DESC");
@@ -57,7 +59,12 @@
 		if (!is_numeric($rec['soft'])) $rec['soft']=$rec['soft'][1];
 		if (!is_numeric($rec['hard'])) $rec['hard']=$rec['hard'][1];
 		if (!is_numeric($rec['files'])) $rec['files']=$rec['files'][1];
-
+		$rec['used']=$app->functions->formatBytes($rec['used']*1024);
+		$rec['soft']=$app->functions->formatBytes($rec['soft']*1024);
+		$rec['hard']=$app->functions->formatBytes($rec['hard']*1024);
+		if($rec['soft'] == "NAN") $rec['soft'] = $app->lng('unlimited');
+		if($rec['hard'] == "NAN") $rec['hard'] = $app->lng('unlimited');
+/*
 		if($rec['used'] > 1024) {
 			$rec['used'] = round($rec['used'] / 1024, 2).' MB';
 		} else {
@@ -78,17 +85,17 @@
 
 		if($rec['soft'] == " KB") $rec['soft'] = $app->lng('unlimited');
 		if($rec['hard'] == " KB") $rec['hard'] = $app->lng('unlimited');
-
+*/
 
 		/*
 		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'] == '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];
 		return $rec;

--
Gitblit v1.9.1