From ca08efa7e57179045fe02d8e4aa88fcbfaee7d56 Mon Sep 17 00:00:00 2001 From: nieguanghui Date: Tue, 13 Aug 2013 11:14:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=BA=86=E6=88=91=E7=9A=84?= =?UTF-8?q?=E8=B4=A6=E6=88=B7=E4=B8=8B=E5=BC=B9=E5=87=BA=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E7=9A=84bug=EF=BC=9B=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E4=BA=86=E6=99=AE=E9=80=9A=E7=94=A8=E6=88=B7=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E8=B5=84=E6=96=99=E7=9A=84=E8=B7=B3=E8=BD=AC=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/my_controller.rb | 20 ++------------------ app/views/layouts/base_users.html.erb | 2 +- app/views/my/account.html.erb | 1 - 3 files changed, 3 insertions(+), 20 deletions(-) diff --git a/app/controllers/my_controller.rb b/app/controllers/my_controller.rb index 41a6cacbd..bda2f0dc2 100644 --- a/app/controllers/my_controller.rb +++ b/app/controllers/my_controller.rb @@ -50,28 +50,12 @@ class MyController < ApplicationController def account @user = User.current @pref = @user.pref - #Modified by young - unless @user.change_password_allowed? - flash[:error] = l(:notice_can_t_change_password) - redirect_to my_account_path - return - end - #Ended by young + if request.post? @user.safe_attributes = params[:user] @user.pref.attributes = params[:pref] @user.pref[:no_self_notified] = (params[:no_self_notified] == '1') - #Added by young - if @user.check_password?(params[:password]) - @user.password, @user.password_confirmation = params[:new_password], params[:new_password_confirmation] - if @user.save - flash[:notice] = l(:notice_account_password_updated) - # redirect_to my_account_path - end - else - flash[:error] = l(:notice_account_wrong_password) - end - #Ended by young + if @user.save @user.pref.save @user.notified_project_ids = (@user.mail_notification == 'selected' ? params[:notified_project_ids] : []) diff --git a/app/views/layouts/base_users.html.erb b/app/views/layouts/base_users.html.erb index 1c80870f6..c6d68c475 100644 --- a/app/views/layouts/base_users.html.erb +++ b/app/views/layouts/base_users.html.erb @@ -40,7 +40,7 @@ <% unless User.current == @user %> <%= watcher_link(@user, User.current) %> <% else %> - <%= link_to(l(:label_user_edit), edit_user_path(@user)) if User.current %><% end %> + <%= link_to(l(:label_user_edit), my_account_path(@user)) if User.current %><% end %> diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb index e94a526b9..fe4063743 100644 --- a/app/views/my/account.html.erb +++ b/app/views/my/account.html.erb @@ -73,5 +73,4 @@ <%= submit_tag l(:button_save) %> <% end %> -<%= error_messages_for 'user' %> <% html_title(l(:label_my_account)) -%>