LDAP controls in response
| From: | Pierangelo Masarati | Date: | Tue, 08 Nov 2005 21:28:35 +0000 |
| Subject: | LDAP controls in response | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-19927@lists.php.net to get a copy of this message | ||
Stig,
I need to use LDAP controls in PHP, including control response from
server to client, so I patched the 5.0.5/HEAD code to add an extra arg
to ldap_parse_result() and ldap_parse_reference(). I'd need this patch
in production at some point, that's why it would be great to see it
merged into the mainstream; however, I'm little familiar with the
internals of PHP, so please excuse me if I missed anything in coding and
in the submission procedure.
The very same patch applies to HEAD and to 5.0.5. If you don't mind,
I'm posting it to you right now, pending further work. It also includes
some extra work I did to eliminate some warnings from OpenLDAP 2.3, but
it works fine with 2.2 as well. All changes specific to OpenLDAP are
protected behind the LDAP_API_FEATURE_X_OPENLDAP macro. Unfortunately I
have no chances to check it with other APIs right now. I'm also
including a trivial script I tested with ./sapi/cli/php against the
server resulting from test003 of OpenLDAP 2.3; to reproduce, just
cd openldap/tests/
../run -k test003
cd php
../sapi/cli/php pagedResults.php
If the code looks fine, I plan to document the new API, which is
completely backwards compatible, and add some facilities to
encode/decode the control values; hopefully, I won't have to get to
writing a complete wrapper around liblber!
My idea is to provide dumb helpers that encode well-known controls
through a trivial API; e.g., for pagedResults:
ldap_control_paged_results($handler, $size, $iscritical[, $cookie])
ldap_control_paged_results_resp($result, &$cookie[, &$iscritical[, &
$estimate]])
for passwdPolicy:
ldap_control_passwd_policy($handler[, $iscritical])
ldap_control_passwd_policy_resp($result, &$warning, &$error)
Please let me know if you need me to do anything else.
Sincerely, p.
--
Pierangelo Masarati
mailto:pierangelo.masarati@sys-net.it
Ing. Pierangelo Masarati
Responsabile Open Solution
SysNet s.n.c.
Via Dossi, 8 - 27100 Pavia - ITALIA
http://www.sys-net.it
------------------------------------------
Office: +39.02.23998309
Mobile: +39.333.4963172
Email: pierangelo.masarati@sys-net.it
------------------------------------------
Attachment: [text/x-patch] php-ldap-result-controls.txt
Attachment: [application/x-php] pagedResults.php
Attachment: [text/x-patch] php-ldap-result-controls.txt
Attachment: [application/x-php] pagedResults.php