X-Git-Url: http://git.tremily.us/?a=blobdiff_plain;f=IkiWiki%2FPlugin%2Fcomments.pm;h=3cafcbe9c6860dbfb95087da454bf364617f1292;hb=937b24e0cf98d75dd353d80267efddcecab9e908;hp=5d7176a8c7a4da8f90f01e026b660e1c4ff571bb;hpb=fe8f4a77818f835aaaeb3784ca954e9ae96b4709;p=ikiwiki.git diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index 5d7176a8c..3cafcbe9c 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -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