Download src/php/php-src/ext/ldap/tests/ldap_bind_ext.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 1.7 kB
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/ldap/tests/ldap_bind_ext.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/ldap/tests/ldap_bind_ext.phpt
-
curl -L -o ldap_bind_ext.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/ldap/tests/ldap_bind_ext.phpt
1.7 kB
| --TEST-- | |
| ldap_bind_ext() - Basic binding | |
| --CREDITS-- | |
| Côme Chilliet <mcmic@php.net> | |
| --EXTENSIONS-- | |
| ldap | |
| --SKIPIF-- | |
| require_once __DIR__ .'/skipifbindfailure.inc'; | |
| require_once('skipifcontrol.inc'); | |
| skipifunsupportedcontrol(LDAP_CONTROL_PASSWORDPOLICYREQUEST); | |
| --FILE-- | |
| require "connect.inc"; | |
| $link = ldap_connect($uri); | |
| ldap_set_option($link, LDAP_OPT_PROTOCOL_VERSION, $protocol_version); | |
| var_dump( | |
| $result = ldap_bind_ext($link, $user, $passwd), | |
| ldap_parse_result($link, $result, $errcode, $matcheddn, $errmsg, $referrals, $ctrls), | |
| $errcode, | |
| $errmsg, | |
| $ctrls, | |
| $result = ldap_bind_ext($link, $user, $passwd, [['oid' => LDAP_CONTROL_PASSWORDPOLICYREQUEST]]), | |
| ldap_parse_result($link, $result, $errcode, $matcheddn, $errmsg, $referrals, $ctrls), | |
| $errcode, | |
| $errmsg, | |
| $ctrls | |
| ); | |
| /* Failures */ | |
| var_dump( | |
| $result = ldap_bind_ext($link, $user, "wrongPassword", [['oid' => LDAP_CONTROL_PASSWORDPOLICYREQUEST]]), | |
| ldap_parse_result($link, $result, $errcode, $matcheddn, $errmsg, $referrals, $ctrls), | |
| $errcode, | |
| $errmsg, | |
| $ctrls, | |
| $result = ldap_bind_ext($link, "unexistingProperty=weirdValue,$user", $passwd, [['oid' => LDAP_CONTROL_PASSWORDPOLICYREQUEST]]), | |
| ldap_parse_result($link, $result, $errcode, $matcheddn, $errmsg, $referrals, $ctrls), | |
| $errcode, | |
| $errmsg, | |
| $ctrls | |
| ); | |
| --EXPECTF-- | |
| object(LDAP\Result)#%d (0) { | |
| } | |
| bool(true) | |
| int(0) | |
| string(0) "" | |
| array(0) { | |
| } | |
| object(LDAP\Result)#%d (0) { | |
| } | |
| bool(true) | |
| int(0) | |
| string(0) "" | |
| array(0) { | |
| } | |
| object(LDAP\Result)#%d (0) { | |
| } | |
| bool(true) | |
| int(49) | |
| string(0) "" | |
| array(0) { | |
| } | |
| object(LDAP\Result)#%d (0) { | |
| } | |
| bool(true) | |
| int(34) | |
| string(10) "invalid DN" | |
| array(0) { | |
| } | |