diff options
author | francis <francis> | 2009-08-19 23:20:39 +0000 |
---|---|---|
committer | francis <francis> | 2009-08-19 23:20:39 +0000 |
commit | 9bd4eff10b74ebd0a8f40e67c1b74e36654fa454 (patch) | |
tree | cc3a013f38d7ce1f6615222afe0f3112f4e6b776 /app/controllers/user_controller.rb | |
parent | 9242f214beca2f4f3adaec869d2ecf2471747a60 (diff) |
Set cookie if it isn't set by sign in page.
Improve text when cookies not working.
Diffstat (limited to 'app/controllers/user_controller.rb')
-rw-r--r-- | app/controllers/user_controller.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index cf1eb1d2c..1c0bef5b9 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -4,7 +4,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: user_controller.rb,v 1.67 2009-08-05 16:31:10 francis Exp $ +# $Id: user_controller.rb,v 1.68 2009-08-19 23:20:39 francis Exp $ class UserController < ApplicationController # Show page about a user @@ -58,12 +58,23 @@ class UserController < ApplicationController def signin work_out_post_redirect + # make sure we have cookies if session.instance_variable_get(:@dbman) if not session.instance_variable_get(:@dbman).instance_variable_get(:@original) + # try and set them if we don't + if !params[:again] + redirect_to signin_url(:r => params[:r], :again => 1) + return + end render :action => 'no_cookies' return end end + # remove "cookie setting attempt has happened" parameter if there is one and cookies worked + if params[:again] + redirect_to signin_url(:r => params[:r], :again => nil) + return + end if not params[:user_signin] # First time page is shown |