From 1855adb0371710ddbbecc752ec3c79284bd6cf03 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 11 Sep 2015 11:40:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=AA=E7=99=BB=E5=BD=95=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E8=AE=BF=E9=97=AE=E6=96=B0=E5=BB=BA=E8=AF=BE?= =?UTF-8?q?=E7=A8=8B=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index db972941e..a7f1589a6 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -468,13 +468,17 @@ class CoursesController < ApplicationController end def new - @course_type = params[:course_type] ||= params[:course] - @issue_custom_fields = IssueCustomField.sorted.all - @trackers = Tracker.sorted.all - @course = Course.new - @course.safe_attributes = params[:course] - # month = Time.now.month - render :layout => 'new_base' + if User.current.login? + @course_type = params[:course_type] ||= params[:course] + @issue_custom_fields = IssueCustomField.sorted.all + @trackers = Tracker.sorted.all + @course = Course.new + @course.safe_attributes = params[:course] + # month = Time.now.month + render :layout => 'new_base' + else + redirect_to signin_url + end end def desc_sort_course_by_avtivity(activity_count, courses)