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 @@ + + + 注册帐号 + + + +<% email = params[:mail] %> +
+

邮箱激活

+
+
+

请在24小时内点击邮件中的链接继续完成注册

+
+ 邮件已发送到邮箱 + alanlong9278@126.com +
+ + <% mail = "mail." + mail.split('@')[1] %> + 立即查收邮件 + + + 没收到邮件? + +
+
+ 请先检查是否在垃圾邮件中 + 如果还未收到, + 重新发送邮件 + +
+
+ +
+
+
+ \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 21949afd4..30d4b2593 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -200,6 +200,7 @@ RedmineApp::Application.routes.draw do match 'account/lost_password', :via => [:get, :post], :as => 'lost_password' match 'account/activate', :via => :get match 'account/valid_ajax', :via => :get + get 'account/email_valid', :to => 'account#email_valid' match 'projects/:id/wiki', :to => 'wikis#edit', :via => :post match 'projects/:id/wiki/destroy', :to => 'wikis#destroy', :via => [:get, :post]