cvs: php4 /ext/ldap config.m4 ldap.c
| From: | Stig Venaas | Date: | Tue, 25 Dec 2001 14:36:07 +0000 |
| Subject: | cvs: php4 /ext/ldap config.m4 ldap.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-8809@lists.php.net to get a copy of this message | ||
venaas Tue Dec 25 09:36:07 2001 EDT
Modified files:
/php4/ext/ldap config.m4 ldap.c
Log:
Added check for ldap_parse_reference() (needed for broken Solaris 2.8), and
report more detailed library version info in the info function.
Index: php4/ext/ldap/config.m4
diff -u php4/ext/ldap/config.m4:1.21 php4/ext/ldap/config.m4:1.22
--- php4/ext/ldap/config.m4:1.21 Fri Nov 30 13:59:42 2001
+++ php4/ext/ldap/config.m4 Tue Dec 25 09:36:06 2001
@@ -1,5 +1,5 @@
dnl
-dnl $Id: config.m4,v 1.21 2001/11/30 18:59:42 sniper Exp $
+dnl $Id: config.m4,v 1.22 2001/12/25 14:36:06 venaas Exp $
dnl
AC_DEFUN(PHP_LDAP_CHECKS, [
@@ -102,4 +102,7 @@
AC_DEFINE(HAVE_3ARG_SETREBINDPROC,1,[Whether 3 arg set_rebind_proc()])
fi
CPPFLAGS=$_SAVE_CPPFLAGS
+
+ dnl Solaris 2.8 claims to be 2004 API, but doesn't have ldap_parse_reference
+ AC_CHECK_FUNCS(ldap_parse_reference)
fi
Index: php4/ext/ldap/ldap.c
diff -u php4/ext/ldap/ldap.c:1.111 php4/ext/ldap/ldap.c:1.112
--- php4/ext/ldap/ldap.c:1.111 Sun Dec 23 11:32:06 2001
+++ php4/ext/ldap/ldap.c Tue Dec 25 09:36:06 2001
@@ -22,7 +22,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: ldap.c,v 1.111 2001/12/23 16:32:06 venaas Exp $ */
+/* $Id: ldap.c,v 1.112 2001/12/25 14:36:06 venaas Exp $ */
#define IS_EXT_MODULE
#ifdef HAVE_CONFIG_H
@@ -255,54 +255,57 @@
*/
PHP_MINFO_FUNCTION(ldap)
{
- char maxl[32];
-#ifdef LDAP_API_VERSION
- char ldapapiversion[32];
-#endif
-#if HAVE_NSLDAP
char tmp[32];
+#if HAVE_NSLDAP
LDAPVersion ver;
double SDKVersion;
#endif
-#if HAVE_NSLDAP
-/* Print version information */
- SDKVersion = ldap_version( &ver );
-#endif
+ php_info_print_table_start();
+ php_info_print_table_row(2, "LDAP Support", "enabled" );
+ php_info_print_table_row(2, "RCS Version", "$Id: ldap.c,v 1.112 2001/12/25 14:36:06
venaas Exp $" );
if (LDAPG(max_links) == -1) {
- snprintf(maxl, 31, "%ld/unlimited", LDAPG(num_links) );
+ snprintf(tmp, 31, "%ld/unlimited", LDAPG(num_links));
} else {
- snprintf(maxl, 31, "%ld/%ld", LDAPG(num_links), LDAPG(max_links));
+ snprintf(tmp, 31, "%ld/%ld", LDAPG(num_links), LDAPG(max_links));
}
- maxl[31] = 0;
-
- php_info_print_table_start();
- php_info_print_table_row(2, "LDAP Support", "enabled" );
- php_info_print_table_row(2, "RCS Version", "$Id: ldap.c,v 1.111 2001/12/23 16:32:06
venaas Exp $" );
- php_info_print_table_row(2, "Total Links", maxl );
+ tmp[31] = '\0';
+ php_info_print_table_row(2, "Total Links", tmp);
#ifdef LDAP_API_VERSION
- snprintf(ldapapiversion, 31, "%d", LDAP_API_VERSION);
- php_info_print_table_row(2, "API Version", ldapapiversion);
+ snprintf(tmp, 31, "%d", LDAP_API_VERSION);
+ tmp[31] = '\0';
+ php_info_print_table_row(2, "API Version", tmp);
+#endif
+
+#ifdef LDAP_VENDOR_NAME
+ php_info_print_table_row(2, "Vendor Name", LDAP_VENDOR_NAME);
+#endif
+
+#ifdef LDAP_VENDOR_VERSION
+ snprintf(tmp, 31, "%d", LDAP_VENDOR_VERSION);
+ tmp[31] = '\0';
+ php_info_print_table_row(2, "Vendor Version", tmp);
#endif
#if HAVE_NSLDAP
+ SDKVersion = ldap_version( &ver );
snprintf(tmp, 31, "%f", SDKVersion/100.0 );
- tmp[31]=0;
+ tmp[31] = '\0';
php_info_print_table_row(2, "SDK Version", tmp );
snprintf(tmp, 31, "%f", ver.protocol_version/100.0 );
- tmp[31]=0;
+ tmp[31] = '\0';
php_info_print_table_row(2, "Highest LDAP Protocol Supported", tmp );
snprintf(tmp, 31, "%f", ver.SSL_version/100.0 );
- tmp[31]=0;
+ tmp[31] = '\0';
php_info_print_table_row(2, "SSL Level Supported", tmp );
if ( ver.security_level != LDAP_SECURITY_NONE ) {
snprintf(tmp, 31, "%d", ver.security_level );
- tmp[31]=0;
+ tmp[31] = '\0';
} else {
strcpy(tmp, "SSL not enabled" );
}
@@ -310,7 +313,6 @@
#endif
php_info_print_table_end();
-
}
/* }}} */
@@ -1920,6 +1922,7 @@
Extract information from reference entry */
PHP_FUNCTION(ldap_parse_reference)
{
+#ifdef HAVE_LDAP_PARSE_REFERENCE
pval **link, **result_entry, **referrals;
ldap_linkdata *ld;
LDAPMessage *ldap_result_entry;
@@ -1951,6 +1954,10 @@
ldap_value_free(lreferrals);
}
RETURN_TRUE;
+#else
+ php_error(E_ERROR, "ldap_parse_reference not available in this LDAP lib");
+ RETURN_FALSE;
+#endif
}
/* }}} */