passwordauth: Fix url in password recovery email to be absolute.

This got broken when cgiurl began often returning a relative url.
Added a cgiurl_abs for the things that need a guaranteed absolute cgiurl.
master
Joey Hess 2012-04-02 12:24:14 -04:00
parent 1d1ef20034
commit f9e96b0c32
4 changed files with 8 additions and 2 deletions

View File

@ -1092,6 +1092,11 @@ sub cgiurl (@) {
join("&", map $_."=".uri_escape_utf8($params{$_}), keys %params);
}
sub cgiurl_abs (@) {
eval q{use URI};
URI->new_abs(cgiurl(@_), $config{cgiurl});
}
sub baseurl (;$) {
my $page=shift;

View File

@ -127,7 +127,7 @@ sub notify (@) {
$template->param(
wikiname => $config{wikiname},
url => $url,
prefsurl => $config{cgiurl}."?do=prefs",
prefsurl => IkiWiki::cgiurl_abs(do => 'prefs'),
showcontent => $showcontent,
content => $content,
);

View File

@ -296,7 +296,7 @@ sub formbuilder (@) {
my $template=template("passwordmail.tmpl");
$template->param(
user_name => $user_name,
passwordurl => IkiWiki::cgiurl(
passwordurl => IkiWiki::cgiurl_abs(
'do' => "reset",
'name' => $user_name,
'token' => $token,

1
debian/changelog vendored
View File

@ -11,6 +11,7 @@ ikiwiki (3.20120204) UNRELEASED; urgency=low
the old hook name is called for now for back-compat.
* meta: Support keywords header. Closes: #664780
Thanks, Martin Michlmayr
* passwordauth: Fix url in password recovery email to be absolute.
-- Joey Hess <joeyh@debian.org> Wed, 21 Mar 2012 14:33:14 -0400