From aabd18329923131908f7834d0478911fb16f4c6e Mon Sep 17 00:00:00 2001 From: linhk <304431313@.com> Date: Tue, 16 Sep 2014 14:08:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=A8=E5=86=8C=E7=95=8C=E9=9D=A2=E5=A7=93?= =?UTF-8?q?=E6=B0=8F=E6=96=87=E6=9C=AC=E6=A1=86=E5=86=85=E5=AE=B9=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/account_controller.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index d0f94b119..02163889b 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -110,6 +110,8 @@ class AccountController < ApplicationController @cache_city = params[:city]||"" #城市 @cache_enterprise_name = params[:enterprise_name]||"" #企业 + firstname_code = "" + lastname_code = "" (redirect_to(home_url); return) unless Setting.self_registration? || session[:auth_source_registration] if request.get? session[:auth_source_registration] = nil @@ -119,6 +121,8 @@ class AccountController < ApplicationController @user = User.new @user.safe_attributes = user_params if params[:identity] == "2" # 2 企业 + firstname_code = @user.firstname + lastname_code = @user.lastname @user.firstname = params[:enterprise_name] @user.lastname = l(:field_enterprise) end @@ -141,10 +145,18 @@ class AccountController < ApplicationController 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 @@ -174,6 +186,10 @@ class AccountController < ApplicationController end end + if params[:identity] == "2" + @user.firstname = firstname_code + @user.lastname = lastname_code + end end # Token based account activation