From d67fdb3069f21f857fcb4fb192fe8322b96b5901 Mon Sep 17 00:00:00 2001 From: Tony Murray Date: Tue, 29 Aug 2017 09:32:24 -0500 Subject: [PATCH] fix: update notification for users with updates disabled (#7253) Don't show the toast when the notification is marked as read --- daily.sh | 2 +- html/index.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/daily.sh b/daily.sh index e98091cc2b..c6eca5ab39 100755 --- a/daily.sh +++ b/daily.sh @@ -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 diff --git a/html/index.php b/html/index.php index c7a6e59b8f..2505740eb2 100644 --- a/html/index.php +++ b/html/index.php @@ -302,7 +302,7 @@ if (dbFetchCell("SELECT COUNT(*) FROM `devices` WHERE `last_polled` <= DATE_ADD( $msg_box[] = array('type' => 'warning', 'message' => "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 :)",'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' => "${notification['body']}",