Re: Simple ldap_modify problem?

From: Date: Thu, 17 Apr 2003 16:36:55 +0000
Subject: Re: Simple ldap_modify problem?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-144326@lists.php.net to get a copy of this message
ext Brian (php-general@sboss.net) wrote: > I hope someone can help me. > > The scripts work great for me, except the ldap_modify function. If I > add a user through the scripts, I can modify the entry's cn and sn > values as much as I like, but I can only edit the email address only > once before it no longer allows me to edit it (error no. 32: No such > object). Hi, I know what your problem is. You are confusing the DN with the mail attribute. First of all, my advice is to not use mail in your DN. You should use cn or uid. When you change the mail attribute in your entry, the DN doesn't get renamed. And that's proper behavior, DNs aren't supposed to be changed, unless someone gets married or something. So you start out with an entry that looks like this: dn: mail=test@fictional.net,dc=fictional,dc=net objectclass: inetorgperson cn: bill sn: gates mail: test@fictional.net And after you modify it, you end up with an entry that looks like this: dn: mail=test@fictional.net,dc=fictional,dc=net objectclass: inetorgperson cn: bill sn: gates mail: test1@fictional.net When you try to modify it the next time, you try to modify a DN dn: mail=test1@fictional.net,dc=mail,dc=net but it doesn't exist. You should create entries like this: dn: cn=bill gates,dc=fictional,dc=net objectclass: inetorgperson cn: bill sn: gates mail: test@fictional.net Then you and your program won't be confused :-) -- mike (ldap specialist by profession)

« previous php.general (#144326) next »