diff --git a/include/ntop_defines.h b/include/ntop_defines.h index f7b77c165ff9..aa4b1bf97a17 100644 --- a/include/ntop_defines.h +++ b/include/ntop_defines.h @@ -1247,7 +1247,7 @@ #define PREF_LDAP_USER_GROUP NTOPNG_PREFS_PREFIX ".ldap.user_group" #define PREF_LDAP_ADMIN_GROUP NTOPNG_PREFS_PREFIX ".ldap.admin_group" #define PREF_LDAP_FOLLOW_REFERRALS NTOPNG_PREFS_PREFIX ".ldap.follow_referrals" -#define PREF_LDAP_DEBUG NTOPNG_PREFS_PREFIX ".ldap.debug" +#define PREF_LDAP_DEBUG NTOPNG_PREFS_PREFIX ".ldap_debug" #ifdef HAVE_LDAP #define MAX_LDAP_LEN \ 256 /* Keep it in sync with lua preferences file prefs.lua */ diff --git a/scripts/locales/en.lua b/scripts/locales/en.lua index de9d79e0689b..3f6284badd5f 100644 --- a/scripts/locales/en.lua +++ b/scripts/locales/en.lua @@ -7084,6 +7084,8 @@ local lang = { ["toggle_ldap_anonymous_bind_title"] = "LDAP Anonymous Binding", ["toggle_ldap_auth"] = "Toggle LDAP Authentication", ["toggle_ldap_auth_descr"] = "Toggle gui authentication via LDAP.", + ["toggle_ldap_debug_description"] = "Toggle the debugging of LDAP authentication. Extra information are printed out to the ntopng logs.", + ["toggle_ldap_debug_title"] = "LDAP Debug", ["toggle_ldap_referrals_description"] = "Specifies if the client should automatically follow referrals returned by LDAP servers.", ["toggle_ldap_referrals_title"] = "Follow Referrals", ["toggle_local_auth"] = "Toggle Local Authentication", diff --git a/scripts/lua/admin/prefs.lua b/scripts/lua/admin/prefs.lua index 06f68fa771a4..289ea998abad 100644 --- a/scripts/lua/admin/prefs.lua +++ b/scripts/lua/admin/prefs.lua @@ -830,7 +830,7 @@ if auth.has_capability(auth.capabilities.preferences) then local elementToSwitch = { "row_multiple_ldap_account_type", "row_toggle_ldap_anonymous_bind", "server", "bind_dn", "bind_pwd", "ldap_server_address", "search_path", "user_group", - "admin_group", "row_toggle_ldap_referrals" } + "admin_group", "row_toggle_ldap_referrals", "row_toggle_ldap_debug" } prefsToggleButton(subpage_active, { field = auth_toggles.ldap, @@ -942,6 +942,14 @@ if auth.has_capability(auth.capabilities.preferences) then reverse_switch = true, hidden = not showElements }) + + prefsToggleButton(subpage_active, { + field = "toggle_ldap_debug", + default = "0", + pref = "ldap_debug", + hidden = not showElements + }) + end -- ##################### diff --git a/scripts/lua/modules/http_lint.lua b/scripts/lua/modules/http_lint.lua index 77d2f1b3518e..fe890531e78c 100644 --- a/scripts/lua/modules/http_lint.lua +++ b/scripts/lua/modules/http_lint.lua @@ -2317,6 +2317,7 @@ local known_parameters = { ["toggle_radius_auth"] = validateBool, ["toggle_http_auth"] = validateBool, ["toggle_ldap_referrals"] = validateBool, + ["toggle_ldap_debug"] = validateBool, ["toggle_webhook_notification"] = validateBool, ["toggle_elasticsearch_notification"] = validateBool, ["toggle_auth_session_midnight_expiration"] = validateBool, diff --git a/scripts/lua/modules/prefs_menu.lua b/scripts/lua/modules/prefs_menu.lua index a5f62d498da6..2fa261d6e52d 100644 --- a/scripts/lua/modules/prefs_menu.lua +++ b/scripts/lua/modules/prefs_menu.lua @@ -776,6 +776,10 @@ local menu_subpages = {{ description = i18n("prefs.toggle_ldap_referrals_description"), hidden = (not hasLdap) }, + toggle_ldap_debug = { + title = i18n("prefs.toggle_ldap_debug_title"), + description = i18n("prefs.toggle_ldap_debug_description") + }, radius_server = { title = i18n("prefs.radius_server_title"), description = i18n("prefs.radius_server_description", {