This commit is contained in:
emanuele-f 2017-05-16 20:02:50 +02:00
parent 89df67d697
commit 859284e070
3 changed files with 14 additions and 10 deletions

View file

@ -33,6 +33,12 @@ function hasNagiosSupport()
return prefs.nagios_nsca_host ~= nil
end
function hasAlertsDisabled()
return (prefs.has_cmdl_disable_alerts == true) or
((_POST["disable_alerts_generation"] ~= nil) and (_POST["disable_alerts_generation"] == "1")) or
((_POST["disable_alerts_generation"] == nil) and (ntop.getPref("ntopng.prefs.disable_alerts_generation") == "1"))
end
-- This table is used both to control access to the preferences and to filter preferences results
menu_subpages = {
{id="auth", label=i18n("prefs.user_authentication"), advanced=false, pro_only=true, disabled=false, entries={
@ -165,7 +171,7 @@ menu_subpages = {
hidden = (prefs.is_dump_flows_to_mysql_enabled == false),
}
}}, {id="ext_alerts", label=i18n("prefs.external_alerts"), advanced=false, pro_only=false, disabled=alerts_disabled, entries={
}}, {id="ext_alerts", label=i18n("prefs.external_alerts"), advanced=false, pro_only=false, disabled=hasAlertsDisabled(), entries={
toggle_alert_syslog = {
title = i18n("prefs.toggle_alert_syslog_title"),
description = i18n("prefs.toggle_alert_syslog_description"),