aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/request_controller.rb
diff options
context:
space:
mode:
authorDavid Cabo <david@calibea.com>2011-08-23 02:42:08 +0200
committerDavid Cabo <david@calibea.com>2011-08-23 02:42:08 +0200
commite586ce62c5dca6e453cf383b049ad20b98879484 (patch)
tree109580c0f9e79076eef5431cd725957af75dc748 /app/controllers/request_controller.rb
parent7cd11a637ff02186ec82e110be4c4af977ad9bb3 (diff)
parent6f46c15f6290e286ffa7b12ace40e4983c6641a3 (diff)
Merge branch 'asktheeu' into asktheeu-new-design
Diffstat (limited to 'app/controllers/request_controller.rb')
-rw-r--r--app/controllers/request_controller.rb29
1 files changed, 20 insertions, 9 deletions
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb
index b7c8767cc..e13291c2d 100644
--- a/app/controllers/request_controller.rb
+++ b/app/controllers/request_controller.rb
@@ -23,6 +23,17 @@ class RequestController < ApplicationController
end
def select_authority
+ # Check whether we force the user to sign in right at the start, or we allow her
+ # to start filling the request anonymously
+ if force_registration_on_new_request && !authenticated?(
+ :web => _("To send your FOI request"),
+ :email => _("Then you'll be allowed to send FOI requests."),
+ :email_subject => _("Confirm your email address")
+ )
+ # do nothing - as "authenticated?" has done the redirect to signin page for us
+ return
+ end
+
medium_cache
end
@@ -276,15 +287,6 @@ class RequestController < ApplicationController
return
end
- if !authenticated?(
- :web => _("To send your FOI request"),
- :email => _("Then your FOI request to {{public_body_name}} will be sent.",:public_body_name=>@info_request.public_body.name),
- :email_subject => _("Confirm your FOI request to ") + @info_request.public_body.name
- )
- # do nothing - as "authenticated?" has done the redirect to signin page for us
- return
- end
-
# Show preview page, if it is a preview
if params[:preview].to_i == 1
message = ""
@@ -307,6 +309,15 @@ class RequestController < ApplicationController
return
end
+ if !authenticated?(
+ :web => _("To send your FOI request"),
+ :email => _("Then your FOI request to {{public_body_name}} will be sent.",:public_body_name=>@info_request.public_body.name),
+ :email_subject => _("Confirm your FOI request to ") + @info_request.public_body.name
+ )
+ # do nothing - as "authenticated?" has done the redirect to signin page for us
+ return
+ end
+
@info_request.user = authenticated_user
# This automatically saves dependent objects, such as @outgoing_message, in the same transaction
@info_request.save!