php[tek] 2018 : Call for Speakers

ldap_mod_replace

(PHP 4, PHP 5)

ldap_mod_replaceReplace attribute values with new ones

Description

bool ldap_mod_replace ( resource $link_identifier , string $dn , array $entry )

Replaces one or more attributes from the specified dn. It performs the modification at the attribute level as opposed to the object level. Object-level modifications are done by the ldap_modify() function.

Parameters

link_identifier

An LDAP link identifier, returned by ldap_connect().

dn

The distinguished name of an LDAP entity.

entry

Return Values

Returns TRUE on success or FALSE on failure.

Notes

Note: This function is binary-safe.

See Also

add a note add a note

User Contributed Notes 13 notes

up
6
erwann at zeflip dot com
11 years ago
If you do not wish to set up SSL on your active directory, and you are running on Windows, you can use COM and ADSI to set the new password for a user, or to active a user:

<?PHP
// to set a user password
  // server is the ldap server
  // newuser_dn is the full dn of the user you want to modify
  // newuser_password is the password you wish to set for the user

   
$ADSI = new COM("LDAP:")dV) full an>$ADSI h to set for the user

&an>$ADS->h to set for the user
= new
COM(((((<"keyword">(("LDAP:")dV) fullan>$ADS->h to set for the user
<"keyword">(
COM<"keyword">(
"LDAP:")dV) fullan>$ADS->h to set for the user
(
&lADSI >
   
$ADSI = new COM("LDAP:")dV) full an>$ADSI h to set for the user

&an>$ADS->h to set for the user
= new
COM(((((<"keyword">(("LDAP:")dV) fullan>$ADS->h to set for the user
$ADSI h to set for the user
$ADS="string">"LDAP:")dV) fullan>$ADS->h to set for the user
(
up
up