|
|
|
@ -949,6 +949,20 @@ class AccountController < ApplicationController
|
|
|
|
|
if @se.identity == 0 && @user.certification == 1
|
|
|
|
|
join_ex_course @user
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if @user.certification != 1 && @se.identity == 1
|
|
|
|
|
school_ids = School.where(:auto_users_trial => 1).map(&:id)
|
|
|
|
|
# 授权单位中的只有学生身份才自动授权,且创建试用授权记录
|
|
|
|
|
if !@se.school.nil? && school_ids.include?(@se.school_id)
|
|
|
|
|
@user.update_attributes(:certification => 1)
|
|
|
|
|
apply_action = ApplyAction.where(:user_id => @user.id, :container_type => "TrialAuthorization", :status => 0).first
|
|
|
|
|
if apply_action.present?
|
|
|
|
|
apply_action.update_attributes(:status => 1, :noticed => 1)
|
|
|
|
|
else
|
|
|
|
|
ApplyAction.create(:user_id => @user.id, :container_type => "TrialAuthorization", :ip_addr => request.remote_ip, :status => 1, :noticed => 1)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
redirect_to my_account_path
|
|
|
|
|
end
|
|
|
|
|