ansible-role-zammad/files/ldap-user-filter.patch
2021-07-28 23:20:13 +02:00

19 lines
658 B
Diff

--- lib/ldap/user.rb.orig 2021-07-28 23:16:02.518958920 +0200
+++ lib/ldap/user.rb 2021-07-28 22:47:00.991810209 +0200
@@ -95,7 +95,7 @@
def valid?(username, password)
bind_success = @ldap.connection.bind_as(
base: @ldap.base_dn,
- filter: "(#{login_attribute}=#{username})",
+ filter: @user_filter ? "(&(#{login_attribute}=#{username})#{@user_filter})" : "(#{login_attribute}=#{username})",
password: password
)
@@ -179,6 +179,7 @@
@uid_attribute = config[:uid_attribute]
@filter = config[:filter]
+ @user_filter = config[:user_filter]
end
end
end