diff app/controllers/.svn/text-base/my_controller.rb.svn-base @ 511:107d36338b70 live

Merge from branch "cannam"
author Chris Cannam
date Thu, 14 Jul 2011 10:43:07 +0100
parents af80e5618e9b
children
line wrap: on
line diff
--- a/app/controllers/.svn/text-base/my_controller.rb.svn-base	Thu Jun 09 16:51:06 2011 +0100
+++ b/app/controllers/.svn/text-base/my_controller.rb.svn-base	Thu Jul 14 10:43:07 2011 +0100
@@ -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