comments: Add link to comment post form to allow user to sign in if they wish to...
authorJoey Hess <joey@gnu.kitenet.net>
Thu, 23 Apr 2009 18:56:10 +0000 (14:56 -0400)
committerJoey Hess <joey@gnu.kitenet.net>
Thu, 23 Apr 2009 18:56:10 +0000 (14:56 -0400)
IkiWiki/Plugin/comments.pm
debian/changelog
po/ikiwiki.pot
templates/editcomment.tmpl

index 98f9f8b3de8ec224b0fa23a033b476e852a700a9..e618d1a90ade4f1a1286e856e1b7ea65cd1fc981 100644 (file)
@@ -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');
index f8378f098bceb1d07651e38ad4b0a3721030fb71..de4ac4a8c33c977540dc724942997f7a2542a951 100644 (file)
@@ -13,6 +13,9 @@ ikiwiki (3.11) UNRELEASED; urgency=low
     error.
   * inline: Display a handy error message if the inline cannot display any
     pages due to such an error.
+  * 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.
 
  -- Joey Hess <joeyh@debian.org>  Tue, 21 Apr 2009 21:41:38 -0400
 
index 6c9b162898ece118fd38ca19f795d8cba9a92044..254bf83be9d890606faf7659b0cc09d28189370a 100644 (file)
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-04-23 14:02-0400\n"
+"POT-Creation-Date: 2009-04-23 14:43-0400\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -212,55 +212,55 @@ msgstr ""
 msgid "Anonymous"
 msgstr ""
 
-#: ../IkiWiki/Plugin/comments.pm:326 ../IkiWiki/Plugin/editpage.pm:97
+#: ../IkiWiki/Plugin/comments.pm:331 ../IkiWiki/Plugin/editpage.pm:97
 msgid "bad page name"
 msgstr ""
 
-#: ../IkiWiki/Plugin/comments.pm:331
+#: ../IkiWiki/Plugin/comments.pm:336
 #, perl-format
 msgid "commenting on %s"
 msgstr ""
 
-#: ../IkiWiki/Plugin/comments.pm:349
+#: ../IkiWiki/Plugin/comments.pm:354
 #, perl-format
 msgid "page '%s' doesn't exist, so you can't comment"
 msgstr ""
 
-#: ../IkiWiki/Plugin/comments.pm:356
+#: ../IkiWiki/Plugin/comments.pm:361
 #, perl-format
 msgid "comments on page '%s' are closed"
 msgstr ""
 
-#: ../IkiWiki/Plugin/comments.pm:450
+#: ../IkiWiki/Plugin/comments.pm:455
 msgid "comment stored for moderation"
 msgstr ""
 
-#: ../IkiWiki/Plugin/comments.pm:452
+#: ../IkiWiki/Plugin/comments.pm:457
 msgid "Your comment will be posted after moderator review"
 msgstr ""
 
-#: ../IkiWiki/Plugin/comments.pm:465
+#: ../IkiWiki/Plugin/comments.pm:470
 msgid "Added a comment"
 msgstr ""
 
-#: ../IkiWiki/Plugin/comments.pm:469
+#: ../IkiWiki/Plugin/comments.pm:474
 #, perl-format
 msgid "Added a comment: %s"
 msgstr ""
 
-#: ../IkiWiki/Plugin/comments.pm:511 ../IkiWiki/Plugin/websetup.pm:236
+#: ../IkiWiki/Plugin/comments.pm:516 ../IkiWiki/Plugin/websetup.pm:236
 msgid "you are not logged in as an admin"
 msgstr ""
 
-#: ../IkiWiki/Plugin/comments.pm:562
+#: ../IkiWiki/Plugin/comments.pm:567
 msgid "Comment moderation"
 msgstr ""
 
-#: ../IkiWiki/Plugin/comments.pm:601
+#: ../IkiWiki/Plugin/comments.pm:606
 msgid "comment moderation"
 msgstr ""
 
-#: ../IkiWiki/Plugin/comments.pm:752
+#: ../IkiWiki/Plugin/comments.pm:757
 msgid "Comments"
 msgstr ""
 
index 7590cdfd7d73c0cbf989fc5a0e82e9ea8b39cad3..27d9457d406a55c56e2dc5abe426791f20c95751 100644 (file)
@@ -6,8 +6,11 @@
 <TMPL_VAR FIELD-PAGE>
 <TMPL_UNLESS NAME=USERNAME>
 <TMPL_IF NAME=ALLOWAUTHOR>
-Name: <TMPL_VAR NAME=FIELD-AUTHOR> (optional)<br />
+Name: <TMPL_VAR NAME=FIELD-AUTHOR> (optional, or
+<a href="<TMPL_VAR SIGNINURL>">Signin</a>)<br />
 Website: <TMPL_VAR NAME=FIELD-URL> (optional)<br />
+<TMPL_ELSE>
+(You might want to <a href="<TMPL_VAR SIGNINURL>">Signin</a> first?)<br />
 </TMPL_IF>
 </TMPL_UNLESS>
 Subject: <TMPL_VAR FIELD-SUBJECT><br />