]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/CGI.pm
smcv's https fix is actually also applicable to using multiple other urls
[git.ikiwiki.info.git] / IkiWiki / CGI.pm
index f2a32a9581077553d5b542fde40f428c15a5e41a..ede194ff9aee945dc0fb471bedaa47bf93eda829 100644 (file)
@@ -12,7 +12,7 @@ use Encode;
 sub printheader ($) {
        my $session=shift;
        
-       if ($config{sslcookie}) {
+       if ($ENV{HTTPS} || $config{sslcookie}) {
                print $session->header(-charset => 'utf-8',
                        -cookie => $session->cookie(-httponly => 1, -secure => 1));
        }
@@ -116,7 +116,7 @@ sub cgi_signin ($$;$) {
                required => 'NONE',
                javascript => 0,
                params => $q,
-               action => $config{cgiurl},
+               action => cgiurl(),
                header => 0,
                template => {type => 'div'},
                stylesheet => 1,
@@ -198,7 +198,7 @@ sub cgi_prefs ($$) {
                required => 'NONE',
                javascript => 0,
                params => $q,
-               action => $config{cgiurl},
+               action => cgiurl(),
                template => {type => 'div'},
                stylesheet => 1,
                fieldsets => [
@@ -231,11 +231,11 @@ sub cgi_prefs ($$) {
        
        if ($form->submitted eq 'Logout') {
                $session->delete();
-               redirect($q, $config{url});
+               redirect($q, baseurl(undef));
                return;
        }
        elsif ($form->submitted eq 'Cancel') {
-               redirect($q, $config{url});
+               redirect($q, baseurl(undef));
                return;
        }
        elsif ($form->submitted eq 'Save Preferences' && $form->validate) {