That's all good, except now the access_log never logs the authenticated user viewing a page.
I'm guessing I need to write a mod_perl handler that will retrieve the authenticated username from the CGI::Session and then somehow pass that to Apache to use when writing out the log entry?
Any guidance or pointers would be much appreciated. Here is the beginning of what I expect I'd need:
sub handler { use CGI::Session; # check CGI session my $session = new CGI::Session(); my $authuser = $session->param( 'AUTHUSER' ); # pass authuser to Apache log handler $r->set_remote_user_or_something( $authuser ); }
Update: it appears that I want something like the following:
use CGI::Session; sub handler { my ($r) = @_; # check CGI session my $session = new CGI::Session(); my $authuser = $session->param( 'AUTHUSER' ); # pass authuser to Apache log handler $r->user( $authuser ) if ( $authuser ); # handle page # ... }
In reply to mod_perl, Apache access_log, and CGI::Session (Logging Authenticated Username) by monarch
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |