From a5571501c28127728d6acc1509b51c4f907bbcdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?A=2E=20T=C3=A4ffner?= Date: Wed, 7 Sep 2016 15:41:50 +0200 Subject: [PATCH] imported vladki's fix for nightly db quota messages https://www.howtoforge.com/community/threads/quota-warnings-notifications.73747/#post-347405 --- server/lib/classes/cron.d/300-quota_notify.inc.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/server/lib/classes/cron.d/300-quota_notify.inc.php b/server/lib/classes/cron.d/300-quota_notify.inc.php index 8adf84b8da..5d652d0820 100644 --- a/server/lib/classes/cron.d/300-quota_notify.inc.php +++ b/server/lib/classes/cron.d/300-quota_notify.inc.php @@ -457,7 +457,7 @@ class cronjob_quota_notify extends cronjob { '{database_name}' => $rec['database_name'], '{admin_mail}' => ($global_config['admin_mail'] != ''? $global_config['admin_mail'] : 'root'), '{used}' => $app->functions->formatBytes($monitor['size']), - '{quota}' => $quota.' MB', + '{quota}' => $app->functions->formatBytes($quota), '{ratio}' => number_format($used_ratio * 100, 2, '.', '').'%' ); @@ -479,15 +479,13 @@ class cronjob_quota_notify extends cronjob { //* reset notification date if($rec['last_quota_notification']) $app->dbmaster->datalogUpdate('web_database', array("last_quota_notification" => null), 'database_id', $rec['database_id']); - $app->dbmaster->datalogUpdate('web_database', array("last_quota_notification" => array("SQL" => "CURDATE()")), 'database_id', $rec['database_id']); - // send notification - everything ok again if($rec['last_quota_notification'] && $web_config['overquota_notify_onok'] == 'y' && ($web_config['overquota_db_notify_admin'] == 'y' || $web_config['overquota_db_notify_client'] == 'y')) { $placeholders = array( '{database_name}' => $rec['database_name'], '{admin_mail}' => ($global_config['admin_mail'] != ''? $global_config['admin_mail'] : 'root'), '{used}' => $app->functions->formatBytes($monitor['size']), - '{quota}' => $quota.' MB', + '{quota}' => $app->functions->formatBytes($quota), '{ratio}' => number_format($used_ratio * 100, 2, '.', '').'%' ); -- GitLab