]> granicus.if.org Git - php/commitdiff
Added test for ldap_start_tls_s()
authorStig Venaas <venaas@php.net>
Sat, 22 Jun 2002 11:41:36 +0000 (11:41 +0000)
committerStig Venaas <venaas@php.net>
Sat, 22 Jun 2002 11:41:36 +0000 (11:41 +0000)
ext/ldap/config.m4
ext/ldap/ldap.c

index ab9de937e54e89f7bcf976960f94c2cc8a064998..2113ca29613f92efed2e57daab6cf878d310f004 100644 (file)
@@ -103,6 +103,8 @@ if test "$PHP_LDAP" != "no"; then
   fi
   CPPFLAGS=$_SAVE_CPPFLAGS
 
-  dnl Solaris 2.8 claims to be 2004 API, but doesn't have ldap_parse_reference
+  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_reference)
+  AC_CHECK_FUNCS(ldap_start_tls_s)
 fi 
index 2cec061ff11cd53e13792fc150d18ca9f95a1707..5d8b03559fcc73c6ee3d8973723024b73521f5c6 100644 (file)
@@ -2028,6 +2028,7 @@ PHP_FUNCTION(ldap_rename)
    Start TLS */
 PHP_FUNCTION(ldap_start_tls)
 {
+#ifdef HAVE_LDAP_START_TLS_S
        pval **link;
        ldap_linkdata *ld;
 
@@ -2044,6 +2045,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