Added the ability to reset its own RSS access key on "My account".

git-svn-id: http://redmine.rubyforge.org/svn/trunk@677 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2007-08-29 20:07:28 +00:00
parent 317b460d96
commit 39c9874a41
14 changed files with 66 additions and 17 deletions
+12 -4
View File
@@ -52,10 +52,9 @@ class MyController < ApplicationController
@pref = @user.pref
@user.attributes = params[:user]
@user.pref.attributes = params[:pref]
if request.post? and @user.save and @user.pref.save
set_localization
flash.now[:notice] = l(:notice_account_updated)
self.logged_in_user.reload
if request.post? && @user.save && @user.pref.save
flash[:notice] = l(:notice_account_updated)
redirect_to :action => 'account'
end
end
@@ -76,6 +75,15 @@ class MyController < ApplicationController
end
redirect_to :action => 'account'
end
# Create a new feeds key
def reset_rss_key
if request.post? && User.current.rss_token
User.current.rss_token.destroy
flash[:notice] = l(:notice_feeds_access_key_reseted)
end
redirect_to :action => 'account'
end
# User's page layout configuration
def page_layout