1<?php 2require_once 'connect.inc'; 3 4function skipifunsupportedcontrol($oid) 5{ 6 global $uri, $user, $passwd, $protocol_version, $base; 7 $link = ldap_connect_and_bind($uri, $user, $passwd, $protocol_version); 8 $result = ldap_read($link, '', '(objectClass=*)', ['supportedControl']); 9 if (!in_array($oid, ldap_get_entries($link, $result)[0]['supportedcontrol'])) { 10 die(sprintf("skip Unsupported control %s", $oid)); 11 } 12} 13?> 14