summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/httpauth.pm
blob: 786bcba3b34b99676766f074f52db9bb6beda264 (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 => "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