fix: update notification for users with updates disabled (#7253)

Don't show the toast when the notification is marked as read
This commit is contained in:
Tony Murray
2017-08-29 09:32:24 -05:00
committed by GitHub
parent b5d24a533a
commit de8bcf3a6c
2 changed files with 2 additions and 2 deletions

View File

@@ -151,7 +151,7 @@ main () {
up=$(php daily.php -f update >&2; echo $?)
if [[ "$up" == "0" ]]; then
${DAILY_SCRIPT} no-code-update
set_notification update 0 # make sure there are no update notifications if update is disabled
set_notification update 1 # make sure there are no update notifications if update is disabled
exit
fi

View File

@@ -302,7 +302,7 @@ if (dbFetchCell("SELECT COUNT(*) FROM `devices` WHERE `last_polled` <= DATE_ADD(
$msg_box[] = array('type' => 'warning', 'message' => "<a href=\"poll-log/filter=unpolled/\">It appears as though you have some devices that haven't completed polling within the last 15 minutes, you may want to check that out :)</a>",'title' => 'Devices unpolled');
}
foreach (dbFetchRows('SELECT * FROM `notifications` WHERE `severity` > 1') as $notification) {
foreach (dbFetchRows('SELECT `notifications`.* FROM `notifications` WHERE NOT exists( SELECT 1 FROM `notifications_attribs` WHERE `notifications`.`notifications_id` = `notifications_attribs`.`notifications_id` AND `notifications_attribs`.`user_id` = ?) AND `severity` > 1', array($_SESSION['user_id'])) as $notification) {
$msg_box[] = array(
'type' => 'error',
'message' => "<a href='notifications/'>${notification['body']}</a>",