diff --git a/html/pages/settings/alerting.inc.php b/html/pages/settings/alerting.inc.php index b01f1ce288..6f22a5d768 100644 --- a/html/pages/settings/alerting.inc.php +++ b/html/pages/settings/alerting.inc.php @@ -269,6 +269,10 @@ $general_conf = array( 'descr' => 'Issue alerts to read only users', 'type' => 'checkbox', ), + array('name' => 'alert.users', + 'descr' => 'Issue alerts to normal users', + 'type' => 'checkbox', + ), array('name' => 'alert.syscontact', 'descr' => 'Issue alerts to sysContact', 'type' => 'checkbox', diff --git a/includes/alerts.inc.php b/includes/alerts.inc.php index 45d8ae7e83..c91eff12b0 100644 --- a/includes/alerts.inc.php +++ b/includes/alerts.inc.php @@ -282,11 +282,11 @@ function GetContacts($results) if (empty($user['level'])) { $user['level'] = get_userlevel($user['username']); } - if ($config["alert"]["globals"] && ( $user['level'] >= 5 && $user['level'] < 10 )) { + if ($config['alert']['globals'] && ( $user['level'] >= 5 && $user['level'] < 10 )) { $contacts[$user['email']] = $user['realname']; - } elseif ($config["alert"]["admins"] && $user['level'] == 10) { + } elseif ($config['alert']['admins'] && $user['level'] == 10) { $contacts[$user['email']] = $user['realname']; - } elseif (in_array($user['user_id'], $uids)) { + } elseif ($config['alert']['users'] == true && in_array($user['user_id'], $uids)) { $contacts[$user['email']] = $user['realname']; } } diff --git a/misc/notifications.rss b/misc/notifications.rss index 79b745272e..099785ddde 100644 --- a/misc/notifications.rss +++ b/misc/notifications.rss @@ -42,5 +42,11 @@ https://t.libren.ms/5fglp Mon, 1 May 2017 20:00:00 +0000 + + Update to alerting to normal users + We have released an update to fix normal users receiving alerts with no ability to turn this off. An option is now available within the General alert settings section to + enable this. Please note that the default is off to match with the other default contact settings. If you expect normal users to receive alerts then you should enable this new option. + Mon, 15 May 2017 23:00:00 +0000 + diff --git a/sql-schema/191.sql b/sql-schema/191.sql new file mode 100644 index 0000000000..2874618e0f --- /dev/null +++ b/sql-schema/191.sql @@ -0,0 +1 @@ +INSERT INTO config (config_name,config_value,config_default,config_descr,config_group,config_group_order,config_sub_group,config_sub_group_order,config_hidden,config_disabled) values ('alert.users',false,false,'Issue alerts to normal users','alerting',0,'general',0 ,'0' ,'0');