From: Graham B. <gb...@po...> - 2000-05-04 14:54:23
|
----- Forwarded message from Gerald Roehrbein/Pctdmn <gro...@bi...> ----- From: Gerald Roehrbein/Pctdmn <gro...@bi...> Date: Thu, 4 May 2000 14:54:40 -0100 To: gb...@po... Subject: Your LDAP Perl Module Hello Graham, I try to use your LDAP Module but I'am not able to use it. Maybe I'am not so experienced with LDAP. I have to write a little module that should do the following: The Module have to use 3 Parameter (Name, Password, UniqueId) Then it should build a mail adress Uni...@my... and a mail alias. The Software should query LDAP to permit/deny double e-mail aliases. And then it should add the data to LDAP directory. Sounds easy. The prgram is from the examples of ACTIVE PERL but it does not run. The Source Code is below and the output of the programm is added below the source. I do not know what the problem is and how to debug. I'am not an experienced Perl prorgammer so I do not have any idea how to debug it and how to get more information about the reasons of the errors. ---------------------------------------------------------------------BEGIN OF SOURCE------------------------------------------------------------- use CGI; # use strict # 'vars'; # use Mail::Send; use Net::LDAP; # use Net::LDAP::message; $ldap = Net::LDAP->new('mcis01', debug=> 3) or die "$@"; $ldap->bind ; # an anonymous bind $mesg = $ldap->search ( # perform a search base => "c=mcis01", filter => "(& (uid= (o=microsoft))" ); print "Error: "+$mesg->error+"!!!"; $mesg->code && die $mesg->error; foreach $entry ($mesg->all_entries) { print "ENTRY: "; $entry->dump; } $ldap->unbind; # take down session $ldap = Net::LDAP->new('mcis01', debug =>3 ); $ldap->bind ( # bind to a directory with dn and password dn => 'cn=Administrator,ou=Members, o=microsoft', password => 'NetFRAME' ); $result = $ldap->add ( dn => 'cn = Barbara Jensen', # dn => 'cn = Barbara Jensen', attr => [ 'cn' => ['Barbara Jensen', 'Barbs Jensen'], #'sn' => 'Jensen', 'mail' => 'b.j...@um...' ] ); $result->code && warn "failed to add entry: ", $result->error ; -------------------------------------------------------END OF SOURCE---------------------------------------------------- Output of the above source: ---------------------------------------------------------BEGIN OF LOG------------------------------------------------------- C:\ldap>ldap.pl Net::LDAP=HASH(0x8bbf1f0) sending: 30 0C 02 01 01 60 07 02 01 02 04 00 80 00 __ __ 0....`........ Net::LDAP=HASH(0x8bbf1f0) received: 30 0C 02 01 01 61 07 0A 01 00 04 00 04 00 __ __ 0....a........ Net::LDAP=HASH(0x8bbf1f0) sending: 30 32 02 01 02 63 2D 04 08 63 3D 6D 63 69 73 30 02...c-..c=mcis0 31 0A 01 02 0A 01 02 02 01 00 02 01 00 01 01 00 1............... A0 10 A3 0E 04 01 6F 04 09 6D 69 63 72 6F 73 6F ......o..microso 66 74 30 00 __ __ __ __ __ __ __ __ __ __ __ __ ft0. Net::LDAP=HASH(0x8bbf1f0) received: 30 0C 02 01 02 65 07 0A 01 00 04 00 04 00 __ __ 0....e........ 0Net::LDAP=HASH(0x8bbf1f0) sending: 30 05 02 01 03 42 00 __ __ __ __ __ __ __ __ __ 0....B. Net::LDAP=HASH(0x8f76be4) sending: 30 3C 02 01 04 60 37 02 01 02 04 28 63 6E 3D 41 0<...`7....(cn=A 64 6D 69 6E 69 73 74 72 61 74 6F 72 2C 6F 75 3D dministrator,ou= 4D 65 6D 62 65 72 73 2C 20 6F 3D 6D 69 63 72 6F Members, o=micro 73 6F 66 74 80 08 4E 65 74 46 52 41 4D 45 __ __ soft..NetFRAME Net::LDAP=HASH(0x8f76be4) received: 30 0C 02 01 04 61 07 0A 01 00 04 00 04 00 __ __ 0....a........ Net::LDAP=HASH(0x8f76be4) sending: 30 60 02 01 05 68 5B 04 13 63 6E 20 3D 20 42 61 0`...h[..cn = Ba 72 62 61 72 61 20 4A 65 6E 73 65 6E 30 44 30 24 rbara Jensen0D0$ 04 02 63 6E 31 1E 04 0E 42 61 72 62 61 72 61 20 ..cn1...Barbara 4A 65 6E 73 65 6E 04 0C 42 61 72 62 73 20 4A 65 Jensen..Barbs Je 6E 73 65 6E 30 1C 04 04 6D 61 69 6C 31 14 04 12 nsen0...mail1... 62 2E 6A 65 6E 73 65 6E 40 75 6D 69 63 68 2E 65 b.jensen@umich.e 64 75 __ __ __ __ __ __ __ __ __ __ __ __ __ __ du Net::LDAP=HASH(0x8f76be4) received: 30 0C 02 01 05 69 07 0A 01 41 04 00 04 00 __ __ 0....i...A.... failed to add entry: at C:\dfbldap\ldap.pl line 36. C:\ldap> ---------------------------------------------------------------------END OF LOG--------------------------------------------------------------- Within the LDAP directory there are two Members. But the search does not find them. It would be nice to get a little help from you. Thanks a lot. With best regards Gerald P.S. It's running under Windows NT 4.0 and the LDAP Server is LDAP from the MCIS MAIL. ----- End forwarded message ----- |