aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/application_controller.rb
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2012-12-13 21:28:24 +0000
committerLouise Crow <louise.crow@gmail.com>2012-12-13 21:28:24 +0000
commitf59ffc6193f0558fa7e44240deb16b8ab2cc237b (patch)
tree155e8ba6e45ccfda8f52fcc216bef44e4e3f4418 /app/controllers/application_controller.rb
parent2e7ec67bfb99ee19e4fbadf9bebd9d0e0f4299d9 (diff)
parenta5744b206cf1ca811f913d68cafc0178079be2f7 (diff)
Merge branch 'hotfix/authenticate-and-expire-download-zips'0.6.8.2
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r--app/controllers/application_controller.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 3f3c169ae..b707ae878 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -229,6 +229,19 @@ class ApplicationController < ActionController::Base
end
end
+ def request_dirs(info_request)
+ first_three_digits = info_request.id.to_s()[0..2]
+ File.join(first_three_digits.to_s, info_request.id.to_s)
+ end
+
+ def request_download_zip_dir(info_request)
+ File.join(download_zip_dir, "download", request_dirs(info_request))
+ end
+
+ def download_zip_dir()
+ File.join(Rails.root, '/cache/zips/')
+ end
+
# get the local locale
def locale_from_params(*args)
if params[:show_locale]