i just finished integrating this and it took some time. Someone here on the
list wrote up a really nice page on the wiki about it which helped a great
deal. I spent a good deal of time working with sessions mostly. What i
ended up doing was making my sessions table the phpbb sessions table
(phpbb_sessions) and making the session_id cookie the same as phpbb for
rails and phpbb so that if i logged into my rails app i was already logged
into the forum, and vice versa. I then setup a before_filter in
application.rb to check for, say a phpbb cookie to then load the session
data like this
.......
elsif cookies[:fscookie_sid] && session[:user].nil?
sess = Session.find_by_session_id(cookies[:fscookie_sid], :include =>
"user")
if sess && sess.session_user_id > 1
session[:user] = Hash.new
session[:user] = sess.user.attributes
session[:zip] = session[:user]["zipcode"]
setlocation(session[:zip]) && setdeflocation if session[:zip]
session.model.session_user_id = sess.user.user_id
session.model.session_ip = encode_ip
session.model.session_time = Time.now
session.model.session_logged_in = 1
elsif sess && sess.session_user_id == 0
session.model.session_user_id = 1
end
end
One thing I did notice is that for some reason the default value of
''1''
wasnt being used in the database, so I had to manually set the user_id to 1
if it was a "guest" user. Still havent figured out why.
If you need any more help you can find me on the rails webchat at
http://www.railswebchat.com
adam
-----------------------------------------
http://www.railswebchat.com
On 5/30/06, Ken Kam <kenkam@gmail.com> wrote:>
> Okay, I see what you mean now.
>
> I wasn''t entirely sure but I think I understand that there are
several
> ways to go around this, one of them is your method. Another one would be
> to declare several fastcgi.server in lighttpd for different subdomains.
>
> I just read up on reverse proxying with Apache (I haven''t done
anything
> like this before) and it seems I can do a ProxyPassReverse and point
> /foo/ to a subdomain that has been setup (presumebly a virtual host
> which points to the lighttpd server?) - which solves the problem of not
> wanting a subdomain. Am I on the right lines?
>
> Also, wouldn''t it be easier if one declares all those in the
lighttpd
> config? How would I host it on lighty, again, without subdomains? Would
> it be proxying again (with lighty, of course)?
>
> Many thanks.
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://wrath.rubyonrails.org/pipermail/rails/attachments/20060531/bbac87eb/attachment.html