|
|
@ -25,7 +25,15 @@ module User::LdapAuthenticable
|
|
|
|
resource = joins(:account).find_by(accounts: { username: safe_username })
|
|
|
|
resource = joins(:account).find_by(accounts: { username: safe_username })
|
|
|
|
|
|
|
|
|
|
|
|
if resource.blank?
|
|
|
|
if resource.blank?
|
|
|
|
resource = new(email: attributes[Devise.ldap_mail.to_sym].first, agreement: true, account_attributes: { username: safe_username }, admin: false, external: true, confirmed_at: Time.now.utc)
|
|
|
|
resource = new(
|
|
|
|
|
|
|
|
email: attributes[Devise.ldap_mail.to_sym].first,
|
|
|
|
|
|
|
|
agreement: true,
|
|
|
|
|
|
|
|
account_attributes: {
|
|
|
|
|
|
|
|
username: safe_username,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
external: true,
|
|
|
|
|
|
|
|
confirmed_at: Time.now.utc
|
|
|
|
|
|
|
|
)
|
|
|
|
resource.save!
|
|
|
|
resource.save!
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|