lib/fiona7/engine.rb in infopark_fiona7-1.5.2.0.0 vs lib/fiona7/engine.rb in infopark_fiona7-1.5.2.1.0.pre.beta1

- old
+ new

@@ -155,20 +155,25 @@ if Fiona7.login = !config.root_mode Scrivito.configure do |config| config.editing_auth do |env| request = ActionDispatch::Request.new(env) session = request.session - rsession = session[:rsession] + rsession = Reactor::SessionHelper::RsessionHelper.from_session(session) if rsession && rsession.user? Fiona7::ScrivitoUser.define(rsession.user) end end config.find_user do |user_id| - user = Reactor::Cache::User.instance.get(user_id) - - Fiona7::ScrivitoUser.define(user) + begin + user = Reactor::Cache::User.instance.get(user_id) + Fiona7::ScrivitoUser.define(user) + rescue Reactor::Cm::XmlSingleRequestError => e + # this is the error code for entry (possibly user) not found + # other errors we want to pass on (unauthorized, etc) + raise e unless e.message =~ /060001/ + end end end end if config.mode == :standalone @@ -237,10 +242,10 @@ # and if we don't find any, we destroy rsession. Why? # Calling rsession.destroy first constructs the session # for the current user (root most likely), which is not # really a thing that we want - being root by default # should only happen in the root mode - if !session[:rsession] + if !rsession.user? rsession.destroy end end end end