Re: Help with Method Handlers in mod_perl 1.99

2002-05-20 Thread Doug MacEachern

On Fri, 3 May 2002, Peter Rothermel wrote:

> I tried the mehod attribute and now I get this error:
> 
> Error message:
>Can't locate object method "" via package "Apache::AuthDerivedHandler".

method handlers were broken in _01, this has been fixed in cvs and will be 
in 1.99_02





Re: Help with Method Handlers in mod_perl 1.99

2002-05-03 Thread Peter Rothermel

I tried the mehod attribute and now I get this error:

Error message:
   Can't locate object method "" via package "Apache::AuthDerivedHandler".



Geoffrey Young wrote:

> Peter Rothermel wrote:
>
> > Can somebody help me out with Method Handlers in
> > Apache2 - mod_perl 1.99? I'm new to windows and its
> > threading issues.
>
> [snip]
>
>
> > sub authenticate ($$) {
> >   my ($self, $r) = @_;
> >   return OK;
> > }
>
> I haven't played much with mod_perl 2.0 yet, but I know that this format is 
>deprecated now.
>
> instead, try
>
> sub authenticate : method {
>...
> }
>
> and look for method handlers in design.pod and compat.pod
>
> HTH
>
> --Geoff



Re: Help with Method Handlers in mod_perl 1.99

2002-05-03 Thread Geoffrey Young



Peter Rothermel wrote:

> Can somebody help me out with Method Handlers in
> Apache2 - mod_perl 1.99? I'm new to windows and its
> threading issues.


[snip]

 
> sub authenticate ($$) {
>   my ($self, $r) = @_;
>   return OK;
> }

I haven't played much with mod_perl 2.0 yet, but I know that this format is deprecated 
now.

instead, try

sub authenticate : method {
   ...
}

and look for method handlers in design.pod and compat.pod

HTH

--Geoff




Help with Method Handlers in mod_perl 1.99

2002-05-03 Thread Peter Rothermel

Can somebody help me out with Method Handlers in
Apache2 - mod_perl 1.99? I'm new to windows and its
threading issues.

Here's a simple authentication handler that shows where
I'm getting stuck. I need to initialize a AuthDerivedHandler
object but I'm not sure exactly how to do this.

package Apache::AuthBaseHandler;

use strict;

use Apache::Constants qw(:common);
use vars qw($VERSION);

$VERSION = '3.00';

sub authenticate ($$) {
  my ($self, $r) = @_;
  return OK;
}

sub new  {
  my $this = shift;
  my $class = ref($this) || $this;
  my $self = {};
  bless $self, $class;
  return $self;
}


1;

__END__


package Apache::AuthDerivedHandler;
use strict;
use Apache;
use Apache::Constants qw(:common);
use Apache::AuthBaseHandler;
use vars qw($VERSION @ISA);

$VERSION = "1.0";
@ISA = qw(Apache::AuthBaseHandler);


sub NonMethodAuthHandler($)  {
  my $r = shift;

  my $authhandler = Apache::AuthDerivedHandler->new();

  return $authhandler->authenticate($r);

}

1;



In my httpd.conf I have the following directives:

  
   PerlOptions +GlobalRequest
   SetHandler perl-script
  AuthType Apache::AuthCookieHandler
  PerlAuthenHandler Apache::AuthDerivedHandler->authenticate
  PerlHandler Apache::hello
   require valid-user
  


  
   PerlOptions +GlobalRequest
   SetHandler perl-script
  AuthType Apache::AuthCookieHandler
  PerlAuthenHandler Apache::AuthDerivedHandler->authenticate
  PerlHandler Apache::hello
  require valid-user
  


In my startup.pl in have:

$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::AuthDerivedHandler;
1;