diff options
author | Jan UrbaĆski | 2009-11-26 13:34:15 +0000 |
---|---|---|
committer | Robert Haas | 2009-11-26 13:35:30 +0000 |
commit | c7a94d40a473938a29609ab80484881b5e553935 (patch) | |
tree | 0a935f74080963413d08c3a204b60300279ee999 /perl-lib | |
parent | 148682adfa1bc959390319abad74dd5c1d948ff1 (diff) |
Always go back to the page you were on after logging in.
Diffstat (limited to 'perl-lib')
-rw-r--r-- | perl-lib/PgCommitFest/Request.pm | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/perl-lib/PgCommitFest/Request.pm b/perl-lib/PgCommitFest/Request.pm index a12ab4a..dc75d92 100644 --- a/perl-lib/PgCommitFest/Request.pm +++ b/perl-lib/PgCommitFest/Request.pm @@ -199,6 +199,17 @@ sub render_template { # 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'}; @@ -209,6 +220,7 @@ sub render_template { '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(); |