summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/httpauth.pm
blob: 336eb793a2a1cc7e3da89e0dfd9728abc80601e3 (plain)
  1. #!/usr/bin/perl
  2. # HTTP basic auth plugin.
  3. package IkiWiki::Plugin::httpauth;
  4. use warnings;
  5. use strict;
  6. use IkiWiki;
  7. sub import { #{{{
  8. hook(type => "auth", id => "skeleton", 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