diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-08-29 20:07:28 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-08-29 20:07:28 +0000 |
commit | 39c9874a41028c7ec5f67207d698947c751d9484 (patch) | |
tree | b45e4b35f8bca53c89ba763dd005729c7497f7d8 /app | |
parent | 317b460d96523c234d2dc2343a9774888c74d44c (diff) | |
download | redmine-39c9874a41028c7ec5f67207d698947c751d9484.tar.gz redmine-39c9874a41028c7ec5f67207d698947c751d9484.zip |
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
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/my_controller.rb | 16 | ||||
-rw-r--r-- | app/views/my/account.rhtml | 9 |
2 files changed, 19 insertions, 6 deletions
diff --git a/app/controllers/my_controller.rb b/app/controllers/my_controller.rb index 1c5a039ea..11aa7f1d0 100644 --- a/app/controllers/my_controller.rb +++ b/app/controllers/my_controller.rb @@ -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 diff --git a/app/views/my/account.rhtml b/app/views/my/account.rhtml index 24f0ef551..c884de841 100644 --- a/app/views/my/account.rhtml +++ b/app/views/my/account.rhtml @@ -1,7 +1,12 @@ <h2><%=l(:label_my_account)%></h2> -<p><%=l(:field_login)%>: <strong><%= @user.login %></strong><br /> -<%=l(:field_created_on)%>: <%= format_time(@user.created_on) %></p> +<p><%=l(:field_login)%>: <strong><%= @user.login %></strong> +<br /><%=l(:field_created_on)%>: <%= format_time(@user.created_on) %> +<% if @user.rss_token %> +<br /><%= l(:label_feeds_access_key_created_on, distance_of_time_in_words(Time.now, @user.rss_token.created_on)) %> +(<%= link_to l(:button_reset), {:action => 'reset_rss_key'}, :method => :post %>) +<% end %> +</p> <%= error_messages_for 'user' %> |