Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def log_in_to_phpbb(user)
- # 'sc_forum_sid' is the name the forum will use, because it's phpbb3 and I gave it the
- # 'sc_forum' prefix myself, and it appends '_sid' for the session id
- @sid = cookies['shelfcentered_session_id']
- cookies['sc_forum_sid'] = { :value => @sid, :expires => 3.months.from_now, :path => '/', :domain => ActionController::Base.session_options[:session_domain] }
- forum_sess = PhpbbSession.find_or_create_by_session_id(@sid)
- forum_sess.session_user_id = user.phpbb_user.user_id
- forum_sess.session_ip = request.remote_ip
- now = Time.now.to_i
- forum_sess.session_start = now
- forum_sess.session_time = now
- forum_sess.session_browser = request.user_agent
- forum_sess.session_last_visit = user.phpbb_user.user_lastvisit
- forum_sess.save!
- end
Add Comment
Please, Sign In to add comment