Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update notification for users with updates disabled #7253

Merged
merged 1 commit into from Aug 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion daily.sh
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion html/index.php
Expand Up @@ -302,7 +302,7 @@ function popUp(URL)
$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>",
Expand Down