CVS update: php3/functions
| From: | rasmus | Date: | Wed, 04 Nov 1998 17:20:14 +0000 |
| Subject: | CVS update: php3/functions | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-2194@lists.php.net to get a copy of this message | ||
Date: Wednesday November 4, 1998 @ 12:20
Author: rasmus
Update of /repository/php3/functions
In directory asf:/u2/tmp/cvs-serv13320/functions
Modified Files:
ldap.c
Log Message:
Add support for current OpenLDAP-1.1-devel library
and update funclist
Index: php3/functions/ldap.c
diff -c php3/functions/ldap.c:1.58 php3/functions/ldap.c:1.59
*** php3/functions/ldap.c:1.58 Wed Sep 30 00:35:04 1998
--- php3/functions/ldap.c Wed Nov 4 12:20:12 1998
***************
*** 23,35 ****
| If you did not, or have any questions about PHP licensing, please |
| contact core@php.net. |
+----------------------------------------------------------------------+
! | Authors: Amitay Isaacs <amitay@w-o-i.com> |
! | Eric Warnke <ericw@albany.edu> |
+----------------------------------------------------------------------+
*/
! /* $Id: ldap.c,v 1.58 1998/09/30 04:35:04 amitay Exp $ */
#define IS_EXT_MODULE
#if !PHP_31 && defined(THREAD_SAFE)
#undef THREAD_SAFE
--- 23,36 ----
| If you did not, or have any questions about PHP licensing, please |
| contact core@php.net. |
+----------------------------------------------------------------------+
! | Authors: Amitay Isaacs <amitay@w-o-i.com> |
! | Eric Warnke <ericw@albany.edu> |
! | Rasmus Lerdorf <rasmus@lerdorf.on.ca> |
+----------------------------------------------------------------------+
*/
! /* $Id: ldap.c,v 1.59 1998/11/04 17:20:12 rasmus Exp $ */
#define IS_EXT_MODULE
#if !PHP_31 && defined(THREAD_SAFE)
#undef THREAD_SAFE
***************
*** 304,310 ****
php3_printf("<table>"
"<tr><td>Total links:</td><td>%d/%s</td></tr>\n"
! "<tr><td>RCS Version:</td><td>$Id: ldap.c,v 1.58 1998/09/30
04:35:04 amitay Exp $</td></tr>\n"
#if HAVE_NSLDAP
"<tr><td>SDK Version:</td><td>%f</td></tr>"
"<tr><td>Highest LDAP Protocol
Supported:</td><td>%f</td></tr>"
--- 305,311 ----
php3_printf("<table>"
"<tr><td>Total links:</td><td>%d/%s</td></tr>\n"
! "<tr><td>RCS Version:</td><td>$Id: ldap.c,v 1.59 1998/11/04
17:20:12 rasmus Exp $</td></tr>\n"
#if HAVE_NSLDAP
"<tr><td>SDK Version:</td><td>%f</td></tr>"
"<tr><td>Highest LDAP Protocol
Supported:</td><td>%f</td></tr>"
***************
*** 523,530 ****
--- 524,536 ----
if (ldap_bind_s(ldap, ldap_bind_rdn, ldap_bind_pw, LDAP_AUTH_SIMPLE) != LDAP_SUCCESS) {
#if !HAVE_NSLDAP
+ #if LDAP_API_VERSION > 2000
+ /* New versions of OpenLDAP do it this way */
+ php3_error(E_WARNING,"LDAP: Unable to bind to server:
%s",ldap_err2string(ldap_get_lderrno(ldap,NULL,NULL)));
+ #else
php3_error(E_WARNING,"LDAP: Unable to bind to server:
%s",ldap_err2string(ldap->ld_errno));
#endif
+ #endif
RETURN_FALSE;
} else {
RETURN_TRUE;
***************
*** 633,640 ****
--- 639,650 ----
if (ldap_search_s(ldap, ldap_base_dn, scope, ldap_filter, ldap_attrs, attrsonly,
&ldap_result) != LDAP_SUCCESS) {
#if !HAVE_NSLDAP
+ #if LDAP_API_VERSION > 2000
+ php3_error(E_WARNING,"LDAP: Unable to perform the search:
%s",ldap_err2string(ldap_get_lderrno(ldap,NULL,NULL)));
+ #else
php3_error(E_WARNING, "LDAP: Unable to perform the search: %s",
ldap_err2string(ldap->ld_errno));
#endif
+ #endif
RETVAL_FALSE;
} else {
RETVAL_LONG(php3_list_insert(ldap_result, LDAP_GLOBAL(le_result)));
***************
*** 726,732 ****
if (ldap_result == NULL) RETURN_FALSE;
if ((ldap_result_entry = ldap_first_entry(ldap, ldap_result)) == NULL) {
- /* php3_error(E_WARNING, "LDAP: Unable to read the entries from result : %s",
ldap_err2string(ldap->ld_errno));*/
RETURN_FALSE;
} else {
RETURN_LONG(php3_list_insert(ldap_result_entry, LDAP_GLOBAL(le_result_entry)));
--- 736,741 ----
***************
*** 752,758 ****
if (ldap_result_entry == NULL) RETURN_FALSE;
if ((ldap_result_entry_next = ldap_next_entry(ldap, ldap_result_entry)) == NULL) {
- /* php3_error(E_WARNING, "LDAP: Unable to read the entries from result : %s",
ldap_err2string(ldap->ld_errno));*/
RETURN_FALSE;
} else {
/* php3_list_delete(result->value.lval); */
--- 761,766 ----
***************
*** 862,868 ****
if (ldap_result_entry == NULL) RETURN_FALSE;
if ((attribute = ldap_first_attribute(ldap, ldap_result_entry, &ber)) == NULL) {
- /* php3_error(E_WARNING, "LDAP: Unable to read the attributes from entry : %s",
ldap_err2string(ldap->ld_errno)); */
RETURN_FALSE;
} else {
/* brep is passed by ref so we do not have to account for memory */
--- 870,875 ----
***************
*** 898,904 ****
ber = _get_ber_entry(berp,list);
if ((attribute = ldap_next_attribute(ldap, ldap_result_entry, ber)) == NULL) {
- /* php3_error(E_WARNING, "LDAP: Unable to read the attributes from entry : %s",
ldap_err2string(ldap->ld_errno)); */
RETURN_FALSE;
} else {
RETVAL_STRING(attribute,1);
--- 905,910 ----
***************
*** 988,994 ****
--- 994,1004 ----
if ((ldap_value = ldap_get_values(ldap, ldap_result_entry, attribute)) == NULL) {
#if !HAVE_NSLDAP
+ #if LDAP_API_VERSION > 2000
+ php3_error(E_WARNING, "LDAP: Cannot get the value(s) of attribute %s",
ldap_err2string(ldap_get_lderrno(ldap,NULL,NULL)));
+ #else
php3_error(E_WARNING, "LDAP: Cannot get the value(s) of attribute %s",
ldap_err2string(ldap->ld_errno));
+ #endif
#endif
RETURN_FALSE;
}
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net