# HG changeset patch # User Chris Cannam # Date 1301656273 -3600 # Node ID 7d8567890fa37eeddaa7d547544625d9fd07dda6 # Parent 7a616ddc3331814fb70a40e74f98520bcc65dab8 Redirect to My Page instead if asked to redirect to home page diff -r 7a616ddc3331 -r 7d8567890fa3 app/controllers/application_controller.rb --- a/app/controllers/application_controller.rb Fri Apr 01 12:03:41 2011 +0100 +++ b/app/controllers/application_controller.rb Fri Apr 01 12:11:13 2011 +0100 @@ -263,12 +263,17 @@ uri = URI.parse(back_url) # do not redirect user to another host or to the login or register page if (uri.relative? || (uri.host == request.host)) && !uri.path.match(%r{/(login|account/register)}) + # soundsoftware: if back_url is the home page, + # change it to My Page (#125) + if (uri.path == home_path) + uri.path = uri.path + "/my" + end # soundsoftware: if login page is https but back_url http, # switch back_url to https to ensure cookie validity (#83) if (uri.scheme == "http") && (URI.parse(request.url).scheme == "https") uri.scheme = "https" - back_url = uri.to_s end + back_url = uri.to_s redirect_to(back_url) return end