Changes

PHP Extensions

1,638 bytes added, 14:56, 12 June 2014
/* Requirements */
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.
 
'''TODO'''
 
== LDAP Simple Paged Results Control ==
 
[https://tools.ietf.org/html/rfc2696 RFC2696]
'''TODO'''
* 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
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:OpenLDAP directory]]
Bureaucrat, administrator
425
edits