From 948e2190f877fcc7ab93e8b4ab5b80da53a57911 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 3 Dec 2006 20:51:17 +0000 Subject: [PATCH] "hide my email address" preference added, so that it's not displayed on account/show git-svn-id: http://redmine.rubyforge.org/svn/trunk@63 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- redmine/app/controllers/my_controller.rb | 5 ++++- redmine/app/views/account/show.rhtml | 2 +- redmine/app/views/my/account.rhtml | 3 +++ redmine/db/migrate/009_add_hide_mail_pref.rb | 9 +++++++++ redmine/lang/de.yml | 1 + redmine/lang/en.yml | 1 + redmine/lang/es.yml | 1 + redmine/lang/fr.yml | 1 + 8 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 redmine/db/migrate/009_add_hide_mail_pref.rb diff --git a/redmine/app/controllers/my_controller.rb b/redmine/app/controllers/my_controller.rb index 25f362df2..ff12b74d7 100644 --- a/redmine/app/controllers/my_controller.rb +++ b/redmine/app/controllers/my_controller.rb @@ -44,7 +44,10 @@ class MyController < ApplicationController # Edit user's account def account @user = self.logged_in_user - if request.post? and @user.update_attributes(@params[:user]) + @pref = @user.pref + @user.attributes = params[:user] + @user.pref.attributes = params[:pref] + if request.post? and @user.save set_localization flash.now[:notice] = l(:notice_account_updated) self.logged_in_user.reload diff --git a/redmine/app/views/account/show.rhtml b/redmine/app/views/account/show.rhtml index 4fa306764..985238951 100644 --- a/redmine/app/views/account/show.rhtml +++ b/redmine/app/views/account/show.rhtml @@ -1,7 +1,7 @@

<%= @user.display_name %>

-<%= mail_to @user.mail %> +<%= mail_to @user.mail unless @user.pref.hide_mail %>