个人主页

This commit is contained in:
yutao 2015-07-18 13:23:48 +08:00
parent 0ef09fee8a
commit 3e3bcc32a6
2 changed files with 9 additions and 5 deletions

View File

@ -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,16 +197,18 @@ 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
flash.now[:error] = l(:notice_account_old_wrong_password)
end
render :template => 'my/account',:layout=>'base_users_new'
end

View File

@ -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: 创建成功