hyanantha               Thu Oct 24 05:53:01 2002 EDT

  Modified files:              (Branch: PHP_4_2_0)
    /php4/ext/ldap      ldap.c 
  Log:
  NetWare related changes/modifications.
  
  
Index: php4/ext/ldap/ldap.c
diff -u php4/ext/ldap/ldap.c:1.116.2.2 php4/ext/ldap/ldap.c:1.116.2.3
--- php4/ext/ldap/ldap.c:1.116.2.2      Mon Sep 23 19:22:08 2002
+++ php4/ext/ldap/ldap.c        Thu Oct 24 05:53:01 2002
@@ -22,13 +22,19 @@
    +----------------------------------------------------------------------+
  */
  
-/* $Id: ldap.c,v 1.116.2.2 2002/09/23 23:22:08 sniper Exp $ */
+/* $Id: ldap.c,v 1.116.2.3 2002/10/24 09:53:01 hyanantha Exp $ */
 #define IS_EXT_MODULE
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
 
+/* Additional headers for NetWare */
+#if defined(NETWARE) && (NEW_LIBC)
+#include <sys/select.h>
+#include <sys/timeval.h>
+#endif
+
 #include "php.h"
 #include "php_ini.h"
 
@@ -118,9 +124,11 @@
        PHP_FE(ldap_rename,                                                            
         NULL)
 #endif
 
+#ifndef NETWARE                /* The below function not supported on NetWare */
 #if LDAP_API_VERSION > 2000
        PHP_FE(ldap_start_tls,                                                         
 NULL)
 #endif
+#endif /* NETWARE */
 
 #if defined(LDAP_API_FEATURE_X_OPENLDAP) && defined(HAVE_3ARG_SETREBINDPROC)
        PHP_FE(ldap_set_rebind_proc,                                            NULL)
@@ -263,7 +271,7 @@
 
        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.116.2.2 2002/09/23 
23:22:08 sniper Exp $" );
+       php_info_print_table_row(2, "RCS Version", "$Id: ldap.c,v 1.116.2.3 2002/10/24 
+09:53:01 hyanantha Exp $" );
 
        if (LDAPG(max_links) == -1) {
                snprintf(tmp, 31, "%ld/unlimited", LDAPG(num_links));
@@ -492,7 +500,16 @@
 
        ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, link, -1, "ldap link", le_link);
 
+#ifndef NETWARE
        if (ldap_bind_s(ld->link, ldap_bind_rdn, ldap_bind_pw, LDAP_AUTH_SIMPLE) != 
LDAP_SUCCESS) {
+#else
+       /*      The function ldap_bind_s has been deprecated on NetWare. If it is used 
+on NetWare,
+               it gives the result, but will also result in the display of warning 
+message
+               that gets displayed on the web browser.
+               ldap_simple_bind_s removes that warning.
+       */
+       if (ldap_simple_bind_s(ld->link, (const char *)ldap_bind_rdn, (const char 
+*)ldap_bind_pw) != LDAP_SUCCESS) {
+#endif
                php_error(E_WARNING, "LDAP:  Unable to bind to server: %s", 
ldap_err2string(_get_lderrno(ld->link)));
                RETURN_FALSE;
        } else {
@@ -1992,6 +2009,7 @@
 /* }}} */
 #endif
 
+#ifndef NETWARE                /* The below function not supported on NetWare */
 #if LDAP_API_VERSION > 2000
 /* {{{ proto bool ldap_start_tls(resource link)
    Start TLS */
@@ -2016,6 +2034,7 @@
 }
 /* }}} */
 #endif
+#endif /* NETWARE */
 
 
 #if defined(LDAP_API_FEATURE_X_OPENLDAP) && defined(HAVE_3ARG_SETREBINDPROC)



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to