RE: Trying to find correct format for PerlSetVar's -- or get Apache::AuthNetLDAP working.

2001-06-01 Thread Steve Haslam

Hi,

(btw threading broken because I'm replying from a digest)

I do multiple PerlSetVars from inside a Location (itself inside a
VirtualHost) like this:

  PerlSetVar = [['User', $user],
 ['Locale', $locale],
 ...
]

I've also had some wierdness happen with mod_perl not reporting syntax
errors and other problems in Perl sections that I'm now unable to
reproduce :|

SRH
-- 
+ Steve Haslam |W: +44-20-7447-1839+
+   /excite/intl/uk/softeng|M: +44-7775-645618 +
.Spare a thought for me because I see the things that you don't see.



Re: Trying to find correct format for PerlSetVar's -- or get Apache::AuthNetLDAP working.

2001-05-31 Thread Thomas Eibner

On Wed, May 30, 2001 at 10:30:50PM -0500, Steven Lembark wrote:
 problem seems to be that i'm not getting the PerlSetVar's 
 across to it via perly config:
[Snip]
 is there any better doc for this than the eagle book?

You have to use $r-dir_config('Var') to get the values from the configuration file.
Example:
my $BindDN = $r-dir_config('BindDN'); 

See:
http://perl.apache.org/guide/config.html#PerlSetVar_PerlSetEnv_and_PerlP

-- 
  Thomas Eibner http://thomas.eibner.dk/ - DnsZone http://dnszone.org/
  mod_pointer http://stderr.net/mod_pointer 




RE: Trying to find correct format for PerlSetVar's -- or get Apache::AuthNetLDAP working.

2001-05-31 Thread Geoffrey Young



 -Original Message-
 From: Steven Lembark [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, May 30, 2001 11:31 PM
 To: [EMAIL PROTECTED]
 Subject: Trying to find correct format for PerlSetVar's -- or get
 Apache::AuthNetLDAP working.
 
[snip]
168  PerlSetVar  =
169  {
170  BindDN  = 'employeenumber=123456 
 ou=people
 o=foo.bar',
171  BindPWD = 'password',
172  BaseDN  = 'ou=people o=foo.bar',
173  LDAPServer  = 'ldap.alltel.com',
174  LDAPPort= '389',
175  UIDAttr = 'sn',
176  },
[snip]
 
 is there any better doc for this than the eagle book?

ah, but the answer you seek can be found within... p417

--Geoff



RE: Trying to find correct format for PerlSetVar's -- or get Apache::AuthNetLDAP working.

2001-05-31 Thread Geoffrey Young



 -Original Message-
 From: Steven Lembark [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, May 31, 2001 1:27 PM
 To: Geoffrey Young
 Subject: Re: Trying to find correct format for PerlSetVar's -- or get
 Apache::AuthNetLDAP working.
 
 
 
  [snip]
  168  PerlSetVar  =
  169  {
  170  BindDN  = 'employeenumber=123456
   ou=people
   o=foo.bar',
  171  BindPWD = 'password',
  172  BaseDN  = 'ou=people o=foo.bar',
  173  LDAPServer  = 'ldap.alltel.com',
  174  LDAPPort= '389',
  175  UIDAttr = 'sn',
  176  },
  [snip]
  
   is there any better doc for this than the eagle book?
  
  ah, but the answer you seek can be found within... p417

 I don't see an example on p 417 with an entry for PerlSetVar.
 The array-of-arrays format was my initial guess, and it
 didn't seem to work, after which I tried the array of hashes.

oh, I see - setting multiple values within a %Location.  there's no example
of that.  sorry :)

Tie::DxHash out to help.  If you can't get that to work, if your config
allows for it, you could always move the PerlSetVar stuff outside of the
%Location section...

--Geoff



Trying to find correct format for PerlSetVar's -- or get Apache::AuthNetLDAP working.

2001-05-30 Thread Steven Lembark

Eagle gives number of examples, none of which is a PerlSetVar.
guessing it would be a hash of var's to set with values.
Not having much luck -- Apache::AuthNetLDAP fails with:

[Wed May 30 23:33:21 2001] [notice] Apache/1.3.19 (Unix) mod_perl/1.25
configured -- resuming normal operations
[Wed May 30 23:33:21 2001] [info] Server built: May  4 2001 18:38:57
[Wed May 30 23:33:31 2001] [error] Can't call method bind on an
undefined value at
/usr/local/perl5/lib/site_perl/5.6.1/Apache/AuthNetLDAP.pm line 57.

which is running:

47 my $ldap = new Net::LDAP($ldapserver, port = $ldapport);
48
49 my $mesg;
50 #initial bind as user in Apache config
51 if ($bindpwd ne )
52 {
53 $mesg = $ldap-bind($binddn, password=$bindpwd);
54 }
55 else
56 {
57 $mesg = $ldap-bind();
58 }
59
60 #each error message has an LDAP error code
61 if (my $error = $mesg-code())
62 {
63  $r-note_basic_auth_failure;
64  $r-log_reason(user $username: LDAP Connection Failed:
$error,$r-uri);
65  return AUTH_REQUIRED;
66 }


problem seems to be that i'm not getting the PerlSetVar's 
across to it via perly config:

   164  $Location{'/blah'} = 
   163  {
   164  SetHandler  = 'perl-script',
   165
   166  PerlAuthenHandler   = 'Apache::AuthNetLDAP',
   167   
   168  PerlSetVar  =
   169  {
   170  BindDN  = 'employeenumber=123456 ou=people
o=foo.bar',
   171  BindPWD = 'password',
   172  BaseDN  = 'ou=people o=foo.bar',
   173  LDAPServer  = 'ldap.alltel.com',
   174  LDAPPort= '389',
   175  UIDAttr = 'sn',
   176  },
   177
   178  AuthName= '/tdrdw',
   179  AuthType= 'Basic',
   180
   181  require = 'valid-user',
   182
   183  PerlSetEnv  = BASEURL http://$host:$Port/tdrdw;,
   184  PerlHandler = 'Tdrdw::Welcome',
   185  },


is there any better doc for this than the eagle book?

-- 
 Steven Lembark   2930 W. Palmer St.
 Chicago, IL  60647
 [EMAIL PROTECTED]   800-762-1582