diff --git a/app/controllers/my_controller.rb b/app/controllers/my_controller.rb index a89ae846e..103030d51 100644 --- a/app/controllers/my_controller.rb +++ b/app/controllers/my_controller.rb @@ -180,6 +180,7 @@ class MyController < ApplicationController # Manage user's password def password + begin @act='password' @user = User.current unless @user.change_password_allowed? @@ -196,18 +197,20 @@ class MyController < ApplicationController Token.delete_user_all_tokens(@user) logout_user redirect_to signin_url(back_url: my_account_path) + return else - flash.now[:error] = l(:notice_account_wrong_password) + #flash.now[:error] = l(:notice_account_wrong_password) end end - #render :template => 'my/account',:layout=>'base_users_new' rescue Exception => e if e.message == 'wrong password' - flash.now[:error] = l(:notice_account_wrong_password) + # flash.now[:error] = l(:notice_account_wrong_password) else - flash.now[:error] = e.message + # flash.now[:error] = e.message end - render :template => 'my/account',:layout=>'base_users_new' + flash.now[:error] = l(:notice_account_old_wrong_password) + end + render :template => 'my/account',:layout=>'base_users_new' end # Create a new feeds key diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 2dd5bcf9a..ad4c6c2ac 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -9,6 +9,7 @@ zh: locale: "zh-CN" notice_account_updated: 帐号更新成功 + notice_account_old_wrong_password: 原始密码错误 notice_account_wrong_password: 密码错误 name_can_be_empty: 可以不填写真实姓名[保密所需] notice_successful_create: 创建成功