]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
save whole form state, not just QUERY_STRING, for postsignin
authorJoey Hess <joey@kitenet.net>
Sun, 8 Apr 2012 18:12:02 +0000 (14:12 -0400)
committerJoey Hess <joey@kitenet.net>
Sun, 8 Apr 2012 18:14:33 +0000 (14:14 -0400)
Normally, needsignin is called when there is a QUERY_STRING, not when a
form is posted. However, it's certianly possible, and should be supported,
to make a form that invokes an ikiwiki action that checks needsignin.

I encountered this when posting ?do=rename&page=foo. The form is displayed
without checking needsignin, for complicated reasons. Posting the form
is when the true authentication happens.

IkiWiki/CGI.pm

index 62383b6fd22cf3ca6bed2dc3571f5cafb3c10715..5baa6c1798ef02e1f45680daa032da17674fafb0 100644 (file)
@@ -131,7 +131,7 @@ sub needsignin ($$) {
 
        if (! defined $session->param("name") ||
            ! userinfo_get($session->param("name"), "regdate")) {
 
        if (! defined $session->param("name") ||
            ! userinfo_get($session->param("name"), "regdate")) {
-               $session->param(postsignin => $ENV{QUERY_STRING});
+               $session->param(postsignin => $q->query_string);
                cgi_signin($q, $session);
                cgi_savesession($session);
                exit;
                cgi_signin($q, $session);
                cgi_savesession($session);
                exit;