comments: Avoid showing comment moderation button in prefs to non-admins.
authorJoey Hess <joey@gnu.kitenet.net>
Thu, 26 Feb 2009 07:31:13 +0000 (02:31 -0500)
committerJoey Hess <joey@gnu.kitenet.net>
Thu, 26 Feb 2009 07:31:13 +0000 (02:31 -0500)
IkiWiki/Plugin/comments.pm
debian/changelog

index 3cdffe856132160df72045d275d6de6d7666631c..ee53dbc91e4e0b6768e36d23705da64a02cf0e1b 100644 (file)
@@ -605,7 +605,8 @@ sub formbuilder_setup (@) {
        my %params=@_;
 
        my $form=$params{form};
        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});
                push @{$params{buttons}}, "Comment Moderation";
                if ($form->submitted && $form->submitted eq "Comment Moderation") {
                        commentmoderation($params{cgi}, $params{session});
index ac7e2f21d92e2aa975bfb5db074e0d313bbe4978..68d08ad8e6095e7d32954e3203dab46164845b01 100644 (file)
@@ -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.
   * 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
 
 
  -- Joey Hess <joeyh@debian.org>  Sun, 15 Feb 2009 20:11:57 -0500