Fix trailing whitespace

This commit is contained in:
Holger Just 2012-01-03 20:43:08 +01:00
parent e95b4992e4
commit 4577e54f04
3 changed files with 8 additions and 8 deletions

View File

@ -110,9 +110,9 @@ class AuthSourceLdap < AuthSource
search_filters = object_filter & login_filter
end
attrs = {}
ldap_con.search( :base => self.base_dn,
:filter => search_filters,
ldap_con.search( :base => self.base_dn,
:filter => search_filters,
:attributes=> search_attributes) do |entry|
if onthefly_register?
@ -129,7 +129,7 @@ class AuthSourceLdap < AuthSource
def custom_filter_to_ldap
return nil unless custom_filter.present?
begin
return Net::LDAP::Filter.construct(custom_filter)
rescue Net::LDAP::LdapError # Filter syntax error
@ -147,7 +147,7 @@ class AuthSourceLdap < AuthSource
errors.add(:custom_filter, :invalid)
end
end
def self.get_attr(entry, attr_name)
if !attr_name.blank?
entry[attr_name].is_a?(Array) ? entry[attr_name].first : entry[attr_name]

View File

@ -14,7 +14,7 @@
# Patches active_support/core_ext/load_error.rb to support 1.9.3 LoadError message
if RUBY_VERSION >= '1.9.3'
MissingSourceFile::REGEXPS << [/^cannot load such file -- (.+)$/i, 1]
MissingSourceFile::REGEXPS << [/^cannot load such file -- (.+)$/i, 1]
end
require 'active_record'

View File

@ -41,10 +41,10 @@ class AuthSourceLdapTest < ActiveSupport::TestCase
@auth.custom_filter = "(& (homeDirectory=*) (sn=O*))"
assert @auth.valid?
assert_equal nil, @auth.errors.on(:custom_filter)
end
end
if ldap_configured?
context '#authenticate' do
setup do