|
|
|
@ -29,7 +29,7 @@ class CoursesController < ApplicationController
|
|
|
|
|
if course
|
|
|
|
|
@state = 4
|
|
|
|
|
else
|
|
|
|
|
unless (allow_join && User.current.member_of_course?(course))
|
|
|
|
|
unless (allow_join(course) && User.current.member_of_course?(course))
|
|
|
|
|
if params[:course_password] == course.password
|
|
|
|
|
members = []
|
|
|
|
|
members << Member.new(:role_ids => [10], :user_id => User.current.id)
|
|
|
|
@ -700,8 +700,8 @@ class CoursesController < ApplicationController
|
|
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
|
|
def allow_join
|
|
|
|
|
if course_endTime_timeout? Course.find(params[:object_id])
|
|
|
|
|
def allow_join course
|
|
|
|
|
if course_endTime_timeout? course
|
|
|
|
|
respond_to do |format|
|
|
|
|
|
format.js {
|
|
|
|
|
@state = 2
|
|
|
|
|