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