summaryrefslogtreecommitdiff
path: root/ext/ldap/ldap.c
diff options
context:
space:
mode:
authorAndreas Heigl <andreas@heigl.org>2015-05-05 21:30:29 +0200
committerCôme Bernigaud <mcmic@php.net>2015-06-17 15:39:07 +0200
commiteb702637a9a591d2b9da3a2f06d6c5437e8c3a7c (patch)
tree9358bb7a3c3155ec1ac82966eb03a7697fd0afd3 /ext/ldap/ldap.c
parente7af0fe1eb89e40671e86a588aa1b78607b85461 (diff)
downloadphp-git-eb702637a9a591d2b9da3a2f06d6c5437e8c3a7c.tar.gz
Implements extended error messages
This commit introduces a new constant that can be used to retrieve more detailed error messages. This fixes #47222 The new constant LDAP_OPT_DIAGNOSTIC_MESSAGE is defined in PHP when the underlying library provides (and understands) it. This is the case in the current OpenLDAP-implementation. Tanks to Johnny Willer who provided the solution at http://stackoverflow.com/questions/28765077/get-number-of-ad-errors-with-ldap-and-php-ldap-function-return-unprecise-error/28816473#28816473
Diffstat (limited to 'ext/ldap/ldap.c')
-rw-r--r--ext/ldap/ldap.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c
index fe09c9c277..5c6c481bc5 100644
--- a/ext/ldap/ldap.c
+++ b/ext/ldap/ldap.c
@@ -202,6 +202,10 @@ PHP_MINIT_FUNCTION(ldap)
REGISTER_LONG_CONSTANT("LDAP_OPT_DEBUG_LEVEL", LDAP_OPT_DEBUG_LEVEL, CONST_PERSISTENT | CONST_CS);
#endif
+#ifdef LDAP_OPT_DIAGNOSTIC_MESSAGE
+ REGISTER_LONG_CONSTANT("LDAP_OPT_DIAGNOSTIC_MESSAGE", LDAP_OPT_DIAGNOSTIC_MESSAGE, CONST_PERSISTENT | CONST_CS);
+#endif
+
#ifdef HAVE_LDAP_SASL
REGISTER_LONG_CONSTANT("LDAP_OPT_X_SASL_MECH", LDAP_OPT_X_SASL_MECH, CONST_PERSISTENT | CONST_CS);
REGISTER_LONG_CONSTANT("LDAP_OPT_X_SASL_REALM", LDAP_OPT_X_SASL_REALM, CONST_PERSISTENT | CONST_CS);