mirror of
https://github.com/kakwa/ldapcherry
synced 2024-11-21 17:04:21 +01:00
better example for ldap backend
This commit is contained in:
parent
e559f69589
commit
55e71960f7
@ -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')
|
||||
|
Loading…
Reference in New Issue
Block a user