From b30c1b0c38bc8e6730a76135e6bff695d0f778c2 Mon Sep 17 00:00:00 2001
From: Joey Hess <joey@gnu.kitenet.net>
Date: Thu, 26 Feb 2009 02:31:13 -0500
Subject: [PATCH] comments: Avoid showing comment moderation button in prefs to
 non-admins.

---
 IkiWiki/Plugin/comments.pm | 3 ++-
 debian/changelog           | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm
index 3cdffe856..ee53dbc91 100644
--- a/IkiWiki/Plugin/comments.pm
+++ b/IkiWiki/Plugin/comments.pm
@@ -605,7 +605,8 @@ sub formbuilder_setup (@) {
 	my %params=@_;
 
 	my $form=$params{form};
-	if ($form->title eq "preferences") {
+	if ($form->title eq "preferences" &&
+	    IkiWiki::is_admin($params{session}->param("name"))) {
 		push @{$params{buttons}}, "Comment Moderation";
 		if ($form->submitted && $form->submitted eq "Comment Moderation") {
 			commentmoderation($params{cgi}, $params{session});
diff --git a/debian/changelog b/debian/changelog
index ac7e2f21d..68d08ad8e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -11,6 +11,7 @@ ikiwiki (3.05) UNRELEASED; urgency=low
   * Updated German translation (Kai Wasserbäch). Closes: #516770
   * Setup automator: Prompt for password twice. Closes: #516973
   * bzr: Add missing stub rcs_diff.
+  * comments: Avoid showing comment moderation button in prefs to non-admins.
 
  -- Joey Hess <joeyh@debian.org>  Sun, 15 Feb 2009 20:11:57 -0500
 
-- 
2.39.5