<p>I didn't catch you guys. Let me make my problem clearer.</p>
<p>My catalyst application handles the auth process and I want Apache writes username into its log files, just like using Apache's basic auth module.</p>
<div class="gmail_quote">2012/04/20 21:59 "Tomas Doran" <<a href="mailto:bobtfish@bobtfish.net">bobtfish@bobtfish.net</a>>:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
On 20 Apr 2012, at 12:56, Eden Cardim wrote:<br>
<br>
>>>>>> "Hailin" == Hailin Hu <<a href="mailto:i@h2l.name">i@h2l.name</a>> writes:<br>
> Hailin> Finally, something like below works for me.<br>
><br>
> Hailin> my $apache = $c->engine->env->{'psgi.input'}; #<br>
> Hailin> Apache2::RequestRec $apache->user( $username );<br>
><br>
> Hailin> I supposed that an accessor of apache should be a method instead<br>
> Hailin> of a key of hash. Is this the right way to retrieve the<br>
> Hailin> apache/mod_perl object?<br>
><br>
> No it's not, this ties your application to a specific backend server<br>
> implementation (which is what caused your problem in the first<br>
> place). Whenever you need to access $c->engine->env, you should be applying a<br>
> Plack::Middleware to your .psgi instead.<br>
<br>
For this specific thing, there is already $c->req->remote_user, which should get this - no?<br>
<br>
<a href="https://metacpan.org/module/Catalyst::Request#req-remote_user" target="_blank">https://metacpan.org/module/Catalyst::Request#req-remote_user</a><br>
<a href="http://search.cpan.org/~bobtfish/Catalyst-Plugin-Authentication-0.10018/lib/Catalyst/Authentication/Credential/Remote.pm" target="_blank">http://search.cpan.org/~bobtfish/Catalyst-Plugin-Authentication-0.10018/lib/Catalyst/Authentication/Credential/Remote.pm</a><br>
<br>
Cheers<br>
t0m<br>
<br>
<br>
_______________________________________________<br>
List: <a href="mailto:Catalyst@lists.scsys.co.uk">Catalyst@lists.scsys.co.uk</a><br>
Listinfo: <a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst" target="_blank">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst</a><br>
Searchable archive: <a href="http://www.mail-archive.com/catalyst@lists.scsys.co.uk/" target="_blank">http://www.mail-archive.com/catalyst@lists.scsys.co.uk/</a><br>
Dev site: <a href="http://dev.catalyst.perl.org/" target="_blank">http://dev.catalyst.perl.org/</a><br>
</blockquote></div>