From c5014a7f2c4a263818269216d16d6f21b008cd17 Mon Sep 17 00:00:00 2001 From: zeripath Date: Mon, 20 Jan 2020 03:47:39 +0000 Subject: Add option to prevent LDAP from deactivating everything on empty search (#9879) * Add option to prevent LDAP from deactivating everything on empty search * Update options/locale/locale_en-US.ini Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com> Co-authored-by: Lunny Xiao --- modules/auth/auth_form.go | 1 + modules/auth/ldap/ldap.go | 1 + 2 files changed, 2 insertions(+) (limited to 'modules') diff --git a/modules/auth/auth_form.go b/modules/auth/auth_form.go index c838590c1f..a30ebb75eb 100644 --- a/modules/auth/auth_form.go +++ b/modules/auth/auth_form.go @@ -30,6 +30,7 @@ type AuthenticationForm struct { SearchPageSize int Filter string AdminFilter string + AllowDeactivateAll bool IsActive bool IsSyncEnabled bool SMTPAuth string diff --git a/modules/auth/ldap/ldap.go b/modules/auth/ldap/ldap.go index ed83a77e12..7f0d2c93f3 100644 --- a/modules/auth/ldap/ldap.go +++ b/modules/auth/ldap/ldap.go @@ -47,6 +47,7 @@ type Source struct { Filter string // Query filter to validate entry AdminFilter string // Query filter to check if user is admin Enabled bool // if this source is disabled + AllowDeactivateAll bool // Allow an empty search response to deactivate all users from this source } // SearchResult : user data -- cgit v1.2.3