Re: Authentication Question

2002-08-28 Thread Per Einar Ellefsen

At 09:55 28.08.2002, Brett Hales wrote:
I have a mod_perl cgi script that I would like to get the username from
the Apache server. The apache server successfully authenticates the
client using Apache::AuthenSmb.

How do I get this environment variable (the username) from apache into a
variable in the perl script.

It's $ENV{REMOTE_USER} or $r-user


-- 
Per Einar Ellefsen
[EMAIL PROTECTED]





Re: Authentication Question

2002-08-28 Thread Per Einar Ellefsen

Please do not send replies directly to me, Cc the list.

At 13:40 28.08.2002, Brett Hales wrote:
On Wed, 2002-08-28 at 17:47, Per Einar Ellefsen wrote:
  At 09:55 28.08.2002, Brett Hales wrote:
  I have a mod_perl cgi script that I would like to get the username from
  the Apache server. The apache server successfully authenticates the
  client using Apache::AuthenSmb.
  
  How do I get this environment variable (the username) from apache into a
  variable in the perl script.
 
  It's $ENV{REMOTE_USER} or $r-user
I have tried to use both of these,

$login_name = $ENV{REMOTE_USER};

and

$login_name = $r-user;

With the ENV I do not get anything when I print $login_name. With
$r-user I get the following in the error_log.

Cannot call method user without a package or object reference at
..

Do you have any advice, thanks again.

First of all: $r-user doesn't work because you haven't gotten the Apache 
request object. To get it in an Apache::Registry script, insert:
 my $r = Apache-request;
before your call to $r-user.

Why you aren't getting anything in $ENV{REMOTE_USER} I do not know. It 
might be that the environment isn't set up that way in Apache::Registry. Or 
maybe Apache::AuthenSmb doesn't set $r-user at all. Are you even nsure the 
authentication is working?


-- 
Per Einar Ellefsen
[EMAIL PROTECTED]





RE: Authentication question

2000-01-11 Thread Gerald Richter

 
  Is there any (simple) way to reuse the db handle from
  authentocation handler in serving the page?
 
 
 Is it possible to put the database handle in $r-pnotes? Or 
 would the connection not survive that?
 

That should work...

Gerald

-
Gerald Richterecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:   Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: [EMAIL PROTECTED] Voice:+49 6133 925151
WWW:http://www.ecos.de  Fax:  +49 6133 925152
-