From 7bfd0796c2c3a21715bebae8abdc4f5c77f5094b Mon Sep 17 00:00:00 2001 From: Robin Houston Date: Tue, 13 Mar 2012 00:23:12 +0000 Subject: Admin users clicking confirmation links Fixes #446. See issue for details. --- app/controllers/request_controller.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'app/controllers/request_controller.rb') diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index b484ec514..7ca081c04 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_controller.rb @@ -347,7 +347,13 @@ class RequestController < ApplicationController return end - @info_request.user = authenticated_user + if params[:post_redirect_user] + # If an admin has clicked the confirmation link on a users behalf, + # we don’t want to reassign the request to the administrator. + @info_request.user = params[:post_redirect_user] + else + @info_request.user = authenticated_user + end # This automatically saves dependent objects, such as @outgoing_message, in the same transaction @info_request.save! # XXX send_message needs the database id, so we send after saving, which isn't ideal if the request broke here. -- cgit v1.2.3