Use local paths for the CGI URL

master
Simon McVittie 2010-11-23 00:12:17 +00:00
parent 78c595736e
commit 296e5cb2fd
10 changed files with 13 additions and 13 deletions

View File

@ -301,7 +301,7 @@ sub editcomment ($$) {
required => [qw{editcontent}],
javascript => 0,
params => $cgi,
action => $config{cgiurl},
action => IkiWiki::cgiurl(),
header => 0,
table => 0,
template => { template('editcomment.tmpl') },

View File

@ -75,7 +75,7 @@ sub cgi_editpage ($$) {
required => [qw{editcontent}],
javascript => 0,
params => $q,
action => $config{cgiurl},
action => IkiWiki::cgiurl(),
header => 0,
table => 0,
template => { template("editpage.tmpl") },

View File

@ -300,7 +300,7 @@ sub preprocess_inline (@) {
IkiWiki->can("cgi_editpage")) {
# Add a blog post form, with feed buttons.
my $formtemplate=template_depends("blogpost.tmpl", $params{page}, blind_cache => 1);
$formtemplate->param(cgiurl => $config{cgiurl});
$formtemplate->param(cgiurl => IkiWiki::cgiurl());
$formtemplate->param(rootpage => rootpage(%params));
$formtemplate->param(rssurl => $rssurl) if $feeds && $rss;
$formtemplate->param(atomurl => $atomurl) if $feeds && $atom;

View File

@ -77,7 +77,7 @@ sub openid_selector {
my $template=IkiWiki::template("openid-selector.tmpl");
$template->param(
cgiurl => $config{cgiurl},
cgiurl => IkiWiki::cgiurl(),
(defined $openid_error ? (openid_error => $openid_error) : ()),
(defined $openid_url ? (openid_url => $openid_url) : ()),
($real_cgi_signin ? (nonopenidform => $real_cgi_signin->($q, $session, 1)) : ()),
@ -148,7 +148,7 @@ sub validate ($$$;$) {
}
my $cgiurl=$config{openid_cgiurl};
$cgiurl=$config{cgiurl} if ! defined $cgiurl;
$cgiurl=IkiWiki::cgiurl() if ! defined $cgiurl;
my $trust_root=$config{openid_realm};
$trust_root=$cgiurl if ! defined $trust_root;
@ -249,7 +249,7 @@ sub getobj ($$) {
}
my $cgiurl=$config{openid_cgiurl};
$cgiurl=$config{cgiurl} if ! defined $cgiurl;
$cgiurl=IkiWiki::cgiurl() if ! defined $cgiurl;
return Net::OpenID::Consumer->new(
ua => $ua,

View File

@ -52,7 +52,7 @@ sub preprocess (@) {
foreach my $choice (@choices) {
if ($open && exists $config{cgiurl}) {
# use POST to avoid robots
$ret.="<form method=\"POST\" action=\"$config{cgiurl}\">\n";
$ret.="<form method=\"POST\" action=\"".IkiWiki::cgiurl()."\">\n";
}
my $percent=$total > 0 ? int($choices{$choice} / $total * 100) : 0;
$ret.="<p>\n";

View File

@ -84,7 +84,7 @@ sub sessioncgi ($$) {
method => 'POST',
javascript => 0,
params => $q,
action => $config{cgiurl},
action => IkiWiki::cgiurl(),
stylesheet => 1,
template => { template('revert.tmpl') },
fields => [qw{revertmessage do sid rev}],

View File

@ -100,7 +100,7 @@ sub confirmation_form ($$) {
method => 'POST',
javascript => 0,
params => $q,
action => $config{cgiurl},
action => IkiWiki::cgiurl(),
stylesheet => 1,
fields => [qw{do page}],
);

View File

@ -126,7 +126,7 @@ sub rename_form ($$$) {
method => 'POST',
javascript => 0,
params => $q,
action => $config{cgiurl},
action => IkiWiki::cgiurl(),
stylesheet => 1,
fields => [qw{do page new_name attachment}],
);

View File

@ -58,7 +58,7 @@ sub pagetemplate (@) {
if ($template->query(name => "searchform")) {
if (! defined $form) {
my $searchform = template("searchform.tmpl", blind_cache => 1);
$searchform->param(searchaction => $config{cgiurl});
$searchform->param(searchaction => IkiWiki::cgiurl());
$searchform->param(html5 => $config{html5});
$form=$searchform->output;
}
@ -176,7 +176,7 @@ sub cgi ($) {
# only works for GET requests
chdir("$config{wikistatedir}/xapian") || error("chdir: $!");
$ENV{OMEGA_CONFIG_FILE}="./omega.conf";
$ENV{CGIURL}=$config{cgiurl},
$ENV{CGIURL}=IkiWiki::cgiurl();
IkiWiki::loadindex();
$ENV{HELPLINK}=htmllink("", "", "ikiwiki/searching",
noimageinline => 1, linktext => "Help");

View File

@ -288,7 +288,7 @@ sub showform ($$) {
fieldsets => [
[main => gettext("main")],
],
action => $config{cgiurl},
action => IkiWiki::cgiurl(),
template => {type => 'div'},
stylesheet => 1,
);