1
0
mirror of https://github.com/kakwa/ldapcherry synced 2024-11-22 09:24:21 +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 = { cfg = {
'module' : 'ldapcherry.backend.ldap', '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', 'userdn' : 'ou=People,dc=example,dc=org',
'binddn' : 'cn=dnscherry,dc=example,dc=org', 'binddn' : 'cn=dnscherry,dc=example,dc=org',
'password' : 'password', 'password' : 'password',
@ -42,8 +42,8 @@ cherrypy.log.error = syslog_error
inv = Backend(cfg, cherrypy.log, 'ldap', attr) inv = Backend(cfg, cherrypy.log, 'ldap', attr)
print inv.get_user('jwatson') print inv.get_user('jwatson')
print inv.get_user('test') print inv.get_groups('jwatson')
#print inv.search('smit') print inv.search('smit')
user = { user = {
'uid': 'test', 'uid': 'test',
'sn': 'test', 'sn': 'test',
@ -54,4 +54,6 @@ user = {
'homeDirectory': '/home/test/' 'homeDirectory': '/home/test/'
} }
inv.add_user(user) inv.add_user(user)
print inv.get_user('test')
print inv.get_groups('test')
inv.del_user('test') inv.del_user('test')