Needed to sets session.user_id in controller.

This commit is contained in:
Martin Edenhofer 2013-09-30 04:14:10 +02:00
parent b8277bbd58
commit 3b2baa8c9d

View file

@ -14,15 +14,6 @@ class SessionsController < ApplicationController
return return
end end
# set session user
current_user_set(user)
# log new session
user.activity_stream_log( 'session started', user.id )
# auto population of default collections
default_collection = SessionHelper::default_collections(user)
# remember me - set session cookie to expire later # remember me - set session cookie to expire later
if params[:remember_me] if params[:remember_me]
request.env['rack.session.options'][:expire_after] = 1.year request.env['rack.session.options'][:expire_after] = 1.year
@ -33,6 +24,16 @@ class SessionsController < ApplicationController
# request.env['rack.session.options'][:renew] = true # request.env['rack.session.options'][:renew] = true
# reset_session # reset_session
# set session user
session[:user_id] = user.id
current_user_set(user)
# log new session
user.activity_stream_log( 'session started', user.id )
# auto population of default collections
default_collection = SessionHelper::default_collections(user)
# set session user_id # set session user_id
user = User.find_fulldata(user.id) user = User.find_fulldata(user.id)
@ -128,6 +129,7 @@ class SessionsController < ApplicationController
end end
# set current session user # set current session user
session[:user_id] = authorization.user.id
current_user_set(authorization.user) current_user_set(authorization.user)
# log new session # log new session
@ -147,6 +149,7 @@ class SessionsController < ApplicationController
if user if user
# set current session user # set current session user
session[:user_id] = user.id
current_user_set(user) current_user_set(user)
# log new session # log new session