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
$ADSI = new COM("LDAP:");
$user = $ADSI->OpenDSObject("LDAP://".$server."/".$newuser_dn, $adminuser, $adminpassword, 1);
$user->SetPassword($newuser_password);
$user->SetInfo();
$ADSI = new COM("LDAP:");
$user = $ADSI->OpenDSObject("LDAP://".$server."/".$newuser_dn, $adminuser, $adminpassword, 1);
$user->AccountDisabled = false;
$user->SetInfo();
?>