2 # HTTP basic auth plugin.
3 package IkiWiki::Plugin::httpauth;
10 hook(type => "getsetup", id => "httpauth", call => \&getsetup);
11 hook(type => "auth", id => "httpauth", call => \&auth);
12 hook(type => "canedit", id => "httpauth", call => \&canedit,
24 example => "http://example.com/wiki/auth/ikiwiki.cgi",
25 description => "url to redirect to when authentication is needed",
35 if (defined $cgi->remote_user()) {
36 $session->param("name", $cgi->remote_user());
45 if (! defined $cgi->remote_user() && defined $config{cgiauthurl}) {
46 IkiWiki::redirect($cgi, $config{cgiauthurl}.'?'.$cgi->query_string());