avoid warning
[ikiwiki] / IkiWiki / Plugin / anonok.pm
1 #!/usr/bin/perl
2 package IkiWiki::Plugin::anonok;
3
4 use warnings;
5 use strict;
6 use IkiWiki 2.00;
7
8 sub import { #{{{
9         hook(type => "canedit", id => "anonok", call => \&canedit,);
10 } # }}}
11
12 sub canedit ($$$) { #{{{
13         my $page=shift;
14         my $cgi=shift;
15         my $session=shift;
16
17         my $ret;
18
19         if (exists $config{anonok_pagespec} && length $config{anonok_pagespec}) {
20                 if (pagespec_match($page, $config{anonok_pagespec},
21                                    location => $page)) {
22                         return "";
23                 }
24                 else {
25                         return undef;
26                 }
27         }
28         else {
29                 return "";
30         }
31 } #}}}
32
33 1