[Jifty-commit] r2127 - in jifty/trunk/plugins/Login:
lib/Jifty/Plugin/Login lib/Jifty/Plugin/Login/Action
lib/Jifty/Plugin/Login/Notification share/po share/web/templates
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Fri Nov 10 17:13:46 EST 2006
Author: yves
Date: Fri Nov 10 17:13:45 2006
New Revision: 2127
Added:
jifty/trunk/plugins/Login/lib/Jifty/Plugin/Login/Notification/ConfirmLostPassword.pm
jifty/trunk/plugins/Login/share/web/templates/let/reset_lost_password
jifty/trunk/plugins/Login/share/web/templates/passwordreminder
Modified:
jifty/trunk/plugins/Login/lib/Jifty/Plugin/Login/Action/ResetLostPassword.pm
jifty/trunk/plugins/Login/lib/Jifty/Plugin/Login/Dispatcher.pm
jifty/trunk/plugins/Login/share/po/en.po
jifty/trunk/plugins/Login/share/po/fr.po
Log:
Login plugin : Add missing Notification::ConfirmLostPassword,
dispatcher for passwordreminder,
let to reset lost password
Modified: jifty/trunk/plugins/Login/lib/Jifty/Plugin/Login/Action/ResetLostPassword.pm
==============================================================================
--- jifty/trunk/plugins/Login/lib/Jifty/Plugin/Login/Action/ResetLostPassword.pm (original)
+++ jifty/trunk/plugins/Login/lib/Jifty/Plugin/Login/Action/ResetLostPassword.pm Fri Nov 10 17:13:45 2006
@@ -26,7 +26,11 @@
sub arguments {
return (
{
- password => { type => 'password', sticky => 0 },
+ password => {
+ type => 'password',
+ sticky => 0,
+ label => _('Password')
+ },
password_confirm => {
type => 'password',
sticky => 0,
Modified: jifty/trunk/plugins/Login/lib/Jifty/Plugin/Login/Dispatcher.pm
==============================================================================
--- jifty/trunk/plugins/Login/lib/Jifty/Plugin/Login/Dispatcher.pm (original)
+++ jifty/trunk/plugins/Login/lib/Jifty/Plugin/Login/Dispatcher.pm Fri Nov 10 17:13:45 2006
@@ -6,6 +6,22 @@
# Put any plugin-specific dispatcher rules here.
+# Send a password reminder for a lost password
+on 'passwordreminder' => run {
+ redirect('/') if ( Jifty->web->current_user->id );
+ set 'action' =>
+ Jifty->web->new_action(
+ class => 'SendPasswordReminder',
+ moniker => 'password_reminder'
+ );
+
+ set 'next' => Jifty->web->request->continuation
+ || Jifty::Continuation->new(
+ request => Jifty::Request->new( path => "/" ) );
+
+};
+
+# Change a password
on 'chgpasswd' => run {
redirect('/login') if (! Jifty->web->current_user->id );
set 'action' =>
Added: jifty/trunk/plugins/Login/lib/Jifty/Plugin/Login/Notification/ConfirmLostPassword.pm
==============================================================================
--- (empty file)
+++ jifty/trunk/plugins/Login/lib/Jifty/Plugin/Login/Notification/ConfirmLostPassword.pm Fri Nov 10 17:13:45 2006
@@ -0,0 +1,55 @@
+use warnings;
+use strict;
+
+package Jifty::Plugin::Login::Notification::ConfirmLostPassword;
+use base qw/Jifty::Notification Jifty::Plugin::Login/;
+
+=head1 NAME
+
+Jifty::Plugin::Login::Notification::ConfirmLostPassword
+
+=head1 ARGUMENTS
+
+C<to>, a L<Jifty::Plugin::Login::Model::User> whose address we are confirming.
+
+=cut
+
+=head2 setup
+
+Sets up the fields of the message.
+
+=cut
+
+sub setup {
+ my $self = shift;
+ my $LoginUser = $self->LoginUserClass;
+
+ unless ( UNIVERSAL::isa($self->to, $LoginUser) ){
+ $self->log->error((ref $self) . " called with invalid user argument");
+ return;
+ }
+
+ my $letme = Jifty::LetMe->new();
+ $letme->email($self->to->email);
+ $letme->path('reset_lost_password');
+ my $confirm_url = $letme->as_url;
+ my $appname = Jifty->config->framework('ApplicationName');
+
+ $self->subject( _("Message from ")."$appname!" );
+ $self->from( Jifty->config->framework('AdminEmail') );
+
+ $self->body(_("
+You're getting this message because you (or somebody claiming to be you)
+request to reset your password for %1.
+
+If you don't want to reset your password just ignore this message.
+
+To reset your password, click on the link below:
+
+%2
+",$appname,$confirm_url));
+
+}
+
+1;
+
Modified: jifty/trunk/plugins/Login/share/po/en.po
==============================================================================
--- jifty/trunk/plugins/Login/share/po/en.po (original)
+++ jifty/trunk/plugins/Login/share/po/en.po Fri Nov 10 17:13:45 2006
@@ -15,6 +15,20 @@
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
+#: lib/Jifty/Plugin/Login/Notification/ConfirmLostPassword.pm:41
+#. ($appname,$confirm_url)
+msgid ""
+"\n"
+"You're getting this message because you (or somebody claiming to be you)\n"
+"request to reset your password for %1.\n"
+"\n"
+"If you don't want to reset your password just ignore this message.\n"
+"\n"
+"To reset your password, click on the link below:\n"
+"\n"
+"%2\n"
+msgstr ""
+
#: lib/Jifty/Plugin/Login/Notification/ConfirmAddress.pm:42
#. ($appname,$confirm_url)
msgid ""
@@ -36,10 +50,18 @@
msgid ". Your email address has now been confirmed."
msgstr ""
-#: lib/Jifty/Plugin/Login/Action/SendPasswordReminder.pm:94
+#: lib/Jifty/Plugin/Login/Action/SendPasswordReminder.pm:95
msgid "A link to reset your password has been sent to your email account."
msgstr ""
+#: share/web/templates/chgpasswd:11
+msgid "Change"
+msgstr ""
+
+#: share/web/templates/chgpasswd:6
+msgid "Change your password"
+msgstr ""
+
#: lib/Jifty/Plugin/Login/Action/SendAccountConfirmation.pm:94
msgid "Confirmation resent."
msgstr ""
@@ -56,7 +78,7 @@
msgid "If you want, your browser can remember your login for you"
msgstr ""
-#: lib/Jifty/Plugin/Login/Action/SendAccountConfirmation.pm:74 lib/Jifty/Plugin/Login/Action/SendPasswordReminder.pm:77
+#: lib/Jifty/Plugin/Login/Action/SendAccountConfirmation.pm:74 lib/Jifty/Plugin/Login/Action/SendPasswordReminder.pm:78
msgid "It doesn't look like there's an account by that name."
msgstr ""
@@ -64,7 +86,7 @@
msgid "It looks like you already have an account. Perhaps you want to <a href=\"/login\">sign in</a> instead?"
msgstr ""
-#: lib/Jifty/Plugin/Login/Action/ResetLostPassword.pm:68
+#: lib/Jifty/Plugin/Login/Action/ChangePassword.pm:70 lib/Jifty/Plugin/Login/Action/ResetLostPassword.pm:72
msgid "It looks like you didn't enter the same password into both boxes. Give it another shot?"
msgstr ""
@@ -76,10 +98,18 @@
msgid "Login"
msgstr ""
+#: lib/Jifty/Plugin/Login/Notification/ConfirmLostPassword.pm:38
+msgid "Message from "
+msgstr ""
+
#: lib/Jifty/Plugin/Login/Action/Signup.pm:45
msgid "Name"
msgstr ""
+#: share/web/templates/let/reset_lost_password:16
+msgid "New password"
+msgstr ""
+
#: lib/Jifty/Plugin/Login/Action/Login.pm:66
msgid "No account has that email address."
msgstr ""
@@ -88,7 +118,7 @@
msgid "Ok, you're now logged out. Have a good day."
msgstr ""
-#: lib/Jifty/Plugin/Login/Action/Login.pm:30
+#: lib/Jifty/Plugin/Login/Action/ChangePassword.pm:30 lib/Jifty/Plugin/Login/Action/Login.pm:30 lib/Jifty/Plugin/Login/Action/ResetLostPassword.pm:32
msgid "Password"
msgstr ""
@@ -96,6 +126,18 @@
msgid "Remember me?"
msgstr ""
+#: share/web/templates/let/reset_lost_password:9
+msgid "Reset lost password"
+msgstr ""
+
+#: share/web/templates/passwordreminder:18
+msgid "Send"
+msgstr ""
+
+#: share/web/templates/passwordreminder:9
+msgid "Send a password reminder"
+msgstr ""
+
#: share/web/templates/signup:11 share/web/templates/signup:6
msgid "Signup"
msgstr ""
@@ -104,11 +146,11 @@
msgid "Something bad happened and we couldn't create your account. Try again later. We're really, really sorry."
msgstr ""
-#: lib/Jifty/Plugin/Login/Action/Login.pm:60 lib/Jifty/Plugin/Login/Action/SendAccountConfirmation.pm:67 lib/Jifty/Plugin/Login/Action/SendPasswordReminder.pm:70 lib/Jifty/Plugin/Login/Action/Signup.pm:62
+#: lib/Jifty/Plugin/Login/Action/Login.pm:60 lib/Jifty/Plugin/Login/Action/SendAccountConfirmation.pm:67 lib/Jifty/Plugin/Login/Action/SendPasswordReminder.pm:71 lib/Jifty/Plugin/Login/Action/Signup.pm:62
msgid "That doesn't look like an email address."
msgstr ""
-#: lib/Jifty/Plugin/Login/Action/ResetLostPassword.pm:74
+#: lib/Jifty/Plugin/Login/Action/ChangePassword.pm:76 lib/Jifty/Plugin/Login/Action/ResetLostPassword.pm:78
msgid "There was an error setting your password."
msgstr ""
@@ -124,7 +166,7 @@
msgid "Welcome to "
msgstr ""
-#: lib/Jifty/Plugin/Login/Action/ResetLostPassword.pm:54
+#: lib/Jifty/Plugin/Login/Action/ChangePassword.pm:56 lib/Jifty/Plugin/Login/Action/ResetLostPassword.pm:58
msgid "You don't exist. I'm not sure how this happened. Really, really sorry. Please email us!"
msgstr ""
@@ -136,6 +178,10 @@
msgid "You haven't confirmed your account yet."
msgstr ""
+#: share/web/templates/passwordreminder:10
+msgid "You lost your password. A reminder will be send to the following mail:"
+msgstr ""
+
#: lib/Jifty/Plugin/Login/Action/Login.pm:90
msgid "You may have mistyped your email address or password. Give it another shot?"
msgstr ""
@@ -144,14 +190,18 @@
msgid "You're already logged in."
msgstr ""
-#: lib/Jifty/Plugin/Login/Action/ResetLostPassword.pm:79
+#: lib/Jifty/Plugin/Login/Action/ChangePassword.pm:81
+msgid "Your password has been changed. Welcome back."
+msgstr ""
+
+#: lib/Jifty/Plugin/Login/Action/ResetLostPassword.pm:83
msgid "Your password has been reset. Welcome back."
msgstr ""
-#: lib/Jifty/Plugin/Login/Action/SendAccountConfirmation.pm:31 lib/Jifty/Plugin/Login/Action/SendPasswordReminder.pm:33
+#: lib/Jifty/Plugin/Login/Action/SendAccountConfirmation.pm:31 lib/Jifty/Plugin/Login/Action/SendPasswordReminder.pm:34
msgid "email address"
msgstr ""
-#: lib/Jifty/Plugin/Login/Action/ResetLostPassword.pm:33
+#: lib/Jifty/Plugin/Login/Action/ChangePassword.pm:35 lib/Jifty/Plugin/Login/Action/ResetLostPassword.pm:37
msgid "type your password again"
msgstr ""
Modified: jifty/trunk/plugins/Login/share/po/fr.po
==============================================================================
--- jifty/trunk/plugins/Login/share/po/fr.po (original)
+++ jifty/trunk/plugins/Login/share/po/fr.po Fri Nov 10 17:13:45 2006
@@ -8,13 +8,36 @@
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2006-10-24 15:00+ZONE\n"
-"PO-Revision-Date: 2006-11-10 10:47+ZONE\n"
+"PO-Revision-Date: 2006-11-10 22:42+ZONE\n"
"Last-Translator: AGOSTINI Yves <agostini at univ-metz.fr>\n"
"Language-Team: LANGUAGE <LL at li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=ISO8859-1\n"
"Content-Transfer-Encoding: 8bit\n"
+#: lib/Jifty/Plugin/Login/Notification/ConfirmLostPassword.pm:41
+#. ($appname,$confirm_url)
+msgid ""
+"\n"
+"You're getting this message because you (or somebody claiming to be you)\n"
+"request to reset your password for %1.\n"
+"\n"
+"If you don't want to reset your password just ignore this message.\n"
+"\n"
+"To reset your password, click on the link below:\n"
+"\n"
+"%2\n"
+msgstr ""
+"\n"
+"Vous recevez ce message, parce que quelqu'un demande un nouveau mot de\n"
+"passe pour l'application %1.\n"
+"\n"
+"Si cela ne vous convient pas, ignorez tout simplement ce message.\n"
+"\n"
+"Pour changer votre mot de passe cliquez sur le lien ci-dessous :\n"
+"\n"
+"%2\n"
+
#: lib/Jifty/Plugin/Login/Notification/ConfirmAddress.pm:42
#. ($appname,$confirm_url)
msgid ""
@@ -79,7 +102,7 @@
msgid "It looks like you already have an account. Perhaps you want to <a href=\"/login\">sign in</a> instead?"
msgstr "Vous semblez avoir déjà un compte. Vous désirez peut-être plutôt vous <a href=\"/login\">identifier</a> ?"
-#: lib/Jifty/Plugin/Login/Action/ChangePassword.pm:70 lib/Jifty/Plugin/Login/Action/ResetLostPassword.pm:68
+#: lib/Jifty/Plugin/Login/Action/ChangePassword.pm:70 lib/Jifty/Plugin/Login/Action/ResetLostPassword.pm:72
msgid "It looks like you didn't enter the same password into both boxes. Give it another shot?"
msgstr "Les mots de passe semblent différents. Ré-essayer ?"
@@ -91,10 +114,18 @@
msgid "Login"
msgstr "Identification"
+#: lib/Jifty/Plugin/Login/Notification/ConfirmLostPassword.pm:38
+msgid "Message from "
+msgstr "Message de "
+
#: lib/Jifty/Plugin/Login/Action/Signup.pm:45
msgid "Name"
msgstr "Nom"
+#: share/web/templates/let/reset_lost_password:16
+msgid "New password"
+msgstr "Enregistrer"
+
#: lib/Jifty/Plugin/Login/Action/Login.pm:66
msgid "No account has that email address."
msgstr "Aucun compte n'a cette adresse mail."
@@ -103,7 +134,7 @@
msgid "Ok, you're now logged out. Have a good day."
msgstr "Vous êtes déconnecté. Au revoir."
-#: lib/Jifty/Plugin/Login/Action/ChangePassword.pm:30 lib/Jifty/Plugin/Login/Action/Login.pm:30
+#: lib/Jifty/Plugin/Login/Action/ChangePassword.pm:30 lib/Jifty/Plugin/Login/Action/Login.pm:30 lib/Jifty/Plugin/Login/Action/ResetLostPassword.pm:32
msgid "Password"
msgstr "Mot de passe"
@@ -111,6 +142,18 @@
msgid "Remember me?"
msgstr "S'en rappeller ?"
+#: share/web/templates/let/reset_lost_password:9
+msgid "Reset lost password"
+msgstr "Nouveau mot de passe"
+
+#: share/web/templates/passwordreminder:18
+msgid "Send"
+msgstr "Envoyer"
+
+#: share/web/templates/passwordreminder:9
+msgid "Send a password reminder"
+msgstr "Recevoir un nouveau mot de passe"
+
#: share/web/templates/signup:11 share/web/templates/signup:6
msgid "Signup"
msgstr "S'enregistrer"
@@ -123,7 +166,7 @@
msgid "That doesn't look like an email address."
msgstr "Cela ne ressemble pas à une adresse mail."
-#: lib/Jifty/Plugin/Login/Action/ChangePassword.pm:76 lib/Jifty/Plugin/Login/Action/ResetLostPassword.pm:74
+#: lib/Jifty/Plugin/Login/Action/ChangePassword.pm:76 lib/Jifty/Plugin/Login/Action/ResetLostPassword.pm:78
msgid "There was an error setting your password."
msgstr "Erreur lors de la création de votre mot de passe."
@@ -139,7 +182,7 @@
msgid "Welcome to "
msgstr "Bienvenue sur "
-#: lib/Jifty/Plugin/Login/Action/ChangePassword.pm:56 lib/Jifty/Plugin/Login/Action/ResetLostPassword.pm:54
+#: lib/Jifty/Plugin/Login/Action/ChangePassword.pm:56 lib/Jifty/Plugin/Login/Action/ResetLostPassword.pm:58
msgid "You don't exist. I'm not sure how this happened. Really, really sorry. Please email us!"
msgstr "Vous n'existez pas !!!"
@@ -151,6 +194,10 @@
msgid "You haven't confirmed your account yet."
msgstr "Vous n'avez pas encore confirmé votre compte."
+#: share/web/templates/passwordreminder:10
+msgid "You lost your password. A reminder will be send to the following mail:"
+msgstr "Vous avez perdu votre mot de passe. Un message d'assistance peut vous être re-transmis à votre mail d'origine :"
+
#: lib/Jifty/Plugin/Login/Action/Login.pm:90
msgid "You may have mistyped your email address or password. Give it another shot?"
msgstr "Erreur dans votre mail ou votre mot de passe. Ré-essayer ?"
@@ -163,7 +210,7 @@
msgid "Your password has been changed. Welcome back."
msgstr ""
-#: lib/Jifty/Plugin/Login/Action/ResetLostPassword.pm:79
+#: lib/Jifty/Plugin/Login/Action/ResetLostPassword.pm:83
msgid "Your password has been reset. Welcome back."
msgstr "Votre mot de passe a été ré-initialisé. Bon retour."
@@ -171,6 +218,6 @@
msgid "email address"
msgstr "adresse mail"
-#: lib/Jifty/Plugin/Login/Action/ChangePassword.pm:35 lib/Jifty/Plugin/Login/Action/ResetLostPassword.pm:33
+#: lib/Jifty/Plugin/Login/Action/ChangePassword.pm:35 lib/Jifty/Plugin/Login/Action/ResetLostPassword.pm:37
msgid "type your password again"
msgstr "confirmez votre mot de passe"
Added: jifty/trunk/plugins/Login/share/web/templates/let/reset_lost_password
==============================================================================
--- (empty file)
+++ jifty/trunk/plugins/Login/share/web/templates/let/reset_lost_password Fri Nov 10 17:13:45 2006
@@ -0,0 +1,21 @@
+<%init>
+my $action = Jifty->web->new_action(
+ moniker => 'reset_lost_password',
+ class => 'ResetLostPassword',
+);
+</%init>
+<&|/_elements/wrapper, title => 'Reset lost password' &>
+
+<H2><% _('Reset lost password') %></H2>
+<% Jifty->web->form->start %>
+
+% for ($action->argument_names) {
+<% $action->form_field($_) %>
+% }
+
+<% Jifty->web->form->submit( label => _("New password") ) %>
+
+<% Jifty->web->form->end %>
+
+</&>
+
Added: jifty/trunk/plugins/Login/share/web/templates/passwordreminder
==============================================================================
--- (empty file)
+++ jifty/trunk/plugins/Login/share/web/templates/passwordreminder Fri Nov 10 17:13:45 2006
@@ -0,0 +1,23 @@
+<%init>
+my $action = Jifty->web->new_action(
+ moniker => 'password_reminder',
+ class => 'SendPasswordReminder',
+);
+</%init>
+<&|/_elements/wrapper, title => 'Send Password Reminder' &>
+
+<H2><% _('Send a password reminder') %></H2>
+<% _("You lost your password. A reminder will be send to the following mail:") %>
+
+<% Jifty->web->form->start %>
+
+% for ($action->argument_names) {
+<% $action->form_field($_) %>
+% }
+
+<% Jifty->web->form->submit( label => _("Send") ) %>
+
+<% Jifty->web->form->end %>
+
+</&>
+
More information about the Jifty-commit
mailing list