From 2cea3178d639aaea42244e40cd86da44ecf42d2a Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Tue, 11 Nov 2014 17:01:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=82=AE=E7=AE=B1=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E5=8A=9F=E8=83=BD=20Signed-off-by:=20alan=20<54753343?= =?UTF-8?q?4@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/account_controller.rb | 26 +++------ app/views/account/email_valid.html.erb | 78 ++++++++++++++++++++++++++ config/routes.rb | 1 + 3 files changed, 86 insertions(+), 19 deletions(-) create mode 100644 app/views/account/email_valid.html.erb 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 @@ +
+ +