Internal Attributs

Nicolas EISEN neisen at linbox.com
Mon Aug 10 17:27:38 CEST 2009


Hi,

I use OpenLDAP, python-ldap with python2.5.

I need to get internal attributs (createTimeStamp, modifyTimestamp, 
...). In many tutorial, I found script some like this ( 
http://jfgiraud.free.fr/programmation/ldap/ ):

#!/usr/local/bin/python

import sys, ldap


try:
    l = ldap.open('localhost', 389)
    l.simple_bind_s("uid=LDAP Admin,ou=System Accounts,dc=toph,dc=com", "toto")
except:
    print "Erreur n°", l.errno
    sys.exit(1)

res = l.search_s("dc=toph,dc=com", ldap.SCOPE_SUBTREE, "objectclass=*", None, 0);
for dn,hash in res:
    print "dn:", dn
    for attr in hash.keys():
        print "attr %s: %s" % (attr, hash[attr])
    print '-'*80


And the tutorial output containt createTimestamp &Co ...

I try this script on my system, and I don't have this attributs. But 
with phpLDAPadmin or in command line, I can get it :

    ldapsearch -D "uid=LDAP Admin,ou=System Accounts,dc=toph,dc=com" -W -b "dc=toph,dc=com" "uid=user1" '*' '+'


Why ?
Thanks.




More information about the python-ldap mailing list