avid unnecessary cookies
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Sun, 12 Mar 2006 04:10:52 +0000 (04:10 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Sun, 12 Mar 2006 04:10:52 +0000 (04:10 +0000)
ikiwiki

diff --git a/ikiwiki b/ikiwiki
index a3bf09d3b4b7da6a318961fa9890b614dc56fd8c..ca79d3b7eb13c27b5f17ec186034eafce6507d50 100755 (executable)
--- a/ikiwiki
+++ b/ikiwiki
@@ -777,23 +777,26 @@ sub cgi () { #{{{
        eval q{use CGI::Session};
        
        my $q=CGI->new;
        eval q{use CGI::Session};
        
        my $q=CGI->new;
-       # session id has to be _sessionid for CGI::FormBuilder to work.
-       # TODO: stop having the formbuilder emit cookies and change session
-       # id to something else.
-       CGI::Session->name("_sessionid");
-       my $session = CGI::Session->new(undef, $q,
-               { Directory=> "$srcdir/.ikiwiki/sessions" });
        
        my $do=$q->param('do');
        if (! defined $do || ! length $do) {
                error("\"do\" parameter missing");
        }
        
        
        my $do=$q->param('do');
        if (! defined $do || ! length $do) {
                error("\"do\" parameter missing");
        }
        
+       # This does not need a session.
        if ($do eq 'recentchanges') {
                cgi_recentchanges($q);
                return;
        }
        
        if ($do eq 'recentchanges') {
                cgi_recentchanges($q);
                return;
        }
        
+       # session id has to be _sessionid for CGI::FormBuilder to work.
+       # TODO: stop having the formbuilder emit cookies and change session
+       # id to something else.
+       CGI::Session->name("_sessionid");
+       my $session = CGI::Session->new(undef, $q,
+               { Directory=> "$srcdir/.ikiwiki/sessions" });
+       
+       # Everything below this point needs the user to be signed in.
        if ((! $anonok && ! defined $session->param("name")) || $do eq 'signin') {
                cgi_signin($q, $session);
                return;
        if ((! $anonok && ! defined $session->param("name")) || $do eq 'signin') {
                cgi_signin($q, $session);
                return;