336eb793a2a1cc7e3da89e0dfd9728abc80601e3
[ikiwiki.git] / IkiWiki / Plugin / httpauth.pm
1 #!/usr/bin/perl
2 # HTTP basic auth plugin.
3 package IkiWiki::Plugin::httpauth;
4
5 use warnings;
6 use strict;
7 use IkiWiki;
8
9 sub import { #{{{
10         hook(type => "auth", id => "skeleton", call => \&auth);
11 } # }}}
12
13 sub auth ($$) { #{{{
14         my $cgi=shift;
15         my $session=shift;
16
17         if (defined $cgi->remote_user()) {
18                 $session->param("name", $cgi->remote_user());
19         }
20 } #}}}
21
22 1