From 39c9874a41028c7ec5f67207d698947c751d9484 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Wed, 29 Aug 2007 20:07:28 +0000 Subject: [PATCH] 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 --- app/controllers/my_controller.rb | 16 ++++++++++++---- app/views/my/account.rhtml | 9 +++++++-- lang/bg.yml | 5 ++++- lang/de.yml | 5 ++++- lang/en.yml | 5 ++++- lang/es.yml | 5 ++++- lang/fr.yml | 3 +++ lang/it.yml | 5 ++++- lang/ja.yml | 5 ++++- lang/nl.yml | 5 ++++- lang/pt-br.yml | 5 ++++- lang/pt.yml | 5 ++++- lang/sv.yml | 5 ++++- lang/zh.yml | 5 ++++- 14 files changed, 66 insertions(+), 17 deletions(-) diff --git a/app/controllers/my_controller.rb b/app/controllers/my_controller.rb index 1c5a039e..11aa7f1d 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 24f0ef55..c884de84 100644 --- a/app/views/my/account.rhtml +++ b/app/views/my/account.rhtml @@ -1,7 +1,12 @@

<%=l(:label_my_account)%>

-

<%=l(:field_login)%>: <%= @user.login %>
-<%=l(:field_created_on)%>: <%= format_time(@user.created_on) %>

+

<%=l(:field_login)%>: <%= @user.login %> +
<%=l(:field_created_on)%>: <%= format_time(@user.created_on) %> +<% if @user.rss_token %> +
<%= 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 %> +

<%= error_messages_for 'user' %> diff --git a/lang/bg.yml b/lang/bg.yml index 9f616532..9286dd63 100644 --- a/lang/bg.yml +++ b/lang/bg.yml @@ -70,7 +70,8 @@ notice_locking_conflict: Друг потребител променя тези notice_scm_error: Несъществуващ обект в склада. notice_not_authorized: Нямате право на достъп до тази страница. notice_email_sent: An email was sent to %s -notice_email_error: An error occurred while sending mail (%s)" +notice_email_error: An error occurred while sending mail (%s) +notice_feeds_access_key_reseted: Your RSS access key was reseted. mail_subject_lost_password: Вашата парола mail_subject_register: Активация на акаунт @@ -411,6 +412,7 @@ label_date_to: To label_language_based: Language based label_sort_by: Sort by "%s" label_send_test_email: Send a test email +label_feeds_access_key_created_on: RSS access key created %s ago button_login: Вход button_submit: Изпращане @@ -442,6 +444,7 @@ button_unwatch: Спри наблюдението button_reply: Reply button_archive: Archive button_unarchive: Unarchive +button_reset: Reset status_active: активен status_registered: регистриран diff --git a/lang/de.yml b/lang/de.yml index da9f7ff8..ed232a14 100644 --- a/lang/de.yml +++ b/lang/de.yml @@ -70,7 +70,8 @@ notice_locking_conflict: Datum wurde von einem anderen Benutzer geändert. notice_scm_error: Eintrag und/oder Revision besteht nicht im Projektarchiv. notice_not_authorized: Sie sind nicht berechtigt auf diese Seite zuzugreifen. notice_email_sent: An email was sent to %s -notice_email_error: An error occurred while sending mail (%s)" +notice_email_error: An error occurred while sending mail (%s) +notice_feeds_access_key_reseted: Your RSS access key was reseted. mail_subject_lost_password: Ihr redMine Kennwort mail_subject_register: redMine Kontoaktivierung @@ -411,6 +412,7 @@ label_date_to: Bis label_language_based: Language based label_sort_by: Sort by "%s" label_send_test_email: Send a test email +label_feeds_access_key_created_on: RSS access key created %s ago button_login: Einloggen button_submit: OK @@ -442,6 +444,7 @@ button_unwatch: Unwatch button_reply: Reply button_archive: Archive button_unarchive: Unarchive +button_reset: Reset status_active: aktiv status_registered: angemeldet diff --git a/lang/en.yml b/lang/en.yml index c7dd0d2e..fb653daf 100644 --- a/lang/en.yml +++ b/lang/en.yml @@ -70,7 +70,8 @@ notice_locking_conflict: Data have been updated by another user. notice_scm_error: Entry and/or revision doesn't exist in the repository. notice_not_authorized: You are not authorized to access this page. notice_email_sent: An email was sent to %s -notice_email_error: An error occurred while sending mail (%s)" +notice_email_error: An error occurred while sending mail (%s) +notice_feeds_access_key_reseted: Your RSS access key was reseted. mail_subject_lost_password: Your redMine password mail_subject_register: redMine account activation @@ -411,6 +412,7 @@ label_date_to: To label_language_based: Language based label_sort_by: Sort by "%s" label_send_test_email: Send a test email +label_feeds_access_key_created_on: RSS access key created %s ago button_login: Login button_submit: Submit @@ -442,6 +444,7 @@ button_unwatch: Unwatch button_reply: Reply button_archive: Archive button_unarchive: Unarchive +button_reset: Reset status_active: active status_registered: registered diff --git a/lang/es.yml b/lang/es.yml index 5bf61df6..4e8fbda6 100644 --- a/lang/es.yml +++ b/lang/es.yml @@ -70,7 +70,8 @@ notice_locking_conflict: Data have been updated by another user. notice_scm_error: La entrada y/o la revisión no existe en el depósito. notice_not_authorized: You are not authorized to access this page. notice_email_sent: An email was sent to %s -notice_email_error: An error occurred while sending mail (%s)" +notice_email_error: An error occurred while sending mail (%s) +notice_feeds_access_key_reseted: Your RSS access key was reseted. mail_subject_lost_password: Tu contraseña del redMine mail_subject_register: Activación de la cuenta del redMine @@ -411,6 +412,7 @@ label_date_to: To label_language_based: Language based label_sort_by: Sort by "%s" label_send_test_email: Send a test email +label_feeds_access_key_created_on: RSS access key created %s ago button_login: Conexión button_submit: Someter @@ -442,6 +444,7 @@ button_unwatch: Unwatch button_reply: Reply button_archive: Archive button_unarchive: Unarchive +button_reset: Reset status_active: active status_registered: registered diff --git a/lang/fr.yml b/lang/fr.yml index ca1fb16b..8ad02db0 100644 --- a/lang/fr.yml +++ b/lang/fr.yml @@ -71,6 +71,7 @@ notice_scm_error: "L'entrée et/ou la révision demandée n'existe pas dans le d notice_not_authorized: "Vous n'êtes pas autorisés à accéder à cette page." notice_email_sent: "Un email a été envoyé à %s" notice_email_error: "Erreur lors de l'envoi de l'email (%s)" +notice_feeds_access_key_reseted: Votre clé d'accès aux flux RSS a été réinitialisée. mail_subject_lost_password: Votre mot de passe redMine mail_subject_register: Activation de votre compte redMine @@ -411,6 +412,7 @@ label_date_to: Au label_language_based: Basé sur la langue label_sort_by: Trier par "%s" label_send_test_email: Envoyer un email de test +label_feeds_access_key_created_on: Clé d'accès RSS créée il y a %s button_login: Connexion button_submit: Soumettre @@ -442,6 +444,7 @@ button_unwatch: Ne plus surveiller button_reply: Répondre button_archive: Archiver button_unarchive: Désarchiver +button_reset: Réinitialiser status_active: actif status_registered: enregistré diff --git a/lang/it.yml b/lang/it.yml index b568873e..92f1b108 100644 --- a/lang/it.yml +++ b/lang/it.yml @@ -70,7 +70,8 @@ notice_locking_conflict: Le informazioni sono state modificate da un altro utent notice_scm_error: La risorsa e/o la versione non esistono nel repository. notice_not_authorized: You are not authorized to access this page. notice_email_sent: An email was sent to %s -notice_email_error: An error occurred while sending mail (%s)" +notice_email_error: An error occurred while sending mail (%s) +notice_feeds_access_key_reseted: Your RSS access key was reseted. mail_subject_lost_password: Password redMine mail_subject_register: Attivazione utenza redMine @@ -411,6 +412,7 @@ label_date_to: To label_language_based: Language based label_sort_by: Sort by "%s" label_send_test_email: Send a test email +label_feeds_access_key_created_on: RSS access key created %s ago button_login: Login button_submit: Invia @@ -442,6 +444,7 @@ button_unwatch: Unwatch button_reply: Reply button_archive: Archive button_unarchive: Unarchive +button_reset: Reset status_active: attivo status_registered: registrato diff --git a/lang/ja.yml b/lang/ja.yml index 87fe5eb3..48b379e9 100644 --- a/lang/ja.yml +++ b/lang/ja.yml @@ -71,7 +71,8 @@ notice_locking_conflict: 別のユーザがデータを更新しています。 notice_scm_error: リポジトリに、エントリ/リビジョンが存在しません。 notice_not_authorized: このページにアクセスするには認証が必要です。 notice_email_sent: An email was sent to %s -notice_email_error: An error occurred while sending mail (%s)" +notice_email_error: An error occurred while sending mail (%s) +notice_feeds_access_key_reseted: Your RSS access key was reseted. mail_subject_lost_password: redMineパスワード mail_subject_register: redMineアカウントが有効になりました @@ -412,6 +413,7 @@ label_date_to: To label_language_based: Language based label_sort_by: Sort by "%s" label_send_test_email: Send a test email +label_feeds_access_key_created_on: RSS access key created %s ago button_login: ログイン button_submit: 変更 @@ -443,6 +445,7 @@ button_unwatch: ウォッチをやめる button_reply: 返答 button_archive: 書庫に保存 button_unarchive: 書庫から戻す +button_reset: Reset status_active: 有効 status_registered: 登録 diff --git a/lang/nl.yml b/lang/nl.yml index b80467ae..994de8cb 100644 --- a/lang/nl.yml +++ b/lang/nl.yml @@ -70,7 +70,8 @@ notice_locking_conflict: De gegevens zijn gewijzigd door een andere gebruiker. notice_scm_error: Deze ingang of revisie bestaat niet in de repository. notice_not_authorized: Het is U niet toegestaan om deze pagina te raadplegen. notice_email_sent: An email was sent to %s -notice_email_error: An error occurred while sending mail (%s)" +notice_email_error: An error occurred while sending mail (%s) +notice_feeds_access_key_reseted: Your RSS access key was reseted. mail_subject_lost_password: Uw redMine wachtwoord mail_subject_register: redMine account activatie @@ -411,6 +412,7 @@ label_date_to: To label_language_based: Language based label_sort_by: Sort by "%s" label_send_test_email: Send a test email +label_feeds_access_key_created_on: RSS access key created %s ago button_login: Inloggen button_submit: Toevoegen @@ -442,6 +444,7 @@ button_unwatch: Niet meer monitoren button_reply: Antwoord button_archive: Archive button_unarchive: Unarchive +button_reset: Reset status_active: Actief status_registered: geregistreerd diff --git a/lang/pt-br.yml b/lang/pt-br.yml index d7ac1ef5..ad0a6f62 100644 --- a/lang/pt-br.yml +++ b/lang/pt-br.yml @@ -70,7 +70,8 @@ notice_locking_conflict: Os dados foram atualizados por um outro usuario. notice_scm_error: A entrada e/ou a revisao nao existem no repositorio. notice_not_authorized: You are not authorized to access this page. notice_email_sent: An email was sent to %s -notice_email_error: An error occurred while sending mail (%s)" +notice_email_error: An error occurred while sending mail (%s) +notice_feeds_access_key_reseted: Your RSS access key was reseted. mail_subject_lost_password: Sua senha do redMine. mail_subject_register: Ativacao de conta do redMine. @@ -411,6 +412,7 @@ label_date_to: To label_language_based: Language based label_sort_by: Sort by "%s" label_send_test_email: Send a test email +label_feeds_access_key_created_on: RSS access key created %s ago button_login: Login button_submit: Enviar @@ -442,6 +444,7 @@ button_unwatch: Unwatch button_reply: Reply button_archive: Archive button_unarchive: Unarchive +button_reset: Reset status_active: ativo status_registered: registrado diff --git a/lang/pt.yml b/lang/pt.yml index b0b2210f..35643a1b 100644 --- a/lang/pt.yml +++ b/lang/pt.yml @@ -70,7 +70,8 @@ notice_locking_conflict: Os dados foram atualizados por um outro usuário. notice_scm_error: A entrada e/ou a revisão não existem no repositório. notice_not_authorized: Você não está autorizado a acessar esta página. notice_email_sent: An email was sent to %s -notice_email_error: An error occurred while sending mail (%s)" +notice_email_error: An error occurred while sending mail (%s) +notice_feeds_access_key_reseted: Your RSS access key was reseted. mail_subject_lost_password: Sua senha do redMine. mail_subject_register: Ativação de conta do redMine. @@ -411,6 +412,7 @@ label_date_to: To label_language_based: Language based label_sort_by: Sort by "%s" label_send_test_email: Send a test email +label_feeds_access_key_created_on: RSS access key created %s ago button_login: Login button_submit: Enviar @@ -442,6 +444,7 @@ button_unwatch: Não observar button_reply: Reply button_archive: Archive button_unarchive: Unarchive +button_reset: Reset status_active: ativo status_registered: registrado diff --git a/lang/sv.yml b/lang/sv.yml index 8b025460..26409606 100644 --- a/lang/sv.yml +++ b/lang/sv.yml @@ -70,7 +70,8 @@ notice_locking_conflict: Data har uppdaterats av en annan användare. notice_scm_error: Inlägg och/eller revision finns inte i repositoriet. notice_not_authorized: You are not authorized to access this page. notice_email_sent: An email was sent to %s -notice_email_error: An error occurred while sending mail (%s)" +notice_email_error: An error occurred while sending mail (%s) +notice_feeds_access_key_reseted: Your RSS access key was reseted. mail_subject_lost_password: Ditt redMine lösenord mail_subject_register: redMine kontoaktivering @@ -411,6 +412,7 @@ label_date_to: To label_language_based: Language based label_sort_by: Sort by "%s" label_send_test_email: Send a test email +label_feeds_access_key_created_on: RSS access key created %s ago button_login: Logga in button_submit: Skicka @@ -442,6 +444,7 @@ button_unwatch: Unwatch button_reply: Reply button_archive: Archive button_unarchive: Unarchive +button_reset: Reset status_active: activ status_registered: registrerad diff --git a/lang/zh.yml b/lang/zh.yml index 7a7ec7b3..10dc4b85 100644 --- a/lang/zh.yml +++ b/lang/zh.yml @@ -73,7 +73,8 @@ notice_locking_conflict: 数据已被另一个用户更新 notice_scm_error: 在版本库中不存在该条目或修订 notice_not_authorized: You are not authorized to access this page. notice_email_sent: An email was sent to %s -notice_email_error: An error occurred while sending mail (%s)" +notice_email_error: An error occurred while sending mail (%s) +notice_feeds_access_key_reseted: Your RSS access key was reseted. mail_subject_lost_password: 您的redMine口令 mail_subject_register: redMine帐户激活 @@ -413,6 +414,7 @@ label_date_to: To label_language_based: Language based label_sort_by: Sort by "%s" label_send_test_email: Send a test email +label_feeds_access_key_created_on: RSS access key created %s ago button_login: 登录 button_submit: 提交 @@ -444,6 +446,7 @@ button_unwatch: Unwatch button_reply: Reply button_archive: Archive button_unarchive: Unarchive +button_reset: Reset status_active: 激活 status_registered: 已注册