cvs: php4 /ext/ldap ldap.c

From: Date: Sun, 20 Aug 2000 18:47:14 +0000
Subject: cvs: php4 /ext/ldap ldap.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-1270@lists.php.net to get a copy of this message
venaas Sun Aug 20 11:47:14 2000 EDT Modified files: /php4/ext/ldap ldap.c Log: Added Oracle LDAP SDK SSL support Index: php4/ext/ldap/ldap.c diff -u php4/ext/ldap/ldap.c:1.59 php4/ext/ldap/ldap.c:1.60 --- php4/ext/ldap/ldap.c:1.59 Sun Aug 6 20:18:00 2000 +++ php4/ext/ldap/ldap.c Sun Aug 20 11:47:14 2000 @@ -22,7 +22,7 @@ */ -/* $Id: ldap.c,v 1.59 2000/08/07 03:18:00 hirokawa Exp $ */ +/* $Id: ldap.c,v 1.60 2000/08/20 18:47:14 venaas Exp $ */ #define IS_EXT_MODULE #include "php.h" @@ -151,6 +151,11 @@ REGISTER_MAIN_LONG_CONSTANT("LDAP_DEREF_SEARCHING", LDAP_DEREF_SEARCHING, CONST_PERSISTENT | CONST_CS); REGISTER_MAIN_LONG_CONSTANT("LDAP_DEREF_FINDING", LDAP_DEREF_FINDING, CONST_PERSISTENT | CONST_CS); REGISTER_MAIN_LONG_CONSTANT("LDAP_DEREF_ALWAYS", LDAP_DEREF_ALWAYS, CONST_PERSISTENT | CONST_CS); +#ifdef ORALDAP + REGISTER_MAIN_LONG_CONSTANT("GSLC_SSL_NO_AUTH", GSLC_SSL_NO_AUTH, CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_LONG_CONSTANT("GSLC_SSL_ONEWAY_AUTH", GSLC_SSL_ONEWAY_AUTH, CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_LONG_CONSTANT("GSLC_SSL_TWOWAY_AUTH", GSLC_SSL_TWOWAY_AUTH, CONST_PERSISTENT | CONST_CS); +#endif le_result = register_list_destructors(_free_ldap_result, NULL); le_link = register_list_destructors(_close_ldap_link, NULL); @@ -195,7 +200,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.59 2000/08/07 03:18:00 hirokawa Exp $" ); + php_info_print_table_row(2, "RCS Version", "$Id: ldap.c,v 1.60 2000/08/20 18:47:14 venaas Exp $" ); php_info_print_table_row(2, "Total Links", maxl ); #ifdef LDAP_API_VERSION snprintf(ldapapiversion, 31, "%ld", LDAP_API_VERSION); @@ -236,6 +241,11 @@ { char *host; int port; +#ifdef HAVE_ORALDAP + char *wallet, *walletpasswd; + int authmode; + int ssl=0; +#endif /* char *hashed_details; int hashed_details_length;*/ LDAP *ldap; @@ -284,7 +294,35 @@ sprintf(hashed_details, "ldap_%s", yyhost->value.str.val);*/ } break; +#ifdef HAVE_ORALDAP + + case 5: { + pval **yyhost, **yyport, **yywallet, + **yywalletpasswd, **yyauthmode; + + if (zend_get_parameters_ex(5, &yyhost, &yyport, + &yywallet, + &yywalletpasswd, + &yyauthmode) + == FAILURE) { + RETURN_FALSE; + } + convert_to_string_ex(yyhost); + host = (*yyhost)->value.str.val; + convert_to_long_ex(yyport); + port = (*yyport)->value.lval; + convert_to_string_ex(yywallet); + wallet = (*yywallet)->value.str.val; + convert_to_string_ex(yywalletpasswd); + walletpasswd = (*yywalletpasswd)->value.str.val; + convert_to_long_ex(yyauthmode); + authmode = (*yyauthmode)->value.lval; + ssl = 1; + } + break; +#endif + default: WRONG_PARAM_COUNT; break; @@ -299,6 +337,15 @@ if ( ldap == NULL ) { RETURN_FALSE; } else { +#ifdef HAVE_ORALDAP + if (ssl) { + if (ldap_init_SSL(&ldap->ld_sb, wallet, walletpasswd, + authmode)) { + php_error(E_WARNING, "LDAP: SSL init failed"); + RETURN_FALSE; + } + } +#endif RETURN_LONG(zend_list_insert((void*)ldap,le_link)); }

« previous php.cvs (#1270) next »