package Apache::LogAuth; use strict; use Apache::Constants qw(:common); sub handler { my $r = shift; my ($res, $sent_pw) = $r->get_basic_auth_pw; return $res if $res != OK; my $user = $r->connection->user; unless ($user && $sent_pw) { return AUTH_REQUIRED; } open(SOMELOG,">>somelogfile") || return DECLINED; print SOMELOG $user,"\n"; close(SOMELOG); return OK; } 1; #### AuthName Restricted AuthType Basic PerlAuthenHandler Apache::LogAuth require valid-user