From dec8b70895efa8208a50cd3bba5a068589dca2dc Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 10 Sep 2014 11:14:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=80=81=E5=B8=88=E8=A7=92?= =?UTF-8?q?=E8=89=B2=E5=9C=A8=E6=B2=A1=E6=9C=89=E4=BB=BB=E4=BD=95=E9=99=84?= =?UTF-8?q?=E4=BB=B6=E6=83=85=E5=86=B5=E4=B8=8B=E7=82=B9=E5=87=BB=E6=89=93?= =?UTF-8?q?=E5=8C=85=E4=B8=8B=E8=BD=BD=E6=8A=A5500=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=9A=84BUG=20#1209=20=E8=A7=A3=E5=86=B3=E6=96=B9=E6=A1=88?= =?UTF-8?q?=EF=BC=9A=E5=A2=9E=E5=8A=A0=E5=88=A4=E6=96=AD=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E6=9C=89=E4=B8=80=E4=B8=AA=E4=BB=A5=E4=B8=8A=E9=99=84=E4=BB=B6?= =?UTF-8?q?=EF=BC=8C=E5=BD=93=E6=B2=A1=E6=9C=89=E4=BB=BB=E4=BD=95=E9=99=84?= =?UTF-8?q?=E4=BB=B6=E6=97=B6=EF=BC=8C=E6=8F=90=E7=A4=BA=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E4=BB=BB=E4=BD=95=E6=96=87=E4=BB=B6=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E4=B8=8B=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/zipdown_controller.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/controllers/zipdown_controller.rb b/app/controllers/zipdown_controller.rb index 10aa39df2..dac213ff5 100644 --- a/app/controllers/zipdown_controller.rb +++ b/app/controllers/zipdown_controller.rb @@ -76,13 +76,19 @@ class ZipdownController < ApplicationController # Todo: User Access Controll homeattaches = bid.homeworks + #记录所有作业是不是有附件,有一个附件就改为true + has_file = false # 得到每一个人所有文件打包的zip文件 # 并将每一个人的zip打包为一个并返回路径 user_zip_paths = homeattaches.map do |homeattach| if homeattach.attachments.count > 0 zip_homework_by_user homeattach + has_file = true if has_file == false end end + + render_403 :message => :no_file_dowmload ,:layout => "course_base" if has_file == false + zipping "#{Time.now.to_i}_#{bid.name}.zip", user_zip_paths, OUTPUT_FOLDER #@paths = homeworks_attach_path