Try doing my $r=Apache::Request->new($r);
Issac
Internet is a wonderful mechanism for making a fool of
yourself in front of a very large audience.
--Anonymous
Moving the mouse won't get you into trouble... Clicking it might.
--Anonymous
PGP Key 0xE0FA561B - Fingerprint:
7E18 C018 D623 A57B 7F37 D902 8C84 7675 E0FA 561B
----- Original Message -----
From: "Randy Rasmussen" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, October 10, 2001 18:35
Subject: Problem with Apache->request
> I am having a problem with a module that needs Apache->request.
>
> The module is AuthCookieLDAP. I have a .htaccess (/test2/.htaccess) file
> that looks like:
> AuthType Apache::AuthCookieLDAP
> AuthName SA
> PerlAuthenHandler Apache::AuthCookieLDAP->authenticate
> PerlAuthzHandler Apache::AuthCookieLDAP->authorize
> require valid-user
>
> That in turn reads my httpd.conf file which has the following:
> <Files LOGIN>
> AuthType Apache::AuthCookieLDAP
> AuthName SA
> SetHandler perl-script
> PerlHandler Apache::AuthCookieLDAP->login
> </Files>
>
> PerlModule Apache::AuthCookieLDAP
> PerlSetVar SAPath /
> PerlSetVar SALoginScript /cgi-bin/login.pl
> PerlSetVar SALDAP_DN "o=isp"
> PerlSetVar SADBI_DSN "isp"
> PerlSetVar SALDAP_SecretKeyFile .../apache/foobar.com.key
> PerlSetVar SALDAP_User tesuser
> PerlSetVar SALDAP_host host.foobar.com
> #PerlSetVar SALDAP_host ldap.foobar.com
> PerlSetVar SALDAP_EncryptionType "none"
> PerlSetVar SALDAP_SessionLifetime 00-24-00-00
>
>
> Then it runs the login.pl script which looks like:
> #!/usr/bin/perl
> #
> # $Id: login.pl,v 1.1 2000/07/11 17:03:05 jacob Exp $
> use strict;
> use 5.004;
> use Text::TagTemplate;
> use Apache;
>
> my $t = new Text::TagTemplate;
> my $r = Apache->request();
>
> my $destination;
> my $authcookiereason;
> if ( $r->prev() ) { # we are called as a subrequest.
> $destination = $r->prev()->args()
> ? $r->prev()->uri() . '?' . $r->prev->args()
> : $r->prev()->uri();
> $authcookiereason = $r->prev()->subprocess_env(
> 'AuthCookieReason' );
> } else {
> $destination = $r->args( 'destination' );
> $authcookiereason = $r->args( 'AuthCookieReason' );
> }
> $t->add_tag( DESTINATION => $destination );
>
> unless ( $authcookiereason eq 'bad_cookie' ) {
> $t->template_file( "../html/login.html" );
> } else {
> $t->template_file( "../html/login-failed.html" );
> }
>
> $r->send_http_header;
> print $t->parse_file unless $r->header_only;
>
>
> When I go to /test2/index.html I get this error:
> Can't locate object method "request" via package "Apache" at
> .../cgi-bin/login.pl line 16.
> [Wed Oct 10 10:43:26 2001] [error] [client 172.28.22.253] Premature end
> of script headers: .../cgi-bin/login.pl
>
> Here is the software and versions I have installed:
>
> apache 1.3.20, Apache-AuthCookie-3.00, Apache-AuthCookieLDAP-0.02,
> mod_perl-1.26, perl5.005_02
>
> Please help. I have looke all over deja.com, and all of the perl and
> mod_perl sites I can think of to no avail.
>
> Thanks in advance,
>
> Randy
>
>