diff options
author | Yorhel <git@yorhel.nl> | 2015-07-19 02:46:30 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2015-07-19 02:46:30 +0200 |
commit | 903b7b6e680a008cd8c93719a1e7f71f3d1c34b0 (patch) | |
tree | da8f22f39996f82d1ed534005b3c04e7877d9e7a /lib/VNDB/Util | |
parent | f5e7a629a85a3abda0bfe7ee81b8612409377056 (diff) |
Remove reliance on Referer header for the login form
Diffstat (limited to 'lib/VNDB/Util')
-rw-r--r-- | lib/VNDB/Util/LayoutHTML.pm | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/VNDB/Util/LayoutHTML.pm b/lib/VNDB/Util/LayoutHTML.pm index e9cc4c54..5bd55873 100644 --- a/lib/VNDB/Util/LayoutHTML.pm +++ b/lib/VNDB/Util/LayoutHTML.pm @@ -3,8 +3,9 @@ package VNDB::Util::LayoutHTML; use strict; use warnings; -use TUWF ':html'; +use TUWF ':html', 'uri_escape'; use Exporter 'import'; +use Encode 'decode_utf8'; use VNDB::Func; our @EXPORT = qw|htmlHeader htmlFooter|; @@ -114,7 +115,9 @@ sub _menu { } else { h2 mt '_menu_user'; div; - a href => '/u/login', mt '_menu_login'; br; + # XXX: Using %ENV here is ugly, this should be abstracted in TUWF. + my $ref = uri_escape '/'.$self->reqPath().($ENV{QUERY_STRING} ? '?'.decode_utf8($ENV{QUERY_STRING}) : ''); + a href => "/u/login?ref=$ref", mt '_menu_login'; br; a href => '/u/newpass', mt '_menu_newpass'; br; a href => '/u/register', mt '_menu_register'; br; end; |