summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/anonok.pm
blob: 1880516d568b35e2b96463676d23c04c62f103f2 (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 (exists $config{anonok_pagespec} && 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