Add config-option to exclude SysContact from alerts

This commit is contained in:
f0o
2015-05-20 16:29:39 +00:00
parent 695edde7bd
commit fe412952c1
3 changed files with 12 additions and 5 deletions
+7 -5
View File
@@ -299,12 +299,14 @@ function GetContacts($results) {
}
}
if( is_numeric($result["device_id"]) ) {
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"]));
if( $config['alert']['syscontact'] == true ) {
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";
}
$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'];