# reasonable if we've already begun sending the response back to Apache.
my %stash;
my $content = $self->generate_headers();
+ my $uri = '';
+ if ($ENV{'REQUEST_METHOD'} eq 'GET') {
+ if ($ENV{'SCRIPT_NAME'} ne '/action/login') {
+ my $req = $ENV{'REQUEST_URI'};
+ $req =~ s/[^A-Za-z0-9]/sprintf "%%%x", ord($&)/ge;;
+ $uri = '?uri=' . $req;
+ }
+ else {
+ $uri = '?' . $ENV{'QUERY_STRING'};
+ }
+ }
%stash = %$vars if defined $vars;
$stash{'authenticate'} = $self->authenticate();
$stash{'control'} = $self->{'control'};
'title' => $self->{'title'},
'error_list' => $self->{'error_list'},
'script_name' => $ENV{'SCRIPT_NAME'},
+ 'uri' => $uri,
}, \$content) || die $template->error();
$template->process($file . '.tt2', \%stash, \$content)
|| die $template->error();
</td>
<td id="commitfestNav">
[% IF authenticate.userid.defined %]Welcome, [% authenticate.userid | htmlsafe %] - <a href='/action/logout'>Log Out</a>
- [% ELSE %]<a href='/action/login'>Log In</a>
+ [% ELSE %]<a href='/action/login[% uri %]'>Log In</a>
[% END %]
- <a href='/'>Home Page</a>
</td>