aboutsummaryrefslogtreecommitdiffstats
path: root/modules/auth
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2020-01-20 03:47:39 +0000
committerLunny Xiao <xiaolunwen@gmail.com>2020-01-20 11:47:39 +0800
commitc5014a7f2c4a263818269216d16d6f21b008cd17 (patch)
tree42423c1aa2ac688b4694e36bdc450d47d4276299 /modules/auth
parent54c2854cd2c4084ead621fa42565100338ff3467 (diff)
downloadgitea-c5014a7f2c4a263818269216d16d6f21b008cd17.tar.gz
gitea-c5014a7f2c4a263818269216d16d6f21b008cd17.zip
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 <xiaolunwen@gmail.com>
Diffstat (limited to 'modules/auth')
-rw-r--r--modules/auth/auth_form.go1
-rw-r--r--modules/auth/ldap/ldap.go1
2 files changed, 2 insertions, 0 deletions
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