0) { // we only care about the first dn $userDN = $allValues[0]["dn"]; // generate a bogus password to pass if the user doesn't give us one // this gets around systems that are anonymous search enabled if (empty($passwd)) $passwd = crypt(microtime()); // try to bind as the user with user suplied password if (ldap_bind($ldap,$userDN, $passwd)) return True; } // Turn error reporting back to normal error_reporting(7); // dn not found or password wrong return False; } function change_password($old_passwd, $new_passwd) { global $phpgw_info, $phpgw; $ldap = $phpgw->common->ldapConnect(); $encrypted_passwd = $phpgw->common->encrypt_password($new_passwd); $entry["userpassword"] = $encrypted_passwd; $entry["phpgw_lastpasswd_change"] = time(); $dn = $phpgw_info["user"]["account_dn"]; @ldap_modify($ldap, $dn, $entry); return $encrypted_passwd; } } ?>