redmine_auth_source_ldap_531fix.diff

Alexander Ryabinovskiy, 2017-12-13 12:15

Download (1.12 KB)

View differences:

redmine/app/models/auth_source_ldap.rb Fri Dec 08 12:07:19 2017 +0300
173 173
  # Check if a DN (user record) authenticates with the password
174 174
  def authenticate_dn(dn, password)
175 175
    if dn.present? && password.present?
176
      initialize_ldap_con(dn, password).bind
176
      ldap_con = nil
177
	  ldap_con = initialize_ldap_con(dn, password)
178
	  authenticated = ldap_con.bind
179
	  if authenticated == false
180
	    authenticated = ldap_con.get_operation_result.error_message.include? "80090308: LdapErr: DSID-0C09042F, comment: AcceptSecurityContext error, data 531, v2580\u0000"
181
	  end
182
	  authenticated
177 183
    end
178 184
  end
179 185