Changes

PHP Extensions

2,828 bytes added, 14:56, 12 June 2014
/* Requirements */
[https://tools.ietf.org/html/rfc2891 RFC2891]
'''TODO''' == LDAP Simple Paged Results Control == The server side on OpenLDAP is implemented via an overlay: [httpshttp://toolswww.ietfopenldap.org/htmlsoftware/rfc2696 RFC2696man.cgi?query=slapo-sssvlv&apropos=0&sektion=0&manpath=OpenLDAP+2.4-Release&format=html slapo-sssvlv]- Server Side Sorting and Virtual List View overlay for slapd.
'''TODO'''
'''TODO'''
This may be harder to get into upstream PHP since this requires that the functions pass back the message object such that the caller can get the response control out of it (which contains the entries of the query).
 
== LDAP Tree Delete Control ==
 
[http://tools.ietf.org/html/draft-armijo-ldap-treedelete-02 draft-armijo-ldap-treedelete-02]
 
May be really helpful when deleting tree of objects.
 
== LDAP Scrolling View Browsing of Search Results ==
 
To achieve server side sorting with proper paging, the Server Side Sorting and Virtual List View overlay on the OpenLDAP server needs to be installed (this overlay replaces the built in simple paging mechanism):
* Internet-Draft: [http://www.ietf.org/proceedings/55/I-D/draft-ietf-ldapext-ldapv3-vlv-09.txt draft-ietf-ldapext-ldapv3-vlv-09.txt]
 
This requires [[#LDAP_Server_Side_Sorting_Control | LDAP Server Side Sorting Control]]:
<pre>
5. Client-Server Interaction
The Virtual List View control extends a regular LDAP Search operation
which MUST also include a server-side sorting control [SSS].
[...]
</pre>
 
A Perl example how to set a LDAP control: http://search.cpan.org/~marschap/perl-ldap-0.62/
 
The server side on OpenLDAP is implemented via an overlay: [http://www.openldap.org/software/man.cgi?query=slapo-sssvlv&apropos=0&sektion=0&manpath=OpenLDAP+2.4-Release&format=html slapo-sssvlv] - Server Side Sorting and Virtual List View overlay for slapd.
 
Example Search with server side sorting (ascending):
<pre>
ldapsearch -H ldaps://ldapm.stoney-cloud.org \
-E sss=uid:integerOrderingMatch \
-b "ou=people,dc=stoney-cloud,dc=org" \
-s one \
-D "cn=Manager,dc=stoney-cloud,dc=org" \
-z 5 \
-W -x -LLL \
"(&(sstBelongsToResellerUID=4000000)(uid=*400*))" o sn givenName sstIsActive
</pre>
 
Example Search with server side sorting (descending: check the "-" before the attribute uid):
<pre>
ldapsearch -H ldaps://ldapm.stoney-cloud.org \
-E sss=-uid:integerOrderingMatch \
-b "ou=people,dc=stoney-cloud,dc=org" \
-s one \
-D "cn=Manager,dc=stoney-cloud,dc=org" \
-z 5 \
-W -x -LLL \
"(&(sstBelongsToResellerUID=4000000)(uid=*400*))" o sn givenName sstIsActive
</pre>
 
== Building the patched LDAP extension ==
 
=== Requirements ===
 
* PHP 5.5 (including development tools like <code>phpize</code>)
* OpenLDAP libraries and headers
* libtool
* gcc
* make
* autoconf
* git
* php-ldap extension '''must not be installed''' already, otherwise it will clash with the patched one
 
=== Building & installation ===
 
<source lang='bash'>
git clone -b ldap-controls-PHP-5.5.10 --depth=1 https://github.com/stepping-stone/php-src.git
 
cd php-src/ext/ldap
 
phpize
aclocal
libtoolize -f
autoheader
autoconf
 
./configure
make
 
sudo make install
</source>
 
=== Activation ===
 
Add the following line to the relevant <code>php.ini</code>:
<source lang='ini'>
extension=ldap.so
</source>
[[Category:Documentation]]
[[Category:PHP]]
[[Category:LDAPOpenLDAP directory]]
Bureaucrat, administrator
425
edits