Skip to content
Snippets Groups Projects
Commit 51bdf71e authored by Till Brehm's avatar Till Brehm
Browse files

Merge branch 'fix-quota-messages' into 'stable-3.1'

imported vladki's fix for nightly db quota messages

Import from: https://www.howtoforge.com/community/threads/quota-warnings-notifications.73747/#post-347405
Credits go to vladki!

Just wanted to make this easier for you to import :)
I have not checked or tested this intensely!

fixes ispconfig/ispconfig3#4170

See merge request !436
parents 68476826 a5571501
No related branches found
No related tags found
No related merge requests found
......@@ -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, '.', '').'%'
);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment