Skip to content

Commit 137ba9a

Browse files
author
thom
committed
Send overtraffic warning only when web is not disabled (#3937)
1 parent b07e429 commit 137ba9a

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
MIME-Version: 1.0
2+
Content-type: text/plain; charset=utf-8
3+
Content-Transfer-Encoding: 8bit
4+
From: {admin_mail}
5+
Reply-To: {admin_mail}
6+
Subject: Website traffic notification
7+
8+
The website {domain} is over traffic.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
MIME-Version: 1.0
2+
Content-type: text/plain; charset=utf-8
3+
Content-Transfer-Encoding: 8bit
4+
From: {admin_mail}
5+
Reply-To: {admin_mail}
6+
Subject: Webverkeerslimiet bereikt
7+
8+
De website {domain} heeft het verkeerslimiet voor deze maand bereikt.

server/lib/classes/cron.d/300-quota_notify.inc.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ public function onRunJob() {
8686
$app->dbmaster->datalogUpdate('web_domain', array("traffic_quota_lock" => 'y', "active" => 'n'), 'domain_id', $rec['domain_id']);
8787
$app->log('Traffic quota for '.$rec['domain'].' exceeded. Disabling website.', LOGLEVEL_DEBUG);
8888
}
89+
else {
90+
$app->log('Traffic quota for '.$rec['domain'].' exceeded.', LOGLEVEL_DEBUG);
91+
}
8992
//* Send traffic notifications
9093
if($rec['traffic_quota_lock'] != 'y' && ($web_config['overtraffic_notify_admin'] == 'y' || $web_config['overtraffic_notify_client'] == 'y')) {
9194

@@ -111,7 +114,12 @@ public function onRunJob() {
111114
}
112115
}
113116

114-
$this->_tools->send_notification_email('web_traffic_notification', $placeholders, $recipients);
117+
if ($web_config['overtraffic_disable_web'] == 'y') {
118+
$this->_tools->send_notification_email('web_traffic_notification', $placeholders, $recipients);
119+
}
120+
else {
121+
$this->_tools->send_notification_email('web_traffic_notification_warn', $placeholders, $recipients);
122+
}
115123
}
116124

117125
} else {

0 commit comments

Comments
 (0)