diff options
author | francis <francis> | 2007-11-07 10:45:44 +0000 |
---|---|---|
committer | francis <francis> | 2007-11-07 10:45:44 +0000 |
commit | 26febc426a926fa372798f1a18830056842f1d87 (patch) | |
tree | 97dd0bd4c8b805b76c94ca8bc7055b726b80fa03 /app/controllers/user_controller.rb | |
parent | b3a0129b7e2136c06765aa955435ea43873e880f (diff) |
Make /signin URL work
Fix some HTMl
Diffstat (limited to 'app/controllers/user_controller.rb')
-rw-r--r-- | app/controllers/user_controller.rb | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 79311753e..75f78c97f 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.14 2007-11-07 10:26:29 francis Exp $ +# $Id: user_controller.rb,v 1.15 2007-11-07 10:45:44 francis Exp $ class UserController < ApplicationController # XXX See controllers/application.rb simplify_url_part for reverse of expression in SQL below @@ -14,7 +14,11 @@ class UserController < ApplicationController # Login form def signin - # The explict signin link uses this to store where it is to go back to + # Redirect to front page later if nothing else specified + if not params[:r] and not params[:token] + params[:r] = "/" + end + # The explicit "signin" link uses this to specify where to go back to if params[:r] @post_redirect = PostRedirect.new(:uri => params[:r], :post_params => {}, :reason_params => { @@ -24,7 +28,8 @@ class UserController < ApplicationController }) @post_redirect.save! params[:token] = @post_redirect.token - else + elsif params[:token] + # Otherwise we have a token (which represents a saved POST request0 @post_redirect = PostRedirect.find_by_token(params[:token]) end |