lib/devise_ldap_authenticatable/ldap/connection.rb
# Searches the LDAP for the login
#
# @return [Object] the LDAP entry found; nil if not found
Searches the LDAP for the login
Searches the LDAP for the login
def search_for_login
        @login_ldap_entry ||= begin
          DeviseLdapAuthenticatable::Logger.send("LDAP search for login: #{@attribute}=#{@login}")
          filter = Net::LDAP::Filter.eq(@attribute.to_s, @login.to_s)
          ldap_entry = nil
          match_count = 0
          @ldap.search(:filter => filter) {|entry| ldap_entry = entry; match_count+=1}
          op_result= @ldap.get_operation_result
          if op_result.code!=0 then
            DeviseLdapAuthenticatable::Logger.send("LDAP Error #{op_result.code}: #{op_result.message}")
          end
          DeviseLdapAuthenticatable::Logger.send("LDAP search yielded #{match_count} matches")
          ldap_entry
        end
      end
def search_for_login @login_ldap_entry ||= begin DeviseLdapAuthenticatable :: Logger . send ( "LDAP search for login: #{@attribute}=#{@login}" ) filter = Net :: LDAP :: Filter . eq ( @attribute . to_s , @login . to_s ) ldap_entry = nil match_count = 0 @ldap . search ( :filter => filter ) { | entry | ldap_entry = entry ; match_count += 1 } op_result = @ldap . get_operation_result if op_result . code != 0 then DeviseLdapAuthenticatable :: Logger . send ( "LDAP Error #{op_result.code}: #{op_result.message}" ) end DeviseLdapAuthenticatable :: Logger . send ( "LDAP search yielded #{match_count} matches" ) ldap_entry end end
Searches the LDAP for the login
Searches the LDAP for the login
the LDAP entry found; nil if not found
the LDAP entry found ; nil if not found
Object