aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2009-04-23 14:56:10 -0400
committerJoey Hess <joey@gnu.kitenet.net>2009-04-23 14:56:10 -0400
commit527d178c12141d2467dfa86492e249d021b88997 (patch)
tree1be3a5172a304ec64928638f74ae21e26db7f3ae
parent748aa7af777caaa32ac5ab56e707509b3739b49e (diff)
downloadikiwiki-527d178c12141d2467dfa86492e249d021b88997.tar
ikiwiki-527d178c12141d2467dfa86492e249d021b88997.tar.gz
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.
-rw-r--r--IkiWiki/Plugin/comments.pm7
-rw-r--r--debian/changelog3
-rw-r--r--po/ikiwiki.pot26
-rw-r--r--templates/editcomment.tmpl5
4 files changed, 27 insertions, 14 deletions
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');
diff --git a/debian/changelog b/debian/changelog
index f8378f098..de4ac4a8c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -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
diff --git a/po/ikiwiki.pot b/po/ikiwiki.pot
index 6c9b16289..254bf83be 100644
--- a/po/ikiwiki.pot
+++ b/po/ikiwiki.pot
@@ -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 ""
diff --git a/templates/editcomment.tmpl b/templates/editcomment.tmpl
index 7590cdfd7..27d9457d4 100644
--- a/templates/editcomment.tmpl
+++ b/templates/editcomment.tmpl
@@ -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 />