Project

General

Profile

Patch #30757 » auth_source_ldap.rb.diff

Guilherme Chehab, 2019-02-06 16:01

View differences:

app/models/auth_source_ldap.rb (working copy)
58 58
      if attrs && attrs[:dn] && authenticate_dn(attrs[:dn], password)
59 59
        logger.debug "Authentication successful for '#{login}'" if logger && logger.debug?
60 60
        return attrs.except(:dn)
61
      else
62
        if self.attr_login.downcase == "samaccountname"
63
          domain = (self.base_dn.gsub(/dc[ |=|\"]*|[\"| ]*/i,'')).gsub(',','.')
64
	  authenticate_dn(login+"@"+domain,password)
65
        end
61 66
      end
62 67
    end
63 68
  rescue *NETWORK_EXCEPTIONS => e
(1-1/2)