From e1ceb050e19c7574bca146a8da7047ee4ff456b5 Mon Sep 17 00:00:00 2001
From: Marius Burkard <m.burkard@pixcept.de>
Date: Sun, 10 Jul 2016 05:02:35 -0400
Subject: [PATCH] Merge branch 'stable-3.1'
---
interface/web/sites/user_quota_stats.php | 22 +++++++++++++++-------
1 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/interface/web/sites/user_quota_stats.php b/interface/web/sites/user_quota_stats.php
index aed8e22..9c93008 100644
--- a/interface/web/sites/user_quota_stats.php
+++ b/interface/web/sites/user_quota_stats.php
@@ -15,10 +15,10 @@
//* 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");
-// $monitor_data = unserialize($app->db->unquote($tmp_rec['data']));
$tmp_rec = $app->db->queryAllRecords("SELECT data from monitor_data WHERE type = 'harddisk_quota' ORDER BY created DESC");
$monitor_data = array();
if(is_array($tmp_rec)) {
@@ -41,8 +41,10 @@
$rec['bgcolor'] = $this->DataRowColor;
$username = $rec['system_user'];
+ $server = $app->db->queryOneRecord("SELECT server_name FROM server WHERE server_id = ?", $rec['server_id']);
+ $rec['domain'] = $rec['domain'].($server['server_name'] != '' ? ' ('.$server['server_name'].')' : '');
+
$rec['used'] = $monitor_data['user'][$username]['used'];
- $rec['used_sort'] = $rec['used'];
$rec['soft'] = $monitor_data['user'][$username]['soft'];
$rec['hard'] = $monitor_data['user'][$username]['hard'];
$rec['files'] = $monitor_data['user'][$username]['files'];
@@ -54,10 +56,16 @@
$rec['used'] = $rec['used'][1];
}
}
+ $rec['used_sort'] = $rec['used'];
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 +86,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