Eric Ricardo Anton wrote:

I have started using Apache::AuthCookie, which runs under mod_perl, for authentication. The problem is that the whole website I’m working on is based on mod_cgi. I need the CGI scripts to call a mod_perl method in order to recognize the user that is logged in.


Since I can't port the scripts from mod_cgi to mod_perl, how can I make a CGI script call a mod_perl method?

Thanks for any help.

let's say you have a script:


print "Content-type: text/plain\n\n";
print "Hello whoever you are\n";

now you change it to be:

my $r = shift;
my $username = $r->connection->user || '';
print "Content-type: text/plain\n\n";
print "Hello $username\n";

or:

my $r = Apache->request;
my $username = $r->connection->user || '';
print "Content-type: text/plain\n\n";
print "Hello $username\n";

This is correct for mp1.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com



Reply via email to