From 37b29231e47a0c4458dc1c15d98588f16f07e1e2 Mon Sep 17 00:00:00 2001 From: Marius Cramer <m.cramer@pixcept.de> Date: Thu, 06 Aug 2015 03:18:44 -0400 Subject: [PATCH] - don't set password via remoting if field is empty --- interface/web/mail/user_quota_stats.php | 49 +++++++++++++++++++++++++++++++------------------ 1 files changed, 31 insertions(+), 18 deletions(-) diff --git a/interface/web/mail/user_quota_stats.php b/interface/web/mail/user_quota_stats.php index 5766ff7..90a9255 100644 --- a/interface/web/mail/user_quota_stats.php +++ b/interface/web/mail/user_quota_stats.php @@ -1,6 +1,6 @@ <?php -require_once('../../lib/config.inc.php'); -require_once('../../lib/app.inc.php'); +require_once '../../lib/config.inc.php'; +require_once '../../lib/app.inc.php'; /****************************************** * Begin Form configuration @@ -15,10 +15,10 @@ //* Check permissions for module $app->auth->check_module_permissions('mail'); +$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 = 'email_quota' ORDER BY created DESC"); $monitor_data = array(); if(is_array($tmp_rec)) { @@ -35,36 +35,49 @@ class list_action extends listform_actions { - + function prepareDataRow($rec) - { - global $app,$monitor_data; - + { + global $app, $monitor_data; + $rec = $app->listform->decode($rec); //* Alternating datarow colors $this->DataRowColor = ($this->DataRowColor == '#FFFFFF') ? '#EEEEEE' : '#FFFFFF'; $rec['bgcolor'] = $this->DataRowColor; $email = $rec['email']; - + $rec['used'] = isset($monitor_data[$email]['used']) ? $monitor_data[$email]['used'] : array(1 => 0); - + if (!is_numeric($rec['used'])) $rec['used']=$rec['used'][1]; - $rec['quota'] = round($rec['quota'] / 1048576,2).' MB'; - if($rec['quota'] == "0 MB") $rec['quota'] = $app->lng('unlimited'); + if($rec['quota'] == 0){ + $rec['quota'] = $app->lng('unlimited'); + $rec['percentage'] = ''; + $rec['percentage_sort'] = 0; + } else { + $rec['percentage'] = round(100 * $rec['used'] / $rec['quota']) . '%'; + $rec['percentage_sort'] = round(100 * $rec['used'] / $rec['quota']); + $rec['quota'] = round($rec['quota'] / 1048576, 4).' MB'; + } - if($rec['used'] < 1544000) { - $rec['used'] = round($rec['used'] / 1024,2).' KB'; - } else { - $rec['used'] = round($rec['used'] / 1048576,2).' MB'; - } + $rec['used_sort'] = $rec['used']; +/* + if($rec['used'] < 1544000) { + $rec['used'] = round($rec['used'] / 1024, 4).' KB'; + } else { + $rec['used'] = round($rec['used'] / 1048576, 4).' MB'; + } +*/ + $rec['used']=$app->functions->formatBytes($rec['used']); + if ($rec['used'] == 'NAN') $rec['used']='0 KB'; //* The variable "id" contains always the index variable $rec['id'] = $rec[$this->idx_key]; return $rec; } + } $list = new list_action; @@ -73,4 +86,4 @@ $list->onLoad(); -?> \ No newline at end of file +?> -- Gitblit v1.9.1