perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Arnold <>
Subject Anonymous login with Stein
Date Thu, 01 Jul 2004 21:02:33 GMT

I have this in my httpd.conf:

<Location /protected>
        PerlOptions +GlobalRequest
        AuthName Anonymous
        AuthType Basic
        PerlAuthenHandler Apache::AuthAnon
        require valid-user
        PerlSetVar Anonymous anonymous|anybody

Here is the handler:

package Apache::AuthAnon;
# file: Apache/

use strict;
use Apache::Constants qw(:common);

my $email_pat='[.\w-]+\@\w+\.[.\w]*[^.]';
my $anon_id="anonymous";

sub handler {
    my $r=shift;

    return $res if $res!=OK;

    my $user=lc $r->connection->user;
    my $reason="";

    my $check_id=$r->dir_config("Anonymous") || $anon_id;

    $reason="user did not enter a valid anonymous username: "
        unless $user=~/^$check_id/i;

    $reason="user did not enter an email address password: "
        unless $sent_pwd=~/^$email_pat$/o;

    if ($reason) {
        return AUTH_REQUIRED;


    return OK;


When I attempt to access the location (username: anonymous, password: I get this in my error_log:

[Thu Jul 01 13:38:30 2004] [error] [client] Usage:
Apache::RequestRec::notes(obj, val=NULL) at
/home/darnold/modperl/Apache/ line 33.\n

If I comment this line of code:

#    $r->notes(AuthAnonPassword=>$sent_pwd);

Then I get this in my error_log:

/darnold/modperl/Apache/ line 33.\n
[Thu Jul 01 13:55:30 2004] [error] [client] Undefined subroutine
&Apache::AuthAnon::handler called.\n

Can someone explain what is going on and provide a workaround?

Report problems:
Mail list info:
List etiquette:

View raw message