summaryrefslogtreecommitdiff
path: root/ext/ldap
diff options
context:
space:
mode:
authorStig Venaas <venaas@php.net>2002-06-22 15:41:39 +0000
committerStig Venaas <venaas@php.net>2002-06-22 15:41:39 +0000
commit58ce28e58893b8846e2f0c1a53020dcf877e6b8b (patch)
tree6cb107ca1ac1c1f36db834e64cfc105ee9ceb83e /ext/ldap
parentd279a9224232674a969ba35ae34f75c4bb48c7ab (diff)
downloadphp-git-58ce28e58893b8846e2f0c1a53020dcf877e6b8b.tar.gz
Better not include ldap_parse_result() and ldap_start_tls() at all in
the symbol table when they are not usable. Makes it possible to check on their usability.
Diffstat (limited to 'ext/ldap')
-rw-r--r--ext/ldap/ldap.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c
index 5d8b03559f..6706c27760 100644
--- a/ext/ldap/ldap.c
+++ b/ext/ldap/ldap.c
@@ -119,13 +119,14 @@ function_entry ldap_functions[] = {
PHP_FE(ldap_parse_result, arg3to6of6_force_ref)
PHP_FE(ldap_first_reference, NULL)
PHP_FE(ldap_next_reference, NULL)
+#ifdef HAVE_LDAP_PARSE_REFERENCE
PHP_FE(ldap_parse_reference, third_argument_force_ref)
- PHP_FE(ldap_rename, NULL)
#endif
-
-#if LDAP_API_VERSION > 2000
+ PHP_FE(ldap_rename, NULL)
+#ifdef HAVE_LDAP_START_TLS_S
PHP_FE(ldap_start_tls, NULL)
#endif
+#endif
#if defined(LDAP_API_FEATURE_X_OPENLDAP) && defined(HAVE_3ARG_SETREBINDPROC)
PHP_FE(ldap_set_rebind_proc, NULL)
@@ -1942,11 +1943,11 @@ PHP_FUNCTION(ldap_next_reference)
}
/* }}} */
+#ifdef HAVE_LDAP_PARSE_REFERENCE
/* {{{ proto bool ldap_parse_reference(resource link, resource reference_entry, array referrals)
Extract information from reference entry */
PHP_FUNCTION(ldap_parse_reference)
{
-#ifdef HAVE_LDAP_PARSE_REFERENCE
pval **link, **result_entry, **referrals;
ldap_linkdata *ld;
ldap_resultentry *resultentry;
@@ -1978,12 +1979,9 @@ PHP_FUNCTION(ldap_parse_reference)
ldap_value_free(lreferrals);
}
RETURN_TRUE;
-#else
- php_error(E_ERROR, "ldap_parse_reference not available in this LDAP lib");
- RETURN_FALSE;
-#endif
}
/* }}} */
+#endif
/* {{{ proto bool ldap_rename(resource link, string dn, string newrdn, string newparent, boolean deleteoldrdn);
Modify the name of an entry */
@@ -2021,14 +2019,12 @@ PHP_FUNCTION(ldap_rename)
RETURN_FALSE;
}
/* }}} */
-#endif
-#if LDAP_API_VERSION > 2000
+#ifdef HAVE_LDAP_START_TLS_S
/* {{{ proto bool ldap_start_tls(resource link)
Start TLS */
PHP_FUNCTION(ldap_start_tls)
{
-#ifdef HAVE_LDAP_START_TLS_S
pval **link;
ldap_linkdata *ld;
@@ -2045,13 +2041,10 @@ PHP_FUNCTION(ldap_start_tls)
} else {
RETURN_TRUE;
}
-#else
- php_error(E_ERROR, "ldap_start_tls not available in this LDAP library");
- RETURN_FALSE;
-#endif
}
/* }}} */
#endif
+#endif /* ( LDAP_API_VERSION > 2000 ) || HAVE_NSLDAP */
#if defined(LDAP_API_FEATURE_X_OPENLDAP) && defined(HAVE_3ARG_SETREBINDPROC)