@@ -37,7 +37,7 class AuthSourceLdap < AuthSource | |||
|
37 | 37 | |
|
38 | 38 | if attrs.first && attrs.first[:dn] && authenticate_dn(attrs.first[:dn], password) |
|
39 | 39 | logger.debug "Authentication successful for '#{login}'" if logger && logger.debug? |
|
40 | return attrs | |
|
40 | return [] << attrs.first.except(:dn) | |
|
41 | 41 | end |
|
42 | 42 | rescue Net::LDAP::LdapError => text |
|
43 | 43 | raise "LdapError: " + text |
@@ -111,8 +111,7 class User < Principal | |||
|
111 | 111 | # user is not yet registered, try to authenticate with available sources |
|
112 | 112 | attrs = AuthSource.authenticate(login, password) |
|
113 | 113 | if attrs |
|
114 |
|
|
|
115 | user = new(attributes.symbolize_keys.except(:dn)) | |
|
114 | user = new(*attrs) | |
|
116 | 115 | user.login = login |
|
117 | 116 | user.language = Setting.default_language |
|
118 | 117 | if user.save |
General Comments 0
You need to be logged in to leave comments.
Login now