1--TEST--
2ldap_exop_passwd() - Changing password through EXOP
3--CREDITS--
4Côme Chilliet <mcmic@php.net>
5--EXTENSIONS--
6ldap
7--SKIPIF--
8<?php require_once('skipifbindfailure.inc'); ?>
9--FILE--
10<?php
11require "connect.inc";
12
13$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
14insert_dummy_data($link, $base);
15
16// ldap_exop_passwd() allows to pass the DN, OLD and NEW passwords,
17// and optionally returns the NEW password if none was passed.
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