diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index ad6d568a5..6c95294d7 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -202,7 +202,16 @@ class AccountController < ApplicationController def email_valid end + def resendmail + user = User.find(params[:user]) if params[:user] + token = Token.new(:user => user, :action => "register") + if token.save + Mailer.register(token).deliver + else + yield if block_given? + end + end private def authenticate_user diff --git a/app/views/account/email_valid.html.erb b/app/views/account/email_valid.html.erb index c77c0294e..e6bc2a2db 100644 --- a/app/views/account/email_valid.html.erb +++ b/app/views/account/email_valid.html.erb @@ -4,7 +4,7 @@ 注册帐号 @@ -32,7 +32,9 @@ border: none; padding: 10px 16px; - line-height: 1.33;" target="_blank">立即查收邮件

+ line-height: 1.33;" target="_blank">立即查收邮件 +     <%= link_to l(:label_mail_resend), { :controller => 'account', :action => 'resendmail',:user => @user}, :remote => true, :method => 'get' %> +

diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 8f23d3025..38c5ae31f 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -1609,6 +1609,7 @@ zh: label_tags_user_mail: 用户邮箱: label_tags_user_name: 用户名: label_tags_numbers: Tag统计: + label_mail_resend: 重新发送激活邮件 label_max_number: 登录名是在网站中显示的您的公开标识,只能为英文和数字。 label_mail_attention: qq邮箱可能收不到此邮件,其他邮箱如果没有收到可能在垃圾邮件中, label_mail_attention1: 其中gmail与教育网邮箱的激活邮件有时比较慢,请耐心等待。 diff --git a/config/routes.rb b/config/routes.rb index 226f2259e..d042a823e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -207,8 +207,8 @@ 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 'account/email_valid', :to => 'account#email_valid', :via => :get + match 'account/resendmail', :to => 'account#resendmail', :via=> :get match 'projects/:id/wiki', :to => 'wikis#edit', :via => :post match 'projects/:id/wiki/destroy', :to => 'wikis#destroy', :via => [:get, :post]