searchUsers($oUser->getUserName(), array ("dn")); if (count($aResults) > 1) { echo "retrieved " . count($aResults) . " matches for username=" + $oUser->getUserName(); } else { $sNewDN = $aResults[$oUser->getUserName()]["dn"]; // echo an update statement that sets the dn to the correct value echo "UPDATE users SET ldap_dn='" . $sNewDN . "' WHERE id=" . $oUser->getID(); } } echo "Change the configuration file to point to the new directory server-" . $sNewLdapServer; ?>