----- Forwarded message from Joshua Kahn <ka...@ma...> -----
Date: Wed, 07 Aug 2002 14:58:16 -0500
To: gb...@po...
From: Joshua Kahn <ka...@ma...>
Subject: LDAP Help
Graham-
I am working on a simple LDAP Search for our department site, however, I
have encountered an error that I have not been able to solve. In the error
log, I get the following message:
decode error 15 17 at /Library/Perl/Convert/ASN1/_decode.pm line 196.
I have not been able to determine what is causing this error, any
ideas? We are using a Mac OS-9 server. It would seem to me that the
server is returning information that the decoded is not prepared for.
Any help you can give would be much appreciated. I have included my code
below.
Thank you,
Josh Kahn
University of Wisconsin-Madison Department of Human Oncology
---------------------------------------------------------------------------------------------------------------
my $hostname = "mail.humonc.wisc.edu";
my $dn = "humonc";
my $port = 389;
my $scope = "base";
my $filter = "";
my @attributes = ("cn" , "mail");
sub search
{
# Data from HTML form
my $dfilter = $cgi->param('dfilter');
my $criteria = $cgi->param('criteria');
if ($dfilter = "Email") { $filter = "mail=$criteria"; }
elsif ($dfilter = "Name") { $filter = "cn=$criteria"; }
&connect;
$ldap->bind;
my $result = $ldap->search(
base => $dn,
scope => $scope,
filter => $filter
);
die $result->error if $result->code;
&startHTMLpage;
# display results
&endHTMLpage;
$ldap->unbind;
}
#################
sub connect
{
# Create new connection to mail server
$ldap = Net::LDAP->new($hostname,
port => $port,
debug => 3,
timeout => 30
) || die ("Failed to open connection to mail server");
}
----- End forwarded message -----
|