monarch has asked for the wisdom of the Perl Monks concerning the following question:
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 # ... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: mod_perl, Apache access_log, and CGI::Session (Logging Authenticated Username)
by Errto (Vicar) on Nov 08, 2005 at 02:50 UTC | |
by monarch (Priest) on Nov 09, 2005 at 05:42 UTC | |
|
Re: mod_perl, Apache access_log, and CGI::Session (Logging Authenticated Username)
by EvanCarroll (Chaplain) on Nov 08, 2005 at 02:31 UTC | |
|
Re: mod_perl, Apache access_log, and CGI::Session (Logging Authenticated Username)
by srdst13 (Pilgrim) on Nov 09, 2005 at 00:02 UTC |