From 3e3bcc32a6aad5e4a18f60cf497ecdb6b679d374 Mon Sep 17 00:00:00 2001 From: yutao <283765470@qq.com> Date: Sat, 18 Jul 2015 13:23:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/my_controller.rb | 13 ++++++++----- config/locales/zh.yml | 1 + 2 files changed, 9 insertions(+), 5 deletions(-) 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: 创建成功