Peter: please subscribe to the users list, see 
http://perl.apache.org/preview/modperl-docs/dst_html/maillist/list-modperl.html 
for more information. That is where you should post questions like this, 
not the development list which is exclusively for mod_perl core development.
I forwarded your e-mail to [EMAIL PROTECTED], so that others can 
reply there.

At 19:23 30.04.2002, Peter Rothermel wrote:
>greetings,
>
>I'm somewhat new to this group so please point me
>to the FAQ if I'm asking the wrong questions for this
>forum.
>
>I'm trying to migrate from Apache 1.3 on Unix to Apache 2.0
>on WinNT and I'm running into problems getting my perl modules
>working. Here's the first of my problems:
>
>I've added an Authentication Handler to a location that uses
>basic auth and can't get this simple example from the Eagle book
>running. It looks like $r->coonection->user  is no longer supported.
>If I use $r->user the auth handler works fine. I'm I not using Apache::compat
>correctly?
>
>
>Here's my auth handler:
>
>sub authenBasic ($) {
>   my $r = shift;
>
>   my ($res, $sentpass) = $r->get_basic_auth_pw;
>   return $res if $res != OK;
>
># my $user = $r->user;
>   my $user = $r->connection->user;
>   unless ($user and $sentpass)  {
>     $r->note_basic_auth_failure;
>     $r->log_reason("Both a username and password must be supplied",
>            $r->filename);
>     return AUTH_REQUIRED;
>   }
>
>Here's the error message that gets sent to the browser:
>                 Server error!
>                 Error message:
>                Can't locate object method "user" via package 
> "Apache::Connection" at C:\Apache2
>                /blib/lib/Apache/AgentAuthCookie.pm line 23.
>                If you think this is a server error, please contact the 
> webmaster <mailto:@@ServerAdmin@@;>
>                Error 500
>                localhost </>
>                04/30/2002 09:41:43 AM
>                Apache/2.0.36-dev (Win32) mod_perl/1.99_02-dev Perl/v5.6.0
>
>
>Here's the entry in the error.log:
>     [Tue Apr 30 09:41:43 2002] [error] [client 127.0.0.1] Can't locate 
> object method
>     "user" via package "Apache::Connection" at 
> C:\Apache2/blib/lib/Apache/AgentAuthCookie.pm line 23.
>
>
>
>In my httpd.conf file:
>
>PerlSwitches -Mblib=C:\Apache2
>PerlModule Apache2
><Location /hello>
>     PerlResponseHandler Apache::HelloWorld
>     SetHandler modperl
></Location>
>
>PerlModule Apache::compat
>PerlRequire "/apache2/conf/startup.pl"
>
>Alias /modperl /apache2/perlmods
>
>   <Location /modperl>
>     SetHandler perl-script
>     Options ExecCGI
>     PerlSendHeader On
>        PerlOptions +GlobalRequest
>        PerlResponseHandler ModPerl::Registry
>     allow from all
>   </Location>
>
>PerlModule Apache::WGTI::hello
>PerlModule Apache::AgentAuthCookie
>
>   <Location /modperl/hello>
>     SetHandler perl-script
>
>         AuthType Basic
>         AuthName "WatchGuardAgentUser"
>         PerlAuthenHandler Apache::AgentAuthCookie::authenBasic
>         require valid-user
>         PerlHandler Apache::WGTI::hello
>   </Location>
>
>
>In my startup.pl:
>
>$ENV{MOD_PERL} or die "not running under mod_perl!";
>use Apache2 ();
>use Apache::compat ();
>
>use Carp ();
>use CGI ();
>CGI->compile(':all');
>CGI->compile(':standard');
>
>use CGI::Carp;
>
>use Apache::AgentAuthCookie;
>1;

-- 
Per Einar Ellefsen
[EMAIL PROTECTED]


Reply via email to