Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Allow to set filter string in LDAP register

Oliver Güntherc30791740a16
diff --git a/lib/tasks/ldap.rake b/lib/tasks/ldap.rake
index 039683da97f..8caa609a2a4 100644
--- a/lib/tasks/ldap.rake
+++ b/lib/tasks/ldap.rake
@@ -81,7 +81,7 @@ namespace :ldap do
end
desc 'Register a LDAP auth source for the given LDAP URL and attribute mapping: ' \
- 'rake ldap:register["url=<URL> name=<Name> onthefly=<true,false>map_{login,firstname,lastname,mail,admin}=attribute"]'
+ 'rake ldap:register["url=<URL> name=<Name> onthefly=<true,false>map_{login,firstname,lastname,mail,admin}=attribute,filter_string"]'
task register: :environment do
args = parse_args
@@ -111,6 +111,8 @@ namespace :ldap do
attr_admin: args[:map_admin]
}
+ source.filter_string = args[:filter_string] if args.key?(:filter_string)
+
if source.save
puts "Saved LDAP auth source #{args[:name]}."
else