0

I'm trying to change user ldap passwords

heres the code

$ds = ldap_connect(LDAP_HOST, LDAP_PORT);
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
$bind = ldap_bind($ds, 'uid={admin},'.LDAP_BASEDN, '{admin password}');
$userpassword = "{SHA}" . base64_encode(sha1( '{password}', TRUE ));
$userdata = array("userPassword" => $userpassword);
$result = ldap_mod_replace($ds, 'uid={user},'.LDAP_BASEDN, $userdata);
ldap_close($ds);

$result returns true
i can even see the userpassword field change when i view the entry

but when i try to bind again using the new password it doesn't work, and the old password still works

running mac server 10.4

2
Contributors
2
Replies
14
Views
3 Years
Discussion Span
Last Post by diafol
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.