]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/comments.pm
calendar: Display year name in title of month calendar.
[ikiwiki.git] / IkiWiki / Plugin / comments.pm
index 5d7176a8c7a4da8f90f01e026b660e1c4ff571bb..3cafcbe9c6860dbfb95087da454bf364617f1292 100644 (file)
@@ -262,6 +262,10 @@ sub sessioncgi ($$) {
        elsif ($do eq 'commentmoderation') {
                commentmoderation($cgi, $session);
        }
+       elsif ($do eq 'commentsignin') {
+               IkiWiki::cgi_signin($cgi, $session);
+               exit;
+       }
 }
 
 # Mostly cargo-culted from IkiWiki::plugin::editpage
@@ -339,7 +343,7 @@ sub editcomment ($$) {
 
        if (! defined $session->param('name')) {
                # Make signinurl work and return here.
-               $form->tmpl_param(signinurl => IkiWiki::cgiurl(do => 'signin'));
+               $form->tmpl_param(signinurl => IkiWiki::cgiurl(do => 'commentsignin'));
                $session->param(postsignin => $ENV{QUERY_STRING});
                IkiWiki::cgi_savesession($session);
        }
@@ -904,28 +908,30 @@ sub match_comment ($$;@) {
        my $page = shift;
        my $glob = shift;
 
-       my $match=match_glob($page, "$glob/*", internal => 1, @_);
-       if ($match && exists $IkiWiki::pagesources{$page}) {
-               my $type=IkiWiki::pagetype($IkiWiki::pagesources{$page});
-               if (defined $type && $type ne "_comment") {
-                       return IkiWiki::FailReason->new("$page is not a comment");
-               }
+       if (! IkiWiki::isinternal($page)) {
+               return IkiWiki::FailReason->new("$page is not a comment");
        }
-       return $match;
+       my $type=IkiWiki::pagetype($IkiWiki::pagesources{$page});
+       if (defined $type && $type ne "_comment") {
+               return IkiWiki::FailReason->new("$page is not a comment");
+       }
+
+       return match_glob($page, "$glob/*", internal => 1, @_);
 }
 
 sub match_comment_pending ($$;@) {
        my $page = shift;
        my $glob = shift;
-
-       my $match=match_glob($page, "$glob/*", internal => 1, @_);
-       if ($match && $IkiWiki::pagesources{$page}) {
-               my $type=IkiWiki::pagetype($IkiWiki::pagesources{$page});
-               if (defined $type && $type ne "_comment_pending") {
-                       return IkiWiki::FailReason->new("$page is not a pending comment");
-               }
+       
+       if (! IkiWiki::isinternal($page)) {
+               return IkiWiki::FailReason->new("$page is not a pending comment");
        }
-       return $match;
+       my $type=IkiWiki::pagetype($IkiWiki::pagesources{$page});
+       if (defined $type && $type ne "_comment_pending") {
+               return IkiWiki::FailReason->new("$page is not a pending comment");
+       }
+
+       return match_glob($page, "$glob/*", internal => 1, @_);
 }
 
 1