ldap_rename

From: Date: Fri, 24 Mar 2000 00:37:55 +0000
Subject: ldap_rename
Groups: php.dev 
Request: Send a blank email to php-dev+get-17183@lists.php.net to get a copy of this message
Hi, In response to a recent message pertaining to the ldap_rename function, I took the liberty of writing the following fix, it is untested, but it is simple enough that I don't see any problems (famous last words) with it, but I was hoping someone could perhaps test the fix and/or comment as to whether it would be a fix to perhaps add to the LDAP function set. Sterling Hughes sterling@designmultimedia.com

PHP_FUNCTION(ldap_rename) { zval **link, **old_dn, **new_dn, **new_parent, **delete_old; LDAP *ldap; int msgid = 0; int ret_tst; if (ARG_COUNT(ht) < 3 || ARG_COUNT(ht) > 5 || zend_get_parameters_ex(ht, &link, &old_dn, &new_dn, &new_parent, &delete_old) == FAILURE) { WRONG_PARAM_COUNT; } ldap = _get_ldap_link(link); switch (ARG_COUNT(ht)) { case '3': ret_tst = ldap_rename(ldap,(*old_dn)->value.str.val,(*new_dn)->value.str.val, NULL, 0, NULL, NULL, &msgid); break; case '4': ret_tst = ldap_rename(ldap, (*old_dn)->value.str.val, (*new_dn)->value.str.val, (*new_parent)->value.str.val, 0, NULL, NULL, &msgid); break; case '5': ret_tst = ldap_rename(ldap, (*old_dn)->value.str.val, (*new_dn)->value.str.val, (*new_parent)->value.str.val, (*delete_old)->value.lval, NULL, NULL, &msgid); break; } if (ret_tst == LDAP_SUCCESS) { RETURN_TRUE; } else { RETURN_FALSE; } }
« previous php.dev (#17183) next »