Hello,
thanks for the code below. I have put the following into access.conf
<Location /cgi-bin>
PerlAuthenHandler Apache::SillyAuthen;
</Location>
I copied your code into my modules Apache directory.
and in cgi-bin i have a script to print all environment variables but
$remote_user=$ENV{'REMOTE_USER'}; is empty. am i doing anything wrong?
Also it is for tracking users across my site. So far i am doing it with
hidden fields, putting session_id in url.
I thought having a variable following the user without putting all the
above would
be easier.
darren chamberlain wrote:
>
> harilaos ([EMAIL PROTECTED]) said something to this effect on 01/30/2001:
> > I want to create a username and password when a user enters my site,
> > then pass these values to apache to authenticate. Then i could
> > have the REMOTE_USER variable available throught the users
> > stay at my site.
>
> You want to create them? Do you mean create a new session for
> each user? You might want to look into Apache::Session for this;
> it has a customizable session key generator.
>
> Here is a simple example, generating a simple session id. Run this
> as a PerlAuthenHandler:
>
> package Apache::SillyAuthen;
>
> use Apache::Constants qw(OK);
> use MD5;
>
> sub handler {
> my $r = shift;
>
> # Make a random "username". This can be a call to any
> # function, etc, that can generate a username
> my $session = MD5->hexhash($r->get_remote_host . time . {});
>
> # Set the username in the conn_rec
> $r->connection->user($session);
>
> # Set the REMOTE_USER env variable
> $r->subprocess_env('REMOTE_USER', $session);
>
> # Be sure to tell Apache that the authentication handler did
> # its thing!
> return OK;
> }
>
> Is that what you mean?
>
> (darren)
>
> --
> It's not that things are getting worse, it's just that news reporting is
> getting better.