Fixes inconsistent license status reported

Fixes #4636
This commit is contained in:
Simone Mainardi 2020-10-28 09:31:45 +01:00
parent 7a8e0cf53f
commit a9f859dc7f
4 changed files with 36 additions and 3 deletions

View file

@ -82,6 +82,17 @@ local function create_contribute_notification_ui(notification)
return notification_ui:create(notification.id, title, description, NotificationLevels.INFO, action, notification.dismissable)
end
-- ###############################################################
local function create_forced_community_notification(notification)
local title = i18n("about.licence")
local description = i18n("about.forced_community_notification")
return notification_ui:create(notification.id, title, description, NotificationLevels.INFO, nil --[[ no action --]], notification.dismissable)
end
-- ###############################################################
local function create_tempdir_notification_ui(notification)
@ -456,4 +467,15 @@ end
-- ###############################################
return predicates
--- Create an instance for forced community notification
--- @param notification table The notification is the logic model defined in defined_notifications
--- @param container table Is the table where to put the new notification ui
function predicates.forced_community(notification, container)
if ntop.getInfo()["pro.forced_community"] then
table.insert(container, create_forced_community_notification(notification))
end
end
-- ###############################################
return predicates