[vhffs-dev] [1690] Lost password acknowledgment uses TT. |
[ Thread Index |
Date Index
| More vhffs.org/vhffs-dev Archives
]
Revision: 1690
Author: beuss
Date: 2011-05-01 22:26:17 +0200 (Sun, 01 May 2011)
Log Message:
-----------
Lost password acknowledgment uses TT.
Modified Paths:
--------------
trunk/vhffs-panel/lost_ack.pl
trunk/vhffs-panel/templates/Makefile.am
Added Paths:
-----------
trunk/vhffs-panel/templates/anonymous/lost-password-ack.tt
Removed Paths:
-------------
trunk/vhffs-panel/templates/main/lost_failed.tmpl
trunk/vhffs-panel/templates/main/lost_ok.tmpl
Modified: trunk/vhffs-panel/lost_ack.pl
===================================================================
--- trunk/vhffs-panel/lost_ack.pl 2011-05-01 15:27:16 UTC (rev 1689)
+++ trunk/vhffs-panel/lost_ack.pl 2011-05-01 20:26:17 UTC (rev 1690)
@@ -32,7 +32,6 @@
use utf8;
use POSIX qw(locale_h);
-use HTML::Template;
use locale;
use Locale::gettext;
use CGI;
@@ -50,11 +49,9 @@
exit 0 unless $panel;
my $vhffs = $panel->{'vhffs'};
-my $templatedir = $panel->{'templatedir'};
my $cgi = $panel->{'cgi'};
my $username = $cgi->param('username');
my $user = Vhffs::User::get_by_username( $vhffs, $username );
-my $template;
if ( defined $user && $user->{'state'} == Vhffs::Constants::ACTIVATED )
{
@@ -72,20 +69,14 @@
my $content = sprintf("Hello %s %s,\n\nYou asked for a new password, here are your new login information:\nUser: %s\nPassword: %s\n\n%s Administrators\n", $user->get_firstname, $user->get_lastname, $user->get_username, $password , $vhffs->get_config->get_host_name );
$user->send_mail_user( $subject, $content );
- $template = new HTML::Template( filename => $templatedir."/panel/main/lost_ok.tmpl" );
-
- $template->param( TEXT_WAITPASS => sprintf( gettext("Please wait %s, a new password will be sent to you in a few minutes..."), $username ) );
- $template->param( TEXT_LOGIN => gettext("Login") );
+ $panel->render('anonymous/lost-password-ack.tt', {
+ message => sprintf( gettext("Please wait %s, a new password will be sent to you in a few minutes..."), $username )
+ }, 'anonymous.tt');
}
else
{
- #if user is not know by VHFFS, we return an error
- $template = new HTML::Template( filename => $templatedir."/panel/main/lost_failed.tmpl" );
-
- $template->param( TEXT_FAILED => gettext("Password recovery failed!") );
- $template->param( TEXT_LOGIN => gettext("Login") );
+ $panel->render('anonymous/lost-password-ack.tt', {
+ message => gettext("Password recovery failed!"),
+ }, 'anonymous.tt');
}
-
-$panel->light( $template );
-$panel->display;
Modified: trunk/vhffs-panel/templates/Makefile.am
===================================================================
--- trunk/vhffs-panel/templates/Makefile.am 2011-05-01 15:27:16 UTC (rev 1689)
+++ trunk/vhffs-panel/templates/Makefile.am 2011-05-01 20:26:17 UTC (rev 1690)
@@ -90,8 +90,6 @@
menu/context.tmpl \
menu/context-group.tmpl \
menu/context-modo.tmpl \
- main/lost_failed.tmpl \
- main/lost_ok.tmpl \
main/panel.tmpl \
main/main.tmpl \
menu/main.tmpl \
@@ -137,6 +135,7 @@
anonymous/account_created.tt \
anonymous/login.tt \
anonymous/lost-password.tt \
+ anonymous/lost-password-ack.tt \
anonymous/subscribe.tt \
layouts/anonymous.tt \
layouts/panel.tt \
Added: trunk/vhffs-panel/templates/anonymous/lost-password-ack.tt
===================================================================
--- trunk/vhffs-panel/templates/anonymous/lost-password-ack.tt (rev 0)
+++ trunk/vhffs-panel/templates/anonymous/lost-password-ack.tt 2011-05-01 20:26:17 UTC (rev 1690)
@@ -0,0 +1,5 @@
+<div class="logo"></div>
+<div class="misc" id="misc">
+ <h1>[% message %]</h1>
+ <p class="button"><a href="/auth.pl">[% 'Back to login' | i18n | html %]</a></p>
+</div>
Deleted: trunk/vhffs-panel/templates/main/lost_failed.tmpl
===================================================================
--- trunk/vhffs-panel/templates/main/lost_failed.tmpl 2011-05-01 15:27:16 UTC (rev 1689)
+++ trunk/vhffs-panel/templates/main/lost_failed.tmpl 2011-05-01 20:26:17 UTC (rev 1690)
@@ -1,5 +0,0 @@
-<div class="logo"></div>
-<div class="misc" id="misc">
-<h1><TMPL_VAR ESCAPE=1 NAME="TEXT_FAILED"></h1>
-<p class="button"><a href="/auth.pl"><TMPL_VAR ESCAPE=1 NAME="TEXT_LOGIN"></a></p>
-</div>
Deleted: trunk/vhffs-panel/templates/main/lost_ok.tmpl
===================================================================
--- trunk/vhffs-panel/templates/main/lost_ok.tmpl 2011-05-01 15:27:16 UTC (rev 1689)
+++ trunk/vhffs-panel/templates/main/lost_ok.tmpl 2011-05-01 20:26:17 UTC (rev 1690)
@@ -1,5 +0,0 @@
-<div class="logo"></div>
-<div class="misc" id="misc">
-<h1><TMPL_VAR ESCAPE=1 NAME="TEXT_WAITPASS"></h1>
-<p class="button"><a href="/auth.pl"><TMPL_VAR ESCAPE=1 NAME="TEXT_LOGIN"></a></p>
-</div>