From f053c1a5af4a93c0b003fc624cac1a6a35a8ef89 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Wed, 21 Oct 2015 19:00:20 +0000 Subject: [PATCH] LDAP filter changed to text (#20929). git-svn-id: http://svn.redmine.org/redmine/trunk@14725 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/auth_source_ldap.rb | 2 +- app/views/auth_sources/_form_auth_source_ldap.html.erb | 2 +- .../20151021185456_change_auth_sources_filter_to_text.rb | 9 +++++++++ 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20151021185456_change_auth_sources_filter_to_text.rb diff --git a/app/models/auth_source_ldap.rb b/app/models/auth_source_ldap.rb index d803952f6..02ef3b42a 100644 --- a/app/models/auth_source_ldap.rb +++ b/app/models/auth_source_ldap.rb @@ -22,7 +22,7 @@ require 'timeout' class AuthSourceLdap < AuthSource validates_presence_of :host, :port, :attr_login validates_length_of :name, :host, :maximum => 60, :allow_nil => true - validates_length_of :account, :account_password, :base_dn, :filter, :maximum => 255, :allow_blank => true + validates_length_of :account, :account_password, :base_dn, :maximum => 255, :allow_blank => true validates_length_of :attr_login, :attr_firstname, :attr_lastname, :attr_mail, :maximum => 30, :allow_nil => true validates_numericality_of :port, :only_integer => true validates_numericality_of :timeout, :only_integer => true, :allow_blank => true diff --git a/app/views/auth_sources/_form_auth_source_ldap.html.erb b/app/views/auth_sources/_form_auth_source_ldap.html.erb index 2ffd4d43e..d52e9790b 100644 --- a/app/views/auth_sources/_form_auth_source_ldap.html.erb +++ b/app/views/auth_sources/_form_auth_source_ldap.html.erb @@ -11,7 +11,7 @@ :onfocus => "this.value=''; this.name='auth_source[account_password]';", :onchange => "this.name='auth_source[account_password]';" %>

<%= f.text_field :base_dn, :required => true, :size => 60 %>

-

<%= f.text_field :filter, :size => 60, :label => :field_auth_source_ldap_filter %>

+

<%= f.text_area :filter, :size => 60, :label => :field_auth_source_ldap_filter %>

<%= f.text_field :timeout, :size => 4 %>

<%= f.check_box :onthefly_register, :label => :field_onthefly %>

diff --git a/db/migrate/20151021185456_change_auth_sources_filter_to_text.rb b/db/migrate/20151021185456_change_auth_sources_filter_to_text.rb new file mode 100644 index 000000000..344f9fa4a --- /dev/null +++ b/db/migrate/20151021185456_change_auth_sources_filter_to_text.rb @@ -0,0 +1,9 @@ +class ChangeAuthSourcesFilterToText < ActiveRecord::Migration + def self.up + change_column :auth_sources, :filter, :text + end + + def self.down + change_column :auth_sources, :filter, :string + end +end -- 2.39.5