Guest User

Untitled

a guest
May 26th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. def log_in_to_phpbb(user)
  2. # 'sc_forum_sid' is the name the forum will use, because it's phpbb3 and I gave it the
  3. # 'sc_forum' prefix myself, and it appends '_sid' for the session id
  4. @sid = cookies['shelfcentered_session_id']
  5. cookies['sc_forum_sid'] = { :value => @sid, :expires => 3.months.from_now, :path => '/', :domain => ActionController::Base.session_options[:session_domain] }
  6. forum_sess = PhpbbSession.find_or_create_by_session_id(@sid)
  7. forum_sess.session_user_id = user.phpbb_user.user_id
  8. forum_sess.session_ip = request.remote_ip
  9. now = Time.now.to_i
  10. forum_sess.session_start = now
  11. forum_sess.session_time = now
  12. forum_sess.session_browser = request.user_agent
  13. forum_sess.session_last_visit = user.phpbb_user.user_lastvisit
  14. forum_sess.save!
  15. end
Add Comment
Please, Sign In to add comment