1
0
mirror of https://github.com/kakwa/ldapcherry synced 2024-06-04 10:07:48 +02:00

better code example

This commit is contained in:
kakwa 2015-05-25 19:55:18 +02:00
parent 8da0b7c533
commit 4d29706eaf

View File

@ -25,6 +25,8 @@ cfg = {
'checkcert' : 'off',
'user_filter_tmpl' : '(uid=%(username)s)',
'group_filter_tmpl' : '(member=%(userdn)s)',
'search_filter_tmpl' : '(|(uid=%(searchstring)s*)(sn=%(searchstring)s*))',
}
cherrypy.log.error = syslog_error
@ -32,3 +34,4 @@ attr = ['shéll', 'cn', 'uid', 'uidNumber', 'gidNumber', 'home', 'userPassword',
inv = Backend(cfg, cherrypy.log, 'ldap', attr)
print inv.get_user('jwatson')
print inv.search('smit')