Helpful Information
 
 
Category: Development Articles
Using PHP With LDAP (part 2)

I liked this article a lot. The only problem I had with it was the modify.php only lets you modify the names. If you try to edit the email address, it fails because you cannot change the identifier it is using to identify the proper entry. If this were fixed/changed, it'd be great. That's what I'm trying to figure out how to do now.

Brian

Okay, I worked around the aforementioned inability to edit email addresses.

In edit.php, I put an extra variable to pass to modify.php::

<input type="hidden" name="mailorig" size="20" value="<?php echo $info[0]["mail"][0]; ?>">

In modify.php, I changed this::

// prepare DN
$dn = "mail=" . $_POST['mail'] . ", dc=my-domain, dc=net";

to this ...::

// prepare DN
$dn = "mail=" . $_POST['mailorig'] . ", dc=my-domain, dc=net";

Harish, I hope you change this in your article. Otherwise, I found it MOST useful. Thank you!

Brian

Using PHP With LDAP \(part 2\) (http://www.devshed.com/c/a/PHP/Using-PHP-With-LDAP-part-2)

April 07, 2003 - In this second, and concluding, article, dig deeper into PHP's LDAP API by writing complex search queries and building a Web-based administration module to retrieve and modify entries from the LDAP directory tree. Read the article .

Please discuss this article in this thread. You can read the article here (http://www.devshed.com/c/a/PHP/Using-PHP-With-LDAP-part-2).

Posted by: Anonymous User
Subject: Great Article
Date: 04-13-2003 15:20:46 MST

I liked this article a lot. The only problem I had with it was the modify.php only lets you modify the names. If you try to edit the email address, it fails because you cannot change the identifier it is using to identify the proper entry. If this were fixed/changed, it'd be great. That's what I'm trying to figure out how to do now.

Brian

Name: Anonymous User
Subject: Re: Great Article (I figured it out)
Date: 04-13-2003 16:46:45 MST

Okay, I worked around the aforementioned inability to edit email addresses.

In edit.php, I put an extra variable to pass to modify.php:

<input type="hidden" name="mailorig" size="20" value="<?php echo $info[0]["mail"][0]; ?>">


In modify.php, I changed this:

// prepare DN
$dn = "mail=" . $_POST['mail'] . ", dc=my-domain, dc=net";


to this ...:

// prepare DN
$dn = "mail=" . $_POST['mailorig'] . ", dc=my-domain, dc=net";


Harish, I hope you change this in your article. Otherwise, I found it MOST useful. Thank you!

Brian

If you would like to see an article covering a particular topic, please post your request here (http://forums.devshed.com/forumdisplay.php?s=&forumid=65).










privacy (GDPR)