1--TEST--
2ldap_exop_passwd() - Changing password through EXOP
3--CREDITS--
4Côme Chilliet <mcmic@php.net>
5--SKIPIF--
6<?php require_once('skipif.inc'); ?>
7<?php require_once('skipifbindfailure.inc'); ?>
8--FILE--
9<?php
10require "connect.inc";
11
12$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
13insert_dummy_data($link, $base);
14
15// ldap_exop_passwd() allows to pass the DN, OLD and NEW passwords,
16// and optionally returns the NEW password if none was passed.
17// ldap_exop_passwd(resource link [, string user [, string oldpw [, string newpw [, string newpasswd ]]]])
18var_dump(
19  $genpw = ldap_exop_passwd($link, "cn=userA,$base", "oops", "", $ctrls),
20  $ctrls,
21  $genpw = ldap_exop_passwd($link, "cn=userA,$base"),
22  test_bind($host, $port, "cn=userA,$base", $genpw, $protocol_version),
23  ldap_exop_passwd($link, "cn=userA,$base", $genpw, "newPassword"),
24  test_bind($host, $port, "cn=userA,$base", "newPassword", $protocol_version)
25);
26?>
27--CLEAN--
28<?php
29require "connect.inc";
30
31$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
32
33remove_dummy_data($link, $base);
34?>
35--EXPECTF--
36string(%d) "%s"
37array(0) {
38}
39string(%d) "%s"
40bool(true)
41bool(true)
42bool(true)
43