1
0
mirror of https://github.com/kakwa/ldapcherry synced 2024-12-22 04:40:03 +01:00

better example for ldap backend

This commit is contained in:
kakwa 2015-05-27 22:00:15 +02:00
parent e559f69589
commit 55e71960f7

View File

@ -16,7 +16,7 @@ from ldap import SERVER_DOWN
cfg = {
'module' : 'ldapcherry.backend.ldap',
'groupdn' : 'ou=group,dc=example,dc=org',
'groupdn' : 'ou=Groups,dc=example,dc=org',
'userdn' : 'ou=People,dc=example,dc=org',
'binddn' : 'cn=dnscherry,dc=example,dc=org',
'password' : 'password',
@ -42,8 +42,8 @@ cherrypy.log.error = syslog_error
inv = Backend(cfg, cherrypy.log, 'ldap', attr)
print inv.get_user('jwatson')
print inv.get_user('test')
#print inv.search('smit')
print inv.get_groups('jwatson')
print inv.search('smit')
user = {
'uid': 'test',
'sn': 'test',
@ -54,4 +54,6 @@ user = {
'homeDirectory': '/home/test/'
}
inv.add_user(user)
print inv.get_user('test')
print inv.get_groups('test')
inv.del_user('test')