Lines Matching refs:ld
126 static void ldap_link_free(ldap_linkdata *ld) in ldap_link_free() argument
130 ldap_destroy(ld->link); in ldap_link_free()
131 ld->link = NULL; in ldap_link_free()
134 zval_ptr_dtor(&ld->rebindproc); in ldap_link_free()
142 ldap_linkdata *ld = ldap_link_from_obj(obj); in ldap_link_free_obj() local
144 if (ld->link) { in ldap_link_free_obj()
145 ldap_link_free(ld); in ldap_link_free_obj()
148 zend_object_std_dtor(&ld->std); in ldap_link_free_obj()
221 #define VERIFY_LDAP_LINK_CONNECTED(ld) \ argument
223 if (!ld->link) { \
263 static void _php_ldap_control_to_array(LDAP *ld, LDAPControl* ctrl, zval* array, int request) in _php_ldap_control_to_array() argument
279 rc = ldap_parse_passwordpolicy_control(ld, ctrl, &expire, &grace, &pperr); in _php_ldap_control_to_array()
299 rc = ldap_parse_pageresponse_control(ld, ctrl, &lestimated, &lcookie); in _php_ldap_control_to_array()
362 rc = ldap_parse_sortresponse_control(ld, ctrl, &errcode, &attribute); in _php_ldap_control_to_array()
383 rc = ldap_parse_vlvresponse_control(ld, ctrl, &target, &count, &context, &errcode); in _php_ldap_control_to_array()
409 static int php_ldap_control_from_array(LDAP *ld, LDAPControl** ctrl, const HashTable *control_ht) in php_ldap_control_from_array() argument
465 rc = ldap_create_page_control_value(ld, pagesize, &cookie, &control_value); in php_ldap_control_from_array()
484 ldap_set_option(ld, LDAP_OPT_RESULT_CODE, &success); in php_ldap_control_from_array()
487 rc = ldap_create_assertion_control_value(ld, ZSTR_VAL(assert), &control_value); in php_ldap_control_from_array()
622 rc = ldap_create_sort_control_value(ld, sort_keys, &control_value); in php_ldap_control_from_array()
689 rc = ldap_create_vlv_control_value(ld, &vlvInfo, &control_value); in php_ldap_control_from_array()
750 static void _php_ldap_controls_to_array(LDAP *ld, LDAPControl** ctrls, zval* array, int request) in _php_ldap_controls_to_array() argument
765 _php_ldap_control_to_array(ld, *ctrlp, &tmp1, request); in _php_ldap_controls_to_array()
772 static LDAPControl** php_ldap_controls_from_array(LDAP *ld, const HashTable *controls, uint32_t arg… in php_ldap_controls_from_array() argument
789 if (php_ldap_control_from_array(ld, ctrlp, Z_ARRVAL_P(ctrlarray)) == LDAP_SUCCESS) { in php_ldap_controls_from_array()
948 ldap_linkdata *ld; in PHP_FUNCTION() local
982 ld = Z_LDAP_LINK_P(return_value); in PHP_FUNCTION()
1038 ld->link = ldap; in PHP_FUNCTION()
1053 ldap_linkdata *ld; in PHP_FUNCTION() local
1072 ld = Z_LDAP_LINK_P(return_value); in PHP_FUNCTION()
1108 ld->link = ldap; in PHP_FUNCTION()
1134 ldap_linkdata *ld; in PHP_FUNCTION() local
1141 ld = Z_LDAP_LINK_P(link); in PHP_FUNCTION()
1142 VERIFY_LDAP_LINK_CONNECTED(ld); in PHP_FUNCTION()
1152 rc = ldap_sasl_bind_s(ld->link, ldap_bind_dn, LDAP_SASL_SIMPLE, &cred, in PHP_FUNCTION()
1156 rc = ldap_simple_bind_s(ld->link, ldap_bind_dn, ldap_bind_pw); in PHP_FUNCTION()
1175 ldap_linkdata *ld; in PHP_FUNCTION() local
1185 ld = Z_LDAP_LINK_P(link); in PHP_FUNCTION()
1186 VERIFY_LDAP_LINK_CONNECTED(ld); in PHP_FUNCTION()
1189 lserverctrls = php_ldap_controls_from_array(ld->link, server_controls_ht, 4); in PHP_FUNCTION()
1204 rc = ldap_sasl_bind(ld->link, ldap_bind_dn, LDAP_SASL_SIMPLE, &cred, in PHP_FUNCTION()
1212 rc = ldap_result(ld->link, msgid, 1 /* LDAP_MSG_ALL */, NULL, &ldap_res); in PHP_FUNCTION()
1244 static php_ldap_bictx *_php_sasl_setdefs(LDAP *ld, char *sasl_mech, char *sasl_realm, char *sasl_au… in _php_sasl_setdefs() argument
1256 ldap_get_option(ld, LDAP_OPT_X_SASL_MECH, &ctx->mech); in _php_sasl_setdefs()
1259 ldap_get_option(ld, LDAP_OPT_X_SASL_REALM, &ctx->realm); in _php_sasl_setdefs()
1262 ldap_get_option(ld, LDAP_OPT_X_SASL_AUTHCID, &ctx->authcid); in _php_sasl_setdefs()
1265 ldap_get_option(ld, LDAP_OPT_X_SASL_AUTHZID, &ctx->authzid); in _php_sasl_setdefs()
1286 static int _php_sasl_interact(LDAP *ld, unsigned flags, void *defaults, void *in) in _php_sasl_interact() argument
1321 ldap_linkdata *ld; in PHP_FUNCTION() local
1347 ld = Z_LDAP_LINK_P(link); in PHP_FUNCTION()
1348 VERIFY_LDAP_LINK_CONNECTED(ld); in PHP_FUNCTION()
1350 ctx = _php_sasl_setdefs(ld->link, sasl_mech, sasl_realm, sasl_authc_id, passwd, sasl_authz_id); in PHP_FUNCTION()
1353 ldap_set_option(ld->link, LDAP_OPT_X_SASL_SECPROPS, props); in PHP_FUNCTION()
1356 …rc = ldap_sasl_interactive_bind_s(ld->link, binddn, ctx->mech, NULL, NULL, LDAP_SASL_QUIET, _php_s… in PHP_FUNCTION()
1372 ldap_linkdata *ld; in PHP_FUNCTION() local
1378 ld = Z_LDAP_LINK_P(link); in PHP_FUNCTION()
1379 VERIFY_LDAP_LINK_CONNECTED(ld); in PHP_FUNCTION()
1381 ldap_link_free(ld); in PHP_FUNCTION()
1436 ldap_linkdata *ld = NULL; in php_ldap_do_search() local
1669 ld = Z_LDAP_LINK_P(link); in php_ldap_do_search()
1670 if (!ld->link) { in php_ldap_do_search()
1689 lserverctrls = php_ldap_controls_from_array(ld->link, server_controls_ht, 9); in php_ldap_do_search()
1696 …php_set_opts(ld->link, ldap_sizelimit, ldap_timelimit, ldap_deref, &old_ldap_sizelimit, &old_ldap_… in php_ldap_do_search()
1699 …ldap_errno = ldap_search_ext_s(ld->link, ZSTR_VAL(base_dn_str), scope, ZSTR_VAL(filter_str), ldap_… in php_ldap_do_search()
1735 if (ld) { in php_ldap_do_search()
1737 …php_set_opts(ld->link, old_ldap_sizelimit, old_ldap_timelimit, old_ldap_deref, &ldap_sizelimit, &l… in php_ldap_do_search()
1795 ldap_linkdata *ld; in PHP_FUNCTION() local
1802 ld = Z_LDAP_LINK_P(link); in PHP_FUNCTION()
1803 VERIFY_LDAP_LINK_CONNECTED(ld); in PHP_FUNCTION()
1808 RETURN_LONG(ldap_count_entries(ld->link, ldap_result->result)); in PHP_FUNCTION()
1816 ldap_linkdata *ld; in PHP_FUNCTION() local
1825 ld = Z_LDAP_LINK_P(link); in PHP_FUNCTION()
1826 VERIFY_LDAP_LINK_CONNECTED(ld); in PHP_FUNCTION()
1831 if ((entry = ldap_first_entry(ld->link, ldap_result->result)) == NULL) { in PHP_FUNCTION()
1847 ldap_linkdata *ld; in PHP_FUNCTION() local
1855 ld = Z_LDAP_LINK_P(link); in PHP_FUNCTION()
1856 VERIFY_LDAP_LINK_CONNECTED(ld); in PHP_FUNCTION()
1860 if ((entry_next = ldap_next_entry(ld->link, resultentry->data)) == NULL) { in PHP_FUNCTION()
1879 ldap_linkdata *ld; in PHP_FUNCTION() local
1892 ld = Z_LDAP_LINK_P(link); in PHP_FUNCTION()
1893 VERIFY_LDAP_LINK_CONNECTED(ld); in PHP_FUNCTION()
1898 ldap = ld->link; in PHP_FUNCTION()
1977 ldap_linkdata *ld; in PHP_FUNCTION() local
1985 ld = Z_LDAP_LINK_P(link); in PHP_FUNCTION()
1986 VERIFY_LDAP_LINK_CONNECTED(ld); in PHP_FUNCTION()
1990 if ((attribute = ldap_first_attribute(ld->link, resultentry->data, &resultentry->ber)) == NULL) { in PHP_FUNCTION()
2005 ldap_linkdata *ld; in PHP_FUNCTION() local
2013 ld = Z_LDAP_LINK_P(link); in PHP_FUNCTION()
2014 VERIFY_LDAP_LINK_CONNECTED(ld); in PHP_FUNCTION()
2023 if ((attribute = ldap_next_attribute(ld->link, resultentry->data, resultentry->ber)) == NULL) { in PHP_FUNCTION()
2045 ldap_linkdata *ld; in PHP_FUNCTION() local
2056 ld = Z_LDAP_LINK_P(link); in PHP_FUNCTION()
2057 VERIFY_LDAP_LINK_CONNECTED(ld); in PHP_FUNCTION()
2064 attribute = ldap_first_attribute(ld->link, resultentry->data, &ber); in PHP_FUNCTION()
2066 ldap_value = ldap_get_values_len(ld->link, resultentry->data, attribute); in PHP_FUNCTION()
2083 attribute = ldap_next_attribute(ld->link, resultentry->data, ber); in PHP_FUNCTION()
2099 ldap_linkdata *ld; in PHP_FUNCTION() local
2110 ld = Z_LDAP_LINK_P(link); in PHP_FUNCTION()
2111 VERIFY_LDAP_LINK_CONNECTED(ld); in PHP_FUNCTION()
2115 if ((ldap_value_len = ldap_get_values_len(ld->link, resultentry->data, attr)) == NULL) { in PHP_FUNCTION()
2116 …LL, E_WARNING, "Cannot get the value(s) of attribute %s", ldap_err2string(_get_lderrno(ld->link))); in PHP_FUNCTION()
2137 ldap_linkdata *ld; in PHP_FUNCTION() local
2145 ld = Z_LDAP_LINK_P(link); in PHP_FUNCTION()
2146 VERIFY_LDAP_LINK_CONNECTED(ld); in PHP_FUNCTION()
2150 text = ldap_get_dn(ld->link, resultentry->data); in PHP_FUNCTION()
2221 ldap_linkdata *ld; in php_ldap_do_modify() local
2236 ld = Z_LDAP_LINK_P(link); in php_ldap_do_modify()
2237 VERIFY_LDAP_LINK_CONNECTED(ld); in php_ldap_do_modify()
2336 lserverctrls = php_ldap_controls_from_array(ld->link, server_controls_ht, 4); in php_ldap_do_modify()
2348 ldap_status_code = ldap_add_ext(ld->link, dn, ldap_mods, lserverctrls, NULL, &msgid); in php_ldap_do_modify()
2350 ldap_status_code = ldap_add_ext_s(ld->link, dn, ldap_mods, lserverctrls, NULL); in php_ldap_do_modify()
2356 ldap_status_code = ldap_result(ld->link, msgid, 1 /* LDAP_MSG_ALL */, NULL, &ldap_res); in php_ldap_do_modify()
2370 ldap_status_code = ldap_modify_ext(ld->link, dn, ldap_mods, lserverctrls, NULL, &msgid); in php_ldap_do_modify()
2372 ldap_status_code = ldap_modify_ext_s(ld->link, dn, ldap_mods, lserverctrls, NULL); in php_ldap_do_modify()
2378 ldap_status_code = ldap_result(ld->link, msgid, 1 /* LDAP_MSG_ALL */, NULL, &ldap_res); in php_ldap_do_modify()
2479 ldap_linkdata *ld; in php_ldap_do_delete() local
2491 ld = Z_LDAP_LINK_P(link); in php_ldap_do_delete()
2492 VERIFY_LDAP_LINK_CONNECTED(ld); in php_ldap_do_delete()
2495 lserverctrls = php_ldap_controls_from_array(ld->link, server_controls_ht, 3); in php_ldap_do_delete()
2503 rc = ldap_delete_ext(ld->link, dn, lserverctrls, NULL, &msgid); in php_ldap_do_delete()
2505 rc = ldap_delete_ext_s(ld->link, dn, lserverctrls, NULL); in php_ldap_do_delete()
2512 rc = ldap_result(ld->link, msgid, 1 /* LDAP_MSG_ALL */, NULL, &ldap_res); in php_ldap_do_delete()
2588 ldap_linkdata *ld = Z_LDAP_LINK_P(link); in PHP_FUNCTION() local
2589 VERIFY_LDAP_LINK_CONNECTED(ld); in PHP_FUNCTION()
2701 lserverctrls = php_ldap_controls_from_array(ld->link, server_controls_ht, 4); in PHP_FUNCTION()
2782 int ldap_status = ldap_modify_ext_s(ld->link, dn, ldap_mods, lserverctrls, NULL); in PHP_FUNCTION()
2828 ldap_linkdata *ld; in PHP_FUNCTION() local
2834 ld = Z_LDAP_LINK_P(link); in PHP_FUNCTION()
2835 VERIFY_LDAP_LINK_CONNECTED(ld); in PHP_FUNCTION()
2837 RETURN_LONG(_get_lderrno(ld->link)); in PHP_FUNCTION()
2858 ldap_linkdata *ld; in PHP_FUNCTION() local
2865 ld = Z_LDAP_LINK_P(link); in PHP_FUNCTION()
2866 VERIFY_LDAP_LINK_CONNECTED(ld); in PHP_FUNCTION()
2868 ld_errno = _get_lderrno(ld->link); in PHP_FUNCTION()
2881 ldap_linkdata *ld; in PHP_FUNCTION() local
2896 ld = Z_LDAP_LINK_P(link); in PHP_FUNCTION()
2897 VERIFY_LDAP_LINK_CONNECTED(ld); in PHP_FUNCTION()
2900 lserverctrls = php_ldap_controls_from_array(ld->link, server_controls_ht, 5); in PHP_FUNCTION()
2907 ldap_errno = ldap_compare_ext_s(ld->link, dn, attr, &lvalue, lserverctrls, NULL); in PHP_FUNCTION()
2937 ldap_linkdata *ld; in PHP_FUNCTION() local
2944 ld = Z_LDAP_LINK_P(link); in PHP_FUNCTION()
2945 VERIFY_LDAP_LINK_CONNECTED(ld); in PHP_FUNCTION()
2981 if (ldap_get_option(ld->link, option, &val)) { in PHP_FUNCTION()
2991 if (ldap_get_option(ld->link, LDAP_OPT_NETWORK_TIMEOUT, (void *) &timeout)) { in PHP_FUNCTION()
3008 if (ldap_get_option(ld->link, LDAP_X_OPT_CONNECT_TIMEOUT, &timeout)) { in PHP_FUNCTION()
3019 if (ldap_get_option(ld->link, LDAP_OPT_TIMEOUT, (void *) &timeout)) { in PHP_FUNCTION()
3069 if (ldap_get_option(ld->link, option, &val) || val == NULL || *val == '\0') { in PHP_FUNCTION()
3083 if (ldap_get_option(ld->link, option, &ctrls) || ctrls == NULL) { in PHP_FUNCTION()
3089 _php_ldap_controls_to_array(ld->link, ctrls, retval, 1); in PHP_FUNCTION()
3107 ldap_linkdata *ld; in PHP_FUNCTION() local
3118 ld = Z_LDAP_LINK_P(link); in PHP_FUNCTION()
3119 VERIFY_LDAP_LINK_CONNECTED(ld); in PHP_FUNCTION()
3120 ldap = ld->link; in PHP_FUNCTION()
3307 ldap_linkdata *ld; in PHP_FUNCTION() local
3318 ld = Z_LDAP_LINK_P(link); in PHP_FUNCTION()
3319 VERIFY_LDAP_LINK_CONNECTED(ld); in PHP_FUNCTION()
3324 rc = ldap_parse_result(ld->link, ldap_result->result, &lerrcode, in PHP_FUNCTION()
3338 _php_ldap_controls_to_array(ld->link, lserverctrls, serverctrls, 0); in PHP_FUNCTION()
3382 ldap_linkdata *ld; in PHP_FUNCTION() local
3392 ld = Z_LDAP_LINK_P(link); in PHP_FUNCTION()
3393 VERIFY_LDAP_LINK_CONNECTED(ld); in PHP_FUNCTION()
3398 rc = ldap_parse_extended_result(ld->link, ldap_result->result, in PHP_FUNCTION()
3437 ldap_linkdata *ld; in PHP_FUNCTION() local
3444 ld = Z_LDAP_LINK_P(link); in PHP_FUNCTION()
3445 VERIFY_LDAP_LINK_CONNECTED(ld); in PHP_FUNCTION()
3450 RETURN_LONG(ldap_count_references(ld->link, ldap_result->result)); in PHP_FUNCTION()
3458 ldap_linkdata *ld; in PHP_FUNCTION() local
3467 ld = Z_LDAP_LINK_P(link); in PHP_FUNCTION()
3468 VERIFY_LDAP_LINK_CONNECTED(ld); in PHP_FUNCTION()
3473 if ((entry = ldap_first_reference(ld->link, ldap_result->result)) == NULL) { in PHP_FUNCTION()
3489 ldap_linkdata *ld; in PHP_FUNCTION() local
3497 ld = Z_LDAP_LINK_P(link); in PHP_FUNCTION()
3498 VERIFY_LDAP_LINK_CONNECTED(ld); in PHP_FUNCTION()
3502 if ((entry_next = ldap_next_reference(ld->link, resultentry->data)) == NULL) { in PHP_FUNCTION()
3519 ldap_linkdata *ld; in PHP_FUNCTION() local
3527 ld = Z_LDAP_LINK_P(link); in PHP_FUNCTION()
3528 VERIFY_LDAP_LINK_CONNECTED(ld); in PHP_FUNCTION()
3532 …if (ldap_parse_reference(ld->link, resultentry->data, &lreferrals, NULL /* &serverctrls */, 0) != … in PHP_FUNCTION()
3558 ldap_linkdata *ld; in php_ldap_do_rename() local
3572 ld = Z_LDAP_LINK_P(link); in php_ldap_do_rename()
3573 VERIFY_LDAP_LINK_CONNECTED(ld); in php_ldap_do_rename()
3581 lserverctrls = php_ldap_controls_from_array(ld->link, server_controls_ht, 6); in php_ldap_do_rename()
3589 rc = ldap_rename(ld->link, dn, newrdn, newparent, deleteoldrdn, lserverctrls, NULL, &msgid); in php_ldap_do_rename()
3591 rc = ldap_rename_s(ld->link, dn, newrdn, newparent, deleteoldrdn, lserverctrls, NULL); in php_ldap_do_rename()
3607 rc = ldap_modrdn2_s(ld->link, dn, newrdn, deleteoldrdn); in php_ldap_do_rename()
3613 rc = ldap_result(ld->link, msgid, 1 /* LDAP_MSG_ALL */, NULL, &ldap_res); in php_ldap_do_rename()
3656 ldap_linkdata *ld; in PHP_FUNCTION() local
3663 ld = Z_LDAP_LINK_P(link); in PHP_FUNCTION()
3664 VERIFY_LDAP_LINK_CONNECTED(ld); in PHP_FUNCTION()
3666 if (((rc = ldap_set_option(ld->link, LDAP_OPT_PROTOCOL_VERSION, &protocol)) != LDAP_SUCCESS) || in PHP_FUNCTION()
3667 ((rc = ldap_start_tls_s(ld->link, NULL, NULL)) != LDAP_SUCCESS) in PHP_FUNCTION()
3683 ldap_linkdata *ld = NULL; in _ldap_rebind_proc() local
3689 ld = Z_LDAP_LINK_P(cb_link); in _ldap_rebind_proc()
3690 if (!ld->link) { in _ldap_rebind_proc()
3696 if (Z_ISUNDEF(ld->rebindproc)) { in _ldap_rebind_proc()
3704 …if (call_user_function(EG(function_table), NULL, &ld->rebindproc, &cb_retval, 2, cb_args) == SUCCE… in _ldap_rebind_proc()
3722 ldap_linkdata *ld; in PHP_FUNCTION() local
3728 ld = Z_LDAP_LINK_P(link); in PHP_FUNCTION()
3729 VERIFY_LDAP_LINK_CONNECTED(ld); in PHP_FUNCTION()
3733 if (!Z_ISUNDEF(ld->rebindproc)) { in PHP_FUNCTION()
3734 zval_ptr_dtor(&ld->rebindproc); in PHP_FUNCTION()
3735 ZVAL_UNDEF(&ld->rebindproc); in PHP_FUNCTION()
3736 ldap_set_rebind_proc(ld->link, NULL, NULL); in PHP_FUNCTION()
3742 if (Z_ISUNDEF(ld->rebindproc)) { in PHP_FUNCTION()
3743 ldap_set_rebind_proc(ld->link, _ldap_rebind_proc, (void *) link); in PHP_FUNCTION()
3745 zval_ptr_dtor(&ld->rebindproc); in PHP_FUNCTION()
3748 ZVAL_COPY(&ld->rebindproc, &fci.function_name); in PHP_FUNCTION()
3909 ldap_linkdata *ld; in php_ldap_exop() local
3926 ld = Z_LDAP_LINK_P(link); in php_ldap_exop()
3927 VERIFY_LDAP_LINK_CONNECTED(ld); in php_ldap_exop()
3937 lserverctrls = php_ldap_controls_from_array(ld->link, server_controls_ht, 4); in php_ldap_exop()
3946 rc = ldap_extended_operation_s(ld->link, ZSTR_VAL(reqoid), in php_ldap_exop()
3980 rc = ldap_extended_operation(ld->link, ZSTR_VAL(reqoid), in php_ldap_exop()
3991 rc = ldap_result(ld->link, msgid, 1 /* LDAP_MSG_ALL */, NULL, &ldap_res); in php_ldap_exop()
4033 ldap_linkdata *ld; in PHP_FUNCTION() local
4041 ld = Z_LDAP_LINK_P(link); in PHP_FUNCTION()
4042 VERIFY_LDAP_LINK_CONNECTED(ld); in PHP_FUNCTION()
4046 if (ldap_create_passwordpolicy_control(ld->link, &ctrl) == LDAP_SUCCESS) { in PHP_FUNCTION()
4053 rc = ldap_passwd(ld->link, &luser, in PHP_FUNCTION()
4069 rc = ldap_result(ld->link, msgid, 1 /* LDAP_MSG_ALL */, NULL, &ldap_res); in PHP_FUNCTION()
4071 rc = _get_lderrno(ld->link); in PHP_FUNCTION()
4077 rc = ldap_parse_passwd(ld->link, ldap_res, &lgenpasswd); in PHP_FUNCTION()
4084 …rc = ldap_parse_result(ld->link, ldap_res, &err, NULL, &errmsg, NULL, (serverctrls ? &lserverctrls… in PHP_FUNCTION()
4092 _php_ldap_controls_to_array(ld->link, lserverctrls, serverctrls, 0); in PHP_FUNCTION()
4129 ldap_linkdata *ld; in PHP_FUNCTION() local
4136 ld = Z_LDAP_LINK_P(link); in PHP_FUNCTION()
4137 VERIFY_LDAP_LINK_CONNECTED(ld); in PHP_FUNCTION()
4140 rc = ldap_whoami_s(ld->link, &lauthzid, NULL, NULL); in PHP_FUNCTION()
4166 ldap_linkdata *ld; in PHP_FUNCTION() local
4173 ld = Z_LDAP_LINK_P(link); in PHP_FUNCTION()
4174 VERIFY_LDAP_LINK_CONNECTED(ld); in PHP_FUNCTION()
4178 rc = ldap_refresh_s(ld->link, &ldn, lttl, &newttl, NULL, NULL); in PHP_FUNCTION()