From: Mike S. <msc...@bo...> - 2000-07-12 18:46:21
|
Jim, I'm new to LDAP and very new to perl-ldap, so please forgive my ignorance ahead of time. Do you happen to know of a way to delete items from the schema? I'm using your script to retrieve the schema from an NDS server, and I'm then taking part of the search result and attempting to delete a few objectclasses and attributetypes. I don't think that $ldap->delete( $dn ); will do it for me. Any help you could give would be greatly appreciated. thanks, Mike Schatzabel Software Quality Engineer Bowstreet -----Original Message----- From: Jim Harle [mailto:ha...@us...] Sent: Thursday, June 29, 2000 2:47 PM To: Eric Zhou Cc: LDAP Mailing List Subject: Re: [Fwd] retrieve perl-ldap schema and ldap search Eric, I have attached code that will find all attributes without using ldap->schema(). For your second question, it depends on what you want to really search for. If all you want to know is whether an object of a given dn exists, you can use code like $mesg = $ldap->search ( base => $testdn, scope => 0, filter => "(objectclass=*)" ); If the search succeeds, $testdn already exists. If you, however, want to make sure that you are adding an object where the lowest level of the dn is unique, the search is different. This might be when you are looking to add a user with uid=joe, but you want to make sure that not only is there not a "joe" in dept1, but not anywhere. If this is the case, then you need to make sure that all your users have a uid attribute, not just uid as part of the dn. Then the search becomes $mesg = $ldap->search ( base => $normalbase filter => "(uid=$testuid)" ); Jim Harle US Naval Academy On Thu, 29 Jun 2000, Graham Barr wrote: > ----- Forwarded message from Eric Zhou <eri...@ya...> ----- > > Date: Thu, 29 Jun 2000 10:55:36 -0700 (PDT) > From: Eric Zhou <eri...@ya...> > Subject: retrieve perl-ldap schema and ldap search > To: Graham Barr <gb...@po...> > > hi,Graham: > > remember I asked you an address the other day about > two perl module. I am still not that far yet. > I have been able to use ldap->add() and ldap->modify() > function to do some simple stuff. > > do you have some handy example of how to use > ldap->schema to retrieve schema of ldap tree? > the other thing is that I don't quite understand > your ldap->search() doing. because I wish to search > and dn in the ldap tree and see if it is there before > I insert it. do I suppose to use ldap->search() or > ldap->compare(). > > > thank you very much. > > Eric > > > __________________________________________________ > Do You Yahoo!? > Get Yahoo! Mail - Free email you can access from anywhere! > http://mail.yahoo.com/ > > ----- End forwarded message ----- > > |