|
|
|
@ -21,7 +21,7 @@ class CoursesController < ApplicationController
|
|
|
|
|
before_filter :toggleCourse, only: [:finishcourse, :restartcourse]
|
|
|
|
|
|
|
|
|
|
before_filter :require_login, :only => [:join, :unjoin]
|
|
|
|
|
before_filter :allow_join, :only => [:join]
|
|
|
|
|
#before_filter :allow_join, :only => [:join]
|
|
|
|
|
|
|
|
|
|
def join
|
|
|
|
|
if User.current.logged?
|
|
|
|
@ -29,7 +29,7 @@ class CoursesController < ApplicationController
|
|
|
|
|
if course
|
|
|
|
|
@state = 4
|
|
|
|
|
else
|
|
|
|
|
unless User.current.member_of_course? course
|
|
|
|
|
unless (allow_join && User.current.member_of_course?(course))
|
|
|
|
|
if params[:course_password] == course.password
|
|
|
|
|
members = []
|
|
|
|
|
members << Member.new(:role_ids => [10], :user_id => User.current.id)
|
|
|
|
|