summaryrefslogtreecommitdiff
path: root/ext/ldap/tests/skipifcontrol.inc
blob: ff690068aeeb303b02ee11fa91a988436cd97db5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
<?php
require_once 'connect.inc';

function skipifunsupportedcontrol($oid)
{
    global $host, $port, $user, $passwd, $protocol_version, $base;
    $link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
    $result = ldap_read($link, '', '(objectClass=*)', ['supportedControl']);
    if (!in_array($oid, ldap_get_entries($link, $result)[0]['supportedcontrol'])) {
        die(sprintf("skip Unsupported control %s", $oid));
    }
}
?>