comparison app/controllers/application_controller.rb @ 239:7cec015f07ce cannam-pre-20110113-merge

Merge from branch "live"
author Chris Cannam
date Tue, 22 Feb 2011 16:48:15 +0000
parents 4b1a23d81683
children 73ff0e6a11b1 7d8567890fa3
comparison
equal deleted inserted replaced
235:61f66ddb0b65 239:7cec015f07ce
261 if !back_url.blank? 261 if !back_url.blank?
262 begin 262 begin
263 uri = URI.parse(back_url) 263 uri = URI.parse(back_url)
264 # do not redirect user to another host or to the login or register page 264 # do not redirect user to another host or to the login or register page
265 if (uri.relative? || (uri.host == request.host)) && !uri.path.match(%r{/(login|account/register)}) 265 if (uri.relative? || (uri.host == request.host)) && !uri.path.match(%r{/(login|account/register)})
266 # soundsoftware: if login page is https but back_url http,
267 # switch back_url to https to ensure cookie validity (#83)
268 if (uri.scheme == "http") && (URI.parse(request.url).scheme == "https")
269 uri.scheme = "https"
270 back_url = uri.to_s
271 end
266 redirect_to(back_url) 272 redirect_to(back_url)
267 return 273 return
268 end 274 end
269 rescue URI::InvalidURIError 275 rescue URI::InvalidURIError
270 # redirect to default 276 # redirect to default