Commit 073df620 authored by Thom's avatar Thom 🛠
Browse files

Fix reseller notifications (#6347)

parent 5bbec2b9
......@@ -108,7 +108,7 @@ class cronjob_quota_notify extends cronjob {
//* Send email to reseller
if($web_config['overtraffic_notify_reseller'] == 'y') {
$client_group_id = $rec["sys_groupid"];
$app->db->queryOneRecord("SELECT parent_client_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id);
$client = $app->db->queryOneRecord("SELECT parent_client_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id);
if($client['parent_client_id'] > 0) {
$reseller = $app->db->queryOneRecord("SELECT email FROM client WHERE client_id = ?", $client['parent_client_id']);
}
......@@ -246,7 +246,7 @@ class cronjob_quota_notify extends cronjob {
//* Send email to reseller
if($web_config['overquota_notify_reseller'] == 'y') {
$client_group_id = $rec["sys_groupid"];
$app->db->queryOneRecord("SELECT parent_client_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id);
$client = $app->db->queryOneRecord("SELECT parent_client_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id);
if($client['parent_client_id'] > 0) {
$reseller = $app->db->queryOneRecord("SELECT email FROM client WHERE client_id = ?", $client['parent_client_id']);
}
......@@ -293,7 +293,7 @@ class cronjob_quota_notify extends cronjob {
//* Send email to reseller
if($web_config['overquota_notify_reseller'] == 'y') {
$client_group_id = $rec["sys_groupid"];
$app->db->queryOneRecord("SELECT parent_client_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id);
$client = $app->db->queryOneRecord("SELECT parent_client_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id);
if($client['parent_client_id'] > 0) {
$reseller = $app->db->queryOneRecord("SELECT email FROM client WHERE client_id = ?", $client['parent_client_id']);
}
......@@ -398,7 +398,7 @@ class cronjob_quota_notify extends cronjob {
//* Send email to reseller
if($web_config['overquota_notify_reseller'] == 'y') {
$client_group_id = $rec["sys_groupid"];
$app->db->queryOneRecord("SELECT parent_client_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id);
$client = $app->db->queryOneRecord("SELECT parent_client_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id);
if($client['parent_client_id'] > 0) {
$reseller = $app->db->queryOneRecord("SELECT email FROM client WHERE client_id = ?", $client['parent_client_id']);
}
......@@ -445,7 +445,7 @@ class cronjob_quota_notify extends cronjob {
//* Send email to reseller
if($web_config['overquota_notify_reseller'] == 'y') {
$client_group_id = $rec["sys_groupid"];
$app->db->queryOneRecord("SELECT parent_client_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id);
$client = $app->db->queryOneRecord("SELECT parent_client_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id);
if($client['parent_client_id'] > 0) {
$reseller = $app->db->queryOneRecord("SELECT email FROM client WHERE client_id = ?", $client['parent_client_id']);
}
......@@ -544,7 +544,7 @@ class cronjob_quota_notify extends cronjob {
//* Send email to reseller
if($web_config['overquota_db_notify_reseller'] == 'y') {
$client_group_id = $rec["sys_groupid"];
$app->db->queryOneRecord("SELECT parent_client_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id);
$client = $app->db->queryOneRecord("SELECT parent_client_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id);
if($client['parent_client_id'] > 0) {
$reseller = $app->db->queryOneRecord("SELECT email FROM client WHERE client_id = ?", $client['parent_client_id']);
}
......@@ -578,13 +578,14 @@ class cronjob_quota_notify extends cronjob {
$recipients = array();
//* send email to admin
if($global_config['admin_mail'] != '' && $web_config['overquota_db_notify_admin'] == 'y')
if($global_config['admin_mail'] != '' && $web_config['overquota_db_notify_admin'] == 'y') {
$recipients[] = $global_config['admin_mail'];
}
//* Send email to reseller
if($web_config['overquota_db_notify_reseller'] == 'y') {
$client_group_id = $rec["sys_groupid"];
$app->db->queryOneRecord("SELECT parent_client_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id);
$client = $app->db->queryOneRecord("SELECT parent_client_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id);
if($client['parent_client_id'] > 0) {
$reseller = $app->db->queryOneRecord("SELECT email FROM client WHERE client_id = ?", $client['parent_client_id']);
}
......@@ -594,8 +595,14 @@ class cronjob_quota_notify extends cronjob {
}
//* Send email to client
if($web_config['overquota_db_notify_client'] == 'y' && $client['email'] != '')
$recipients[] = $client['email'];
if($mail_config['overquota_notify_client'] == 'y') {
$client_group_id = $rec["sys_groupid"];
$client = $app->db->queryOneRecord("SELECT client.email FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id);
if($client['email'] != '') {
$recipients[] = $client['email'];
}
}
$this->_tools->send_notification_email('db_quota_ok_notification', $placeholders, $recipients);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment