X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/c8b34aa31c7d146adf4210c6171dfea2988a7688..fbb354d70e292cbf6e99e86bb4dd4416b02b67e4:/IkiWiki/CGI.pm diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm index 28020b500..ede194ff9 100644 --- a/IkiWiki/CGI.pm +++ b/IkiWiki/CGI.pm @@ -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) { @@ -283,7 +283,7 @@ sub check_banned ($$) { foreach my $b (@{$config{banned_users}}) { if (pagespec_match("", $b, - ip => $ENV{REMOTE_ADDR}, + ip => $session->remote_addr(), name => defined $name ? $name : "", )) { $banned=1;