| Server IP : 182.53.201.61 / Your IP : 216.73.217.175 Web Server : Apache/2.2.15 (Fedora) System : Linux km10.dyndns.org 2.6.31.5-127.fc12.i686.PAE #1 SMP Sat Nov 7 21:25:57 EST 2009 i686 User : apache ( 48) PHP Version : 5.3.3 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/share/doc/python-ldap-2.3.6/Demo/ |
Upload File : |
import ldap,ldapurl,pprint
from ldap.controls import LDAPControl,BooleanControl
l = ldap.initialize('ldap://localhost:1390',trace_level=2)
print 60*'#'
pprint.pprint(l.get_option(ldap.OPT_SERVER_CONTROLS))
l.manage_dsa_it(1,1)
pprint.pprint(l.get_option(ldap.OPT_SERVER_CONTROLS))
print 60*'#'
# Search with ManageDsaIT control (which has no value)
pprint.pprint(l.search_ext_s(
'cn=Test-Referral,ou=Testing,dc=stroeder,dc=de',
ldap.SCOPE_BASE,
'(objectClass=*)',
['*','+'],
serverctrls = [ LDAPControl('2.16.840.1.113730.3.4.2',1,None) ],
))
print 60*'#'
# Search with Subentries control (which has boolean value)
pprint.pprint(l.search_ext_s(
'dc=stroeder,dc=de',
ldap.SCOPE_SUBTREE,
'(objectClass=subentry)',
['*','+'],
serverctrls = [ BooleanControl('1.3.6.1.4.1.4203.1.10.1',1,1) ],
))
print 60*'#'