From 99ad03d323ee579b8901615cd18f80c39d610b55 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 15 Jan 2013 17:16:07 +0000 Subject: [PATCH] $divert->Message is already translated --- cgi-auth-flexible.pm | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/cgi-auth-flexible.pm b/cgi-auth-flexible.pm index 6ad45b1..61955c9 100644 --- a/cgi-auth-flexible.pm +++ b/cgi-auth-flexible.pm @@ -507,7 +507,7 @@ sub _check_divert_core ($) { $r->_db_revoke($cookh); $r->_db_revoke($parmh); return ({ Kind => 'REDIRECT-LOGGEDOUT', - Message => "Logging out...", + Message => $r->_gt("Logging out..."), CookieSecret => '', Params => { } }); } @@ -516,7 +516,7 @@ sub _check_divert_core ($) { die unless $cookt; die unless $parmt; return ({ Kind => 'SMALLPAGE-LOGGEDOUT', - Message => "You have been logged out.", + Message => $r->_gt("You have been logged out."), CookieSecret => '', Params => { } }); } @@ -525,15 +525,17 @@ sub _check_divert_core ($) { die unless $parmt; if (!$cookt && $parmt eq 't') { return ({ Kind => 'SMALLPAGE-NOCOOKIE', - Message => "You do not seem to have cookies enabled. ". - "You must enable cookies as we use them for login.", + Message => $r->_gt("You do not seem to have cookies". + " enabled. You must enable cookies". + " as we use them for login."), CookieSecret => $r->_fresh_secret(), Params => $r->chain_params() }) } if (!$cookt || $cookt eq 'n' || $cookh ne $parmh) { $r->_db_revoke($cookh); return ({ Kind => 'LOGIN-STALE', - Message => "Stale session; you need to log in again.", + Message => $r->_gt("Stale session;". + " you need to log in again."), CookieSecret => $r->_fresh_secret(), Params => { } }) } @@ -541,13 +543,13 @@ sub _check_divert_core ($) { my $username = $r->_ch('login_ok'); unless (defined $username && length $username) { return ({ Kind => 'LOGIN-BAD', - Message => "Incorrect username/password.", + Message => $r->_gt("Incorrect username/password."), CookieSecret => $cooks, Params => $r->chain_params() }) } $r->_db_record_login_ok($parmh,$username); return ({ Kind => 'REDIRECT-LOGGEDIN', - Message => "Logging in...", + Message => $r->_gt("Logging in..."), CookieSecret => $cooks, Params => $r->chain_params() }); } @@ -567,13 +569,13 @@ sub _check_divert_core ($) { my $news = $r->_fresh_secret(); if ($meth eq 'GET') { return ({ Kind => 'LOGIN-INCOMINGLINK', - Message => "You need to log in.", + Message => $r->_gt("You need to log in."), CookieSecret => $news, Params => $r->chain_params() }); } else { $r->_db_revoke($parmh); return ({ Kind => 'LOGIN-FRESH', - Message => "You need to log in.", + Message => $r->_gt("You need to log in."), CookieSecret => $news, Params => { } }); } @@ -582,7 +584,7 @@ sub _check_divert_core ($) { if (!$r->{S}{promise_check_mutate}) { if ($meth ne 'POST') { return ({ Kind => 'MAINPAGEONLY', - Message => 'Entering via cross-site link.', + Message => $r->_gt('Entering via cross-site link.'), CookieSecret => $cooks, Params => { } }); # NB caller must then ignore params & path! @@ -779,15 +781,15 @@ sub check_ok ($) { my ($title, @body); if ($kind =~ m/^LOGIN-/) { $title = $r->_gt('Login'); - push @body, $r->_gt($divert->{Message}); + push @body, $divert->{Message}; push @body, $r->_ch('gen_login_form', $params); } elsif ($kind =~ m/^SMALLPAGE-/) { $title = $r->_gt('Not logged in'); - push @body, $r->_gt($divert->{Message}); + push @body, $divert->{Message}; push @body, $r->_ch('gen_login_link', $params); } elsif ($kind =~ m/^MAINPAGEONLY$/) { $title = $r->_gt('Entering secure site.'); - push @body, $r->_gt($divert->{Message}); + push @body, $divert->{Message}; push @body, $r->_ch('gen_postmainpage_form', $params); } else { die $kind; -- 2.30.2