lib/puavo_authentication/controllers/helpers.rb in puavo_authentication-0.0.19 vs lib/puavo_authentication/controllers/helpers.rb in puavo_authentication-0.1.0

- old
+ new

@@ -5,16 +5,11 @@ unless session[:dn].nil? unless @current_user.nil? return @current_user else begin - if session[:dn].to_s.match(/ou=People/) - return @current_user = User.find(session[:dn]) - else - # If user is ExternalService return nil - logger.info "current_user is ExternalServier user: #{session[:dn]}" - end + return @current_user = User.find(session[:dn]) # REST/OAuth? rescue logger.info "Session's user not found! User is removed from ldap server." logger.info "session[:dn]: #{session[:dn]}" # Delete ldap connection informations from session. session.delete :password_plaintext @@ -98,16 +93,9 @@ Puavo::Authorization.organisation_owner? end def set_authorization_user Puavo::Authorization.current_user = current_user if current_user - end - - def remove_authorization_user - if Puavo::Authorization.current_user - logger.debug "Remove authorization user: " + Puavo::Authorization.current_user.dn.inspect - end - Puavo::Authorization.current_user = nil end end end end