. Fixed bug #74941 (session fails to start after having headers sent).
(morozov)
+- LDAP:
+ . Added ldap_exop_refresh helper for EXOP REFRESH operation with dds overlay
+
- ODBC:
. Removed support for Birdstep. (Kalle)
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_result ldap_parse_reference ldap_start_tls_s ldap_control_find ldap_parse_extended_result ldap_extended_operation ldap_extended_operation_s ldap_passwd_s ldap_whoami_s])
+ AC_CHECK_FUNCS([ldap_parse_result ldap_parse_reference ldap_start_tls_s ldap_control_find ldap_parse_extended_result ldap_extended_operation ldap_extended_operation_s ldap_passwd_s ldap_whoami_s ldap_refresh_s])
dnl
dnl SASL check
AC_DEFINE('HAVE_LDAP_EXTENDED_OPERATION_S', 1);
AC_DEFINE('HAVE_LDAP_PASSWD_S', 1);
AC_DEFINE('HAVE_LDAP_WHOAMI_S', 1);
+ AC_DEFINE('HAVE_LDAP_REFRESH_S', 1);
AC_DEFINE('HAVE_LDAP_EXTENDED_OPERATION', 1);
} else {
}
/* }}} */
#endif
+
+#ifdef HAVE_LDAP_REFRESH_S
+/* {{{ proto bool|int ldap_exop_refresh(resource link , string dn , int ttl)
+ DDS refresh extended operation */
+PHP_FUNCTION(ldap_exop_refresh)
+{
+ zval *link, *dn, *ttl;
+ struct berval ldn;
+ ber_int_t lttl;
+ ber_int_t newttl;
+ ldap_linkdata *ld;
+ int rc;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rzz", &link, &dn, &ttl) != SUCCESS) {
+ WRONG_PARAM_COUNT;
+ }
+
+ if ((ld = (ldap_linkdata *)zend_fetch_resource(Z_RES_P(link), "ldap link", le_link)) == NULL) {
+ RETURN_FALSE;
+ }
+
+ convert_to_string_ex(dn);
+ ldn.bv_val = Z_STRVAL_P(dn);
+ ldn.bv_len = Z_STRLEN_P(dn);
+
+ convert_to_long_ex(ttl);
+ lttl = (ber_int_t)Z_LVAL_P(ttl);
+
+ rc = ldap_refresh_s(ld->link, &ldn, lttl, &newttl, NULL, NULL);
+ if (rc != LDAP_SUCCESS ) {
+ php_error_docref(NULL, E_WARNING, "Refresh extended operation failed: %s (%d)", ldap_err2string(rc), rc);
+ RETURN_FALSE;
+ }
+
+ RETURN_LONG(newttl);
+}
/* }}} */
+#endif
/* }}} */
ZEND_END_ARG_INFO()
#endif
+#ifdef HAVE_LDAP_REFRESH_S
+ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_exop_refresh, 0, 0, 3)
+ ZEND_ARG_INFO(0, link)
+ ZEND_ARG_INFO(0, dn)
+ ZEND_ARG_INFO(0, ttl)
+ZEND_END_ARG_INFO()
+#endif
+
#ifdef HAVE_LDAP_PARSE_EXTENDED_RESULT
ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_parse_exop, 0, 0, 4)
ZEND_ARG_INFO(0, link)
#ifdef HAVE_LDAP_WHOAMI_S
PHP_FE(ldap_exop_whoami, arginfo_ldap_exop_whoami)
#endif
+#ifdef HAVE_LDAP_REFRESH_S
+ PHP_FE(ldap_exop_refresh, arginfo_ldap_exop_refresh)
+#endif
#ifdef HAVE_LDAP_PARSE_EXTENDED_RESULT
PHP_FE(ldap_parse_exop, arginfo_ldap_parse_exop)
#endif
--- /dev/null
+--TEST--
+ldap_exop_refresh() - Test LDAP refresh extended operation
+--CREDITS--
+Emmanuel Dreyfus <manu@netbsd.org>
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+<?php require_once('skipifbindfailure.inc'); ?>
+<?php
+ $link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
+ $r = ldap_read($link, '', 'objectClass=*', array('dynamicsubtrees')),
+ $info = ldap_get_entries($link, $r)[0];
+ if (!isset($info['dynamicsubtrees'])) {
+ die("Overlay DDS not available");
+ }
+?>
+--FILE--
+<?php
+require "connect.inc";
+
+$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
+
+insert_dummy_data($link, $base);
+ldap_add($link, "cn=tmp,$base", array(
+ "objectclass" => array("person", "dynamicObject"),
+ "cn" => "tmp",
+ "sn" => "tmp"
+));
+var_dump(
+ ldap_exop_refresh($link, "cn=tmp,$base", 1234)
+);
+?>
+===DONE===
+--CLEAN--
+<?php
+include "connect.inc";
+
+$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
+ldap_delete($link, "cn=tmp,$base");
+remove_dummy_data($link, $base);
+?>
+--EXPECTF--
+int(1234)
+===DONE===