diff app/controllers/my_controller.rb @ 117:af80e5618e9b redmine-1.1

* Update to Redmine 1.1-stable branch (Redmine SVN rev 4707)
author Chris Cannam
date Thu, 13 Jan 2011 12:53:21 +0000
parents 94944d00e43c
children 73ff0e6a11b1 cbb26bc654de
line wrap: on
line diff
--- a/app/controllers/my_controller.rb	Fri Nov 19 14:05:24 2010 +0000
+++ b/app/controllers/my_controller.rb	Thu Jan 13 12:53:21 2011 +0000
@@ -19,6 +19,7 @@
   before_filter :require_login
 
   helper :issues
+  helper :users
   helper :custom_fields
 
   BLOCKS = { 'issuesassignedtome' => :label_assigned_to_me_issues,
@@ -53,21 +54,18 @@
     @user = User.current
     @pref = @user.pref
     if request.post?
-      @user.attributes = params[:user]
-      @user.mail_notification = params[:notification_option] || 'only_my_events'
+      @user.safe_attributes = params[:user]
       @user.pref.attributes = params[:pref]
       @user.pref[:no_self_notified] = (params[:no_self_notified] == '1')
       if @user.save
         @user.pref.save
-        @user.notified_project_ids = (params[:notification_option] == 'selected' ? params[:notified_project_ids] : [])
+        @user.notified_project_ids = (@user.mail_notification == 'selected' ? params[:notified_project_ids] : [])
         set_language_if_valid @user.language
         flash[:notice] = l(:notice_account_updated)
         redirect_to :action => 'account'
         return
       end
     end
-    @notification_options = @user.valid_notification_options
-    @notification_option = @user.mail_notification #? ? 'all' : (@user.notified_projects_ids.empty? ? 'none' : 'selected')    
   end
 
   # Manage user's password