PHP Function LDAP_Set_Option
The php function ldap_set_option lets you set the value of an option. You can pass it a single option, an array of options, or even an LDAP
A new feature added to PHP 7.3 that simplifies JSON error handling is the ability to pass in a flag called JSON_THROW_ON_ERROR, which will cause the function to throw a JsonException whenever the error code returned by the json_encode() or json_decode() functions is not JSON_ERROR_NONE. PHP 7.3 also added support for samesite cookies, improved FastCGI Process Manager (php-fpm) logging, expanded LDAP controls, and provided case-mapping and case-folding support in mbstring functions.
Many LDAP server implementations require that you specify which LDAP protocol version to use, especially since LDAPv2 has been declared historical and deprecated and LDAPv3 is now the only viable option (LDAPv3 is also backwards-compatible with LDAPv2). This can be accomplished by using ldap_set_option(). In this article we will show how to use this function and a couple of other related functions in order to connect, bind, and then read entries from the LDAP directory server. We will also demonstrate how to intercept the LDAP query via Burpsuite and check whether the password was reset correctly.