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