From 1c0b1e90419280005557606f0cb7ac37d79d7713 Mon Sep 17 00:00:00 2001 From: f0o Date: Tue, 19 May 2015 14:53:53 +0000 Subject: [PATCH] Honour SysContact-Override --- includes/alerts.inc.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/includes/alerts.inc.php b/includes/alerts.inc.php index ea6b94b733..8392daa191 100644 --- a/includes/alerts.inc.php +++ b/includes/alerts.inc.php @@ -299,8 +299,12 @@ function GetContacts($results) { } } if( is_numeric($result["device_id"]) ) { - $tmpa = dbFetchRow("SELECT sysContact FROM devices WHERE device_id = ?",array($result["device_id"])); - $contacts[$tmpa["sysContact"]] = "NOC"; + if( dbFetchCell("SELECT attrib_value FROM devices_attribs WHERE attrib_type = 'override_sysContact_bool' AND device_id = ?",array($result["device_id"])) === "1" ) { + $tmpa = dbFetchCell("SELECT attrib_value FROM devices_attribs WHERE attrib_type = 'override_sysContact_string' AND device_id = ?",array($result["device_id"])); + } else { + $tmpa = dbFetchCell("SELECT sysContact FROM devices WHERE device_id = ?",array($result["device_id"])); + } + $contacts[$tmpa] = "NOC"; $tmpa = dbFetchRows("SELECT user_id FROM devices_perms WHERE access_level >= 0 AND device_id = ?", array($result["device_id"])); foreach( $tmpa as $tmp ) { $uids[$tmp['user_id']] = $tmp['user_id'];