response
[ikiwiki.git] / IkiWiki / Plugin / opendiscussion.pm
blob2805f60efdb6d415a19aeb17195df8ff2543487b
1 #!/usr/bin/perl
2 package IkiWiki::Plugin::opendiscussion;
4 use warnings;
5 use strict;
6 use IkiWiki 3.00;
8 sub import {
9 hook(type => "getsetup", id => "opendiscussion", call => \&getsetup);
10 hook(type => "canedit", id => "opendiscussion", call => \&canedit,
11 first => 1);
14 sub getsetup () {
15 return
16 plugin => {
17 safe => 1,
18 rebuild => 0,
19 section => "auth",
23 sub canedit ($$) {
24 my $page=shift;
25 my $cgi=shift;
26 my $session=shift;
28 return "" if $page=~/(\/|^)\Q$config{discussionpage}\E$/i;
29 return "" if pagespec_match($page, "postcomment(*)");
30 return undef;