diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index 74c988781..f1525522e 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -103,7 +103,7 @@ class AccountController < ApplicationController def register # @root_path="/home/pdl/redmine-2.3.2-0/apache2/" # - @cache_identityy = params[:identity]||"" #身份 + #@cache_identityy = params[:identity]||"" #身份 @cache_no = params[:no]||"" #学号 @cache_technical_title = params[:technical_title]||"" #教师职称 @cache_province = params[:province]||"" #省份 @@ -136,7 +136,7 @@ class AccountController < ApplicationController session[:auth_source_registration] = nil self.logged_user = @user flash[:notice] = l(:notice_account_activated) - redirect_to my_account_url + render :action => 'email_valid' end else @user.login = params[:user][:login] @@ -144,22 +144,7 @@ class AccountController < ApplicationController @user.password, @user.password_confirmation = user_params[:password], user_params[:password_confirmation] end - if(@cache_identityy == "") - if params[:identity] == "2" - @user.firstname = firstname_code - @user.lastname = lastname_code - end - flash.now[:error]= l(:label_identity)+l(:'activerecord.errors.messages.empty') - return - end - if(@cache_city == "") - if params[:identity] == "2" - @user.firstname = firstname_code - @user.lastname = lastname_code - end - flash.now[:error]= l(:label_location)+l(:'activerecord.errors.messages.empty') - return - end + case Setting.self_registration when '1' @@ -234,6 +219,9 @@ class AccountController < ApplicationController render :json => req end + def email_valid + end + private def authenticate_user @@ -363,7 +351,7 @@ class AccountController < ApplicationController UserStatus.create(:user_id => user.id, :changsets_count => 0, :watchers_count => 0) Mailer.register(token).deliver flash[:notice] = l(:notice_account_register_done) - redirect_to signin_url + render action: 'email_valid' else yield if block_given? end diff --git a/app/views/account/email_valid.html.erb b/app/views/account/email_valid.html.erb new file mode 100644 index 000000000..0eeb923ed --- /dev/null +++ b/app/views/account/email_valid.html.erb @@ -0,0 +1,78 @@ +
+ +