Phillip Novess
2006-Sep-27 17:32 UTC
NET::LDAP Help Anyone? Maybe session Help? Bring my server to it''s knees Help?
Does anybody know what the correct way to cache results from Net::LDAP bind_as? I''ve been struggling for about a day now and I know it''s something really easy. But when ever I do something like this - def self.login(username, password) begin ldap = Net::LDAP.new ldap.host = "192.168.1.16" ldap.port = 389 result = ldap.bind_as( :base => "dc=net", :filter => "(cn=#{username})", :password => password ) @dn = result.first.dn rescue => e false end end and in my controller I do if request.post? session[:user_id] = AuthUser.login(params[:user]["username"], params[:user]["password"]) end My server returns a 500 error. I''ve tried from lighttpd and locomotive. Both return the same generic error. I suspect it''s related to the object returned is not compatible with the marshal_dump. So the question is how do I copy the values from the result set into my session object? Sorry if this is a stupid noobie question but I am one so. :) Thanks in advance. Phill Phillip Novess http://primalart.net pnovess-ee4meeAH724@public.gmane.org 970-227-7626 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---