]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/comments.pm
make wmd comment support comment editing (I think)
[git.ikiwiki.info.git] / IkiWiki / Plugin / comments.pm
index 995d1f4eb6a1252db56914bc6083af07edd390b8..ee53dbc91e4e0b6768e36d23705da64a02cf0e1b 100644 (file)
@@ -26,6 +26,8 @@ sub import {
        hook(type => "htmlize", id => "_comment", call => \&htmlize);
        hook(type => "pagetemplate", id => "comments", call => \&pagetemplate);
        hook(type => "formbuilder_setup", id => "comments", call => \&formbuilder_setup);
        hook(type => "htmlize", id => "_comment", call => \&htmlize);
        hook(type => "pagetemplate", id => "comments", call => \&pagetemplate);
        hook(type => "formbuilder_setup", id => "comments", call => \&formbuilder_setup);
+       # Load goto to fix up user page links for logged-in commenters
+       IkiWiki::loadplugin("goto");
        IkiWiki::loadplugin("inline");
 }
 
        IkiWiki::loadplugin("inline");
 }
 
@@ -603,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});