summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/httpauth.pm
blob: d28b6d2d0f033dcd107ceb7b9632b991c8da73a9 (plain)
  1. #!/usr/bin/perl
  2. # HTTP basic auth plugin.
  3. package IkiWiki::Plugin::httpauth;
  4. use warnings;
  5. use strict;
  6. use IkiWiki 2.00;
  7. sub import { #{{{
  8. hook(type => "auth", id => "httpauth", call => \&auth);
  9. } # }}}
  10. sub auth ($$) { #{{{
  11. my $cgi=shift;
  12. my $session=shift;
  13. if (defined $cgi->remote_user()) {
  14. $session->param("name", $cgi->remote_user());
  15. }
  16. } #}}}
  17. 1