|
|
|
@ -94,7 +94,7 @@ class ApplicationController < ActionController::Base
|
|
|
|
|
Setting.check_cache
|
|
|
|
|
# Find the current user
|
|
|
|
|
User.current = find_current_user
|
|
|
|
|
logger.info(" Current user: " + (User.current.logged? ? "#{User.current.login} (id=#{User.current.id})" : "anonymous")) if logger
|
|
|
|
|
#logger.info(" Current user: " + (User.current.logged? ? "#{User.current.login} (id=#{User.current.id})" : "anonymous")) if logger
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# Returns the current user or nil if no user is logged in
|
|
|
|
@ -300,7 +300,7 @@ class ApplicationController < ActionController::Base
|
|
|
|
|
render_404
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
#根据course_id找project
|
|
|
|
|
#<EFBFBD><EFBFBD><EFBFBD>course_id<EFBFBD><EFBFBD>project
|
|
|
|
|
def find_project_by_course_id
|
|
|
|
|
@bid = Bid.find params[:course_id]
|
|
|
|
|
@project = @bid.courses[0]
|
|
|
|
@ -354,7 +354,7 @@ class ApplicationController < ActionController::Base
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
#added by nwb
|
|
|
|
|
#获取课程
|
|
|
|
|
#<EFBFBD><EFBFBD>ȡ<EFBFBD>γ<EFBFBD>
|
|
|
|
|
def find_course
|
|
|
|
|
@course= Course.find(params[:id])
|
|
|
|
|
rescue ActiveRecord::RecordNotFound
|
|
|
|
|