note 70136 added to function.ldap-mod-replace
| From: | erwann at zeflip dot com | Date: | Wed, 04 Oct 2006 17:41:21 +0000 |
| Subject: | note 70136 added to function.ldap-mod-replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-118037@lists.php.net to get a copy of this message | ||
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:");
$user = $ADSI->OpenDSObject("LDAP://".$server."/".$newuser_dn,
$adminuser, $adminpassword, 1);
$user->SetPassword($newuser_password);
$user->SetInfo();
// to activate a user
$ADSI = new COM("LDAP:");
$user = $ADSI->OpenDSObject("LDAP://".$server."/".$newuser_dn,
$adminuser, $adminpassword, 1);
$user->AccountDisabled = false;
$user->SetInfo();
?>
----
Server IP: 195.221.21.36
Probable Submitter: 81.56.220.187
----
Manual Page -- http://www.php.net/manual/en/function.ldap-mod-replace.php
Edit -- https://master.php.net/note/edit/70136
Del: integrated -- https://master.php.net/note/delete/70136/integrated
Del: useless -- https://master.php.net/note/delete/70136/useless
Del: bad code -- https://master.php.net/note/delete/70136/bad+code
Del: spam -- https://master.php.net/note/delete/70136/spam
Del: non-english -- https://master.php.net/note/delete/70136/non-english
Del: in docs -- https://master.php.net/note/delete/70136/in+docs
Del: other reasons-- https://master.php.net/note/delete/70136
Reject -- https://master.php.net/note/reject/70136
Search -- https://master.php.net/manage/user-notes.php