break
fi
done
-
+
if test "$LDAP_SASL_DIR"; then
LDAP_SASL_INCDIR=$LDAP_SASL_DIR/include
LDAP_SASL_LIBDIR=$LDAP_SASL_DIR/$PHP_LIBDIR
else
SASL_LIB="-L$LDAP_SASL_LIBDIR -lsasl2"
fi
-
+
PHP_CHECK_LIBRARY(sasl2, sasl_version,
[
PHP_ADD_INCLUDE($LDAP_SASL_INCDIR)
if test "$PHP_LDAP" != "no"; then
- PHP_NEW_EXTENSION(ldap, ldap.c, $ext_shared,,-DLDAP_DEPRECATED=1)
+ PHP_NEW_EXTENSION(ldap, ldap.c, $ext_shared,,)
if test "$PHP_LDAP" = "yes"; then
for i in /usr/local /usr; do
PHP_ADD_LIBRARY_WITH_PATH(ldap, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
elif test -f $LDAP_LIBDIR/libssldap50.$SHLIB_SUFFIX_NAME; then
- if test -n "$LDAP_PTHREAD"; then
+ if test -n "$LDAP_PTHREAD"; then
PHP_ADD_LIBRARY($LDAP_PTHREAD)
fi
PHP_ADD_LIBRARY_WITH_PATH(nspr4, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
AC_DEFINE(HAVE_NSLDAP,1,[ ])
elif test -f $LDAP_LIBDIR/libldapssl41.$SHLIB_SUFFIX_NAME; then
- if test -n "$LDAP_PTHREAD"; then
+ if test -n "$LDAP_PTHREAD"; then
PHP_ADD_LIBRARY($LDAP_PTHREAD)
fi
PHP_ADD_LIBRARY_WITH_PATH(nspr3, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
AC_DEFINE(HAVE_NSLDAP,1,[ ])
elif test -f $LDAP_LIBDIR/libldapssl30.$SHLIB_SUFFIX_NAME; then
- if test -n "$LDAP_PTHREAD"; then
+ if test -n "$LDAP_PTHREAD"; then
PHP_ADD_LIBRARY($LDAP_PTHREAD)
fi
PHP_ADD_LIBRARY_WITH_PATH(ldapssl30, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
AC_DEFINE(HAVE_NSLDAP,1,[ ])
elif test -f $LDAP_LIBDIR/libldap30.$SHLIB_SUFFIX_NAME; then
- if test -n "$LDAP_PTHREAD"; then
+ if test -n "$LDAP_PTHREAD"; then
PHP_ADD_LIBRARY($LDAP_PTHREAD)
fi
PHP_ADD_LIBRARY_WITH_PATH(ldap30, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
PHP_ADD_INCLUDE($LDAP_INCDIR)
PHP_SUBST(LDAP_SHARED_LIBADD)
AC_DEFINE(HAVE_LDAP,1,[ ])
-
+
dnl Save original values
_SAVE_CPPFLAGS=$CPPFLAGS
_SAVE_LIBS=$LIBS
dnl Solaris 2.8 claims to be 2004 API, but doesn't have
dnl ldap_parse_reference() nor ldap_start_tls_s()
AC_CHECK_FUNCS([ldap_parse_result ldap_parse_reference ldap_start_tls_s])
-
+
dnl
dnl SASL check
dnl
dnl
dnl Sanity check
- dnl
+ dnl
AC_CHECK_FUNC(ldap_bind_s, [], [
- AC_MSG_ERROR([LDAP build check failed. Please check config.log for more information.])
+ AC_MSG_ERROR([LDAP build check failed. Please check config.log for more information.])
])
-
+
dnl Restore original values
CPPFLAGS=$_SAVE_CPPFLAGS
LIBS=$_SAVE_LIBS
-fi
+fi
typedef struct {
LDAP *link;
-#if defined(LDAP_API_FEATURE_X_OPENLDAP) && defined(HAVE_3ARG_SETREBINDPROC)
+#if defined(HAVE_3ARG_SETREBINDPROC)
zval *rebindproc;
#endif
} ldap_linkdata;
/* ldap_unbind_s() is deprecated;
* the distinction between ldap_unbind() and ldap_unbind_s() is moot */
-#ifdef LDAP_API_FEATURE_X_OPENLDAP
ldap_unbind_ext(ld->link, NULL, NULL);
#ifdef HAVE_3ARG_SETREBINDPROC
FREE_ZVAL(ld->rebindproc);
}
#endif
-#else /* ! LDAP_API_FEATURE_X_OPENLDAP */
- ldap_unbind_s(ld->link);
-#endif /* ! LDAP_API_FEATURE_X_OPENLDAP */
efree(ld);
LDAPG(num_links)--;
{
char *host = NULL;
int hostlen;
- long port =
-#ifdef LDAP_API_FEATURE_X_OPENLDAP
- LDAP_PORT
-#else /* ! LDAP_API_FEATURE_X_OPENLDAP */
- 389 /* Default port */
-#endif /* ! LDAP_API_FEATURE_X_OPENLDAP */
- ;
+ long port = LDAP_PORT;
#ifdef HAVE_ORALDAP
char *wallet = NULL, *walletpasswd = NULL;
int walletlen = 0, walletpasswdlen = 0;
ld = ecalloc(1, sizeof(ldap_linkdata));
-#ifdef LDAP_API_FEATURE_X_OPENLDAP
/* OpenLDAP provides a specific call to detect valid LDAP URIs;
* ldap_init()/ldap_open() is deprecated, use ldap_initialize() instead.
*/
RETURN_FALSE;
}
}
-#else /* ! LDAP_API_FEATURE_X_OPENLDAP */
- ldap = ldap_open(host, port);
-#endif /* ! LDAP_API_FEATURE_X_OPENLDAP */
if (ldap == NULL) {
efree(ld);
RETURN_FALSE;
}
-#ifdef LDAP_API_FEATURE_X_OPENLDAP
{
struct berval cred;
NULL, NULL, /* no controls right now */
NULL); /* we don't care about the server's credentials */
}
-#else
- rc = ldap_bind_s(ld->link, ldap_bind_dn, ldap_bind_pw, LDAP_AUTH_SIMPLE);
-#endif
if ( rc != LDAP_SUCCESS) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to bind to server: %s", ldap_err2string(rc));
RETURN_FALSE;
add_index_string(return_value, i, ldap_value[i], 1);
}
-#ifdef LDAP_API_FEATURE_X_OPENLDAP
/* ldap_value_free() is deprecated */
ber_memvfree((void **)ldap_value);
-#else /* ! LDAP_API_FEATURE_X_OPENLDAP */
- ldap_value_free(ldap_value);
-#endif /* ! LDAP_API_FEATURE_X_OPENLDAP */
}
/* }}} */
#endif
#endif /* (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP */
-#if defined(LDAP_API_FEATURE_X_OPENLDAP) && defined(HAVE_3ARG_SETREBINDPROC)
+#if defined(HAVE_3ARG_SETREBINDPROC)
/* {{{ _ldap_rebind_proc()
*/
int _ldap_rebind_proc(LDAP *ldap, const char *url, ber_tag_t req, ber_int_t msgid, void *params)
RETURN_FALSE;
}
- lctrl = ldap_find_control(LDAP_CONTROL_PAGEDRESULTS, lserverctrls);
+ lctrl = ldap_control_find(LDAP_CONTROL_PAGEDRESULTS, lserverctrls, NULL);
if (lctrl == NULL) {
ldap_controls_free(lserverctrls);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "No paged results control response in result");
#endif
#endif
-#if defined(LDAP_API_FEATURE_X_OPENLDAP) && defined(HAVE_3ARG_SETREBINDPROC)
+#if defined(HAVE_3ARG_SETREBINDPROC)
ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_set_rebind_proc, 0, 0, 2)
ZEND_ARG_INFO(0, link)
ZEND_ARG_INFO(0, callback)
#endif
#endif
-#if defined(LDAP_API_FEATURE_X_OPENLDAP) && defined(HAVE_3ARG_SETREBINDPROC)
+#if defined(HAVE_3ARG_SETREBINDPROC)
PHP_FE(ldap_set_rebind_proc, arginfo_ldap_set_rebind_proc)
#endif