Use local paths for the CGI URL
authorSimon McVittie <smcv@debian.org>
Tue, 23 Nov 2010 00:12:17 +0000 (00:12 +0000)
committerSimon McVittie <smcv@debian.org>
Tue, 23 Nov 2010 00:12:17 +0000 (00:12 +0000)
IkiWiki/Plugin/comments.pm
IkiWiki/Plugin/editpage.pm
IkiWiki/Plugin/inline.pm
IkiWiki/Plugin/openid.pm
IkiWiki/Plugin/poll.pm
IkiWiki/Plugin/recentchanges.pm
IkiWiki/Plugin/remove.pm
IkiWiki/Plugin/rename.pm
IkiWiki/Plugin/search.pm
IkiWiki/Plugin/websetup.pm

index eefd6574137accdac2a12452dfcb9569b0ce826d..00945b7535ed12cf74f62898a6174e60a19009c9 100644 (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') },
index 8915211d48279ea33f36eeb4739ed1bec99a641d..837bfed13983ea23da1ed8792db435fb7a02c0c1 100644 (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") },
index 1fe40a5eab4235f82c46cbd0499032c84103e091..76527156406159e381164835b4c1dc3015cb346f 100644 (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;
index 3b75c31a255ba9db8ee28d9141cd8e2ab1842446..0220a3cf67e7e78adf83c52ca4dbe09a312fa3cd 100644 (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,
index 988f4c11335a00726a23496be8390bb815a96880..27df104ab6b05da2208b7d2d7155f49946ab4845 100644 (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";
index 562f61d40f3cc4729f5da0f01e3d6b2c4a20660d..3542b222862148a090635ef76807d7d8c50e9311 100644 (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}],
index ab189766302ecb842d8b24e049478bf5328c1507..336a781ed527ae65edca735f336396077ac009ef 100644 (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}],
        );
index ad5e726458cedbbb63a069297372e3bb739fe486..614a4cf5c57eb697e8d13c7fc70b340f257b3be8 100644 (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}],
        );
index 8fb9dff0ca082bb16b6332c052e848408db162b8..78eb750b5f670caabe5840a51f589319eccf1204 100644 (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");
index ef9a93886036d923375630d14134fd3001e16e0e..6a51903016830c17339f2130a964f87708ae15b0 100644 (file)
@@ -288,7 +288,7 @@ sub showform ($$) {
                fieldsets => [
                        [main => gettext("main")], 
                ],
-               action => $config{cgiurl},
+               action => IkiWiki::cgiurl(),
                template => {type => 'div'},
                stylesheet => 1,
        );