lib/puavo/authentication.rb in puavo_authentication-0.0.16 vs lib/puavo/authentication.rb in puavo_authentication-0.0.17
- old
+ new
@@ -18,10 +18,10 @@
user.remove_connection
LdapBase.ldap_setup_connection(host, base, user.dn, password)
# Allow authentication always if logged in user is ExteralService object
if user.class == ExternalService
- return @current_user = user
+ return user
end
# Allow authetication only if user is School Admin in the some School or organisation owner.
if School.find( :first, :attribute => "puavoSchoolAdmin", :value => user.dn ) ||
LdapOrganisation.first.owner.include?(user.dn)