From 527d178c12141d2467dfa86492e249d021b88997 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 23 Apr 2009 14:56:10 -0400 Subject: comments: Add link to comment post form to allow user to sign in if they wish to, if the configuration makes signin optional for commenting. --- IkiWiki/Plugin/comments.pm | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index 98f9f8b3d..e618d1a90 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -317,6 +317,13 @@ sub editcomment ($$) { force => 1); } + if (! defined $session->param('name')) { + # Make signinurl work and return here. + $form->tmpl_param(signinurl => IkiWiki::cgiurl(do => 'signin')); + $session->param(postsignin => $ENV{QUERY_STRING}); + IkiWiki::cgi_savesession($session); + } + # The untaint is OK (as in editpage) because we're about to pass # it to file_pruned anyway my $page = $form->field('page'); -- cgit v1.2.3