Commit 4577e54f authored by Holger Just's avatar Holger Just

Fix trailing whitespace

parent e95b4992
...@@ -110,9 +110,9 @@ class AuthSourceLdap < AuthSource ...@@ -110,9 +110,9 @@ class AuthSourceLdap < AuthSource
search_filters = object_filter & login_filter search_filters = object_filter & login_filter
end end
attrs = {} attrs = {}
ldap_con.search( :base => self.base_dn, ldap_con.search( :base => self.base_dn,
:filter => search_filters, :filter => search_filters,
:attributes=> search_attributes) do |entry| :attributes=> search_attributes) do |entry|
if onthefly_register? if onthefly_register?
...@@ -129,7 +129,7 @@ class AuthSourceLdap < AuthSource ...@@ -129,7 +129,7 @@ class AuthSourceLdap < AuthSource
def custom_filter_to_ldap def custom_filter_to_ldap
return nil unless custom_filter.present? return nil unless custom_filter.present?
begin begin
return Net::LDAP::Filter.construct(custom_filter) return Net::LDAP::Filter.construct(custom_filter)
rescue Net::LDAP::LdapError # Filter syntax error rescue Net::LDAP::LdapError # Filter syntax error
...@@ -147,7 +147,7 @@ class AuthSourceLdap < AuthSource ...@@ -147,7 +147,7 @@ class AuthSourceLdap < AuthSource
errors.add(:custom_filter, :invalid) errors.add(:custom_filter, :invalid)
end end
end end
def self.get_attr(entry, attr_name) def self.get_attr(entry, attr_name)
if !attr_name.blank? if !attr_name.blank?
entry[attr_name].is_a?(Array) ? entry[attr_name].first : entry[attr_name] entry[attr_name].is_a?(Array) ? entry[attr_name].first : entry[attr_name]
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
# Patches active_support/core_ext/load_error.rb to support 1.9.3 LoadError message # Patches active_support/core_ext/load_error.rb to support 1.9.3 LoadError message
if RUBY_VERSION >= '1.9.3' if RUBY_VERSION >= '1.9.3'
MissingSourceFile::REGEXPS << [/^cannot load such file -- (.+)$/i, 1] MissingSourceFile::REGEXPS << [/^cannot load such file -- (.+)$/i, 1]
end end
require 'active_record' require 'active_record'
......
...@@ -41,10 +41,10 @@ class AuthSourceLdapTest < ActiveSupport::TestCase ...@@ -41,10 +41,10 @@ class AuthSourceLdapTest < ActiveSupport::TestCase
@auth.custom_filter = "(& (homeDirectory=*) (sn=O*))" @auth.custom_filter = "(& (homeDirectory=*) (sn=O*))"
assert @auth.valid? assert @auth.valid?
assert_equal nil, @auth.errors.on(:custom_filter) assert_equal nil, @auth.errors.on(:custom_filter)
end end
end end
if ldap_configured? if ldap_configured?
context '#authenticate' do context '#authenticate' do
setup do setup do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment