@@ -38,7 +38,8 class AuthSource < ActiveRecord::Base | |||||
38 | begin |
|
38 | begin | |
39 | logger.debug "Authenticating '#{login}' against '#{source.name}'" if logger && logger.debug? |
|
39 | logger.debug "Authenticating '#{login}' against '#{source.name}'" if logger && logger.debug? | |
40 | attrs = source.authenticate(login, password) |
|
40 | attrs = source.authenticate(login, password) | |
41 | rescue |
|
41 | rescue => e | |
|
42 | logger.error "Error during authentication: #{e.message}" | |||
42 | attrs = nil |
|
43 | attrs = nil | |
43 | end |
|
44 | end | |
44 | return attrs if attrs |
|
45 | return attrs if attrs |
@@ -91,6 +91,8 class AuthSourceLdap < AuthSource | |||||
91 | end |
|
91 | end | |
92 |
|
92 | |||
93 | def self.get_attr(entry, attr_name) |
|
93 | def self.get_attr(entry, attr_name) | |
94 | entry[attr_name].is_a?(Array) ? entry[attr_name].first : entry[attr_name] |
|
94 | if !attr_name.blank? | |
|
95 | entry[attr_name].is_a?(Array) ? entry[attr_name].first : entry[attr_name] | |||
|
96 | end | |||
95 | end |
|
97 | end | |
96 | end |
|
98 | end |
General Comments 0
You need to be logged in to leave comments.
Login now