mirror of
https://github.com/kakwa/ldapcherry
synced 2024-11-22 17:34:21 +01:00
adding search template
This commit is contained in:
parent
13cca11f51
commit
6af8628d5d
@ -76,7 +76,8 @@ ldap.ca = '/etc/dnscherry/TEST-cacert.pem'
|
|||||||
ldap.starttls = 'on'
|
ldap.starttls = 'on'
|
||||||
ldap.checkcert = 'off'
|
ldap.checkcert = 'off'
|
||||||
ldap.user_filter_tmpl = '(uid=%(username)s)'
|
ldap.user_filter_tmpl = '(uid=%(username)s)'
|
||||||
ldap.group_filter_tmpl = '(member=%(userdn)s)'
|
ldap.group_filter_tmpl = '(member=%(username)s)'
|
||||||
|
ldap.search_filter_tmpl = '&(uid=%(searchstring)s*)(sn=%(searchstring)s*)'
|
||||||
ldap.timeout = 1
|
ldap.timeout = 1
|
||||||
|
|
||||||
|
|
||||||
|
@ -26,6 +26,8 @@ class Backend(ldapcherry.backend.Backend):
|
|||||||
self.userdn = self.get_param('userdn')
|
self.userdn = self.get_param('userdn')
|
||||||
self.groupdn = self.get_param('groupdn')
|
self.groupdn = self.get_param('groupdn')
|
||||||
self.user_filter_tmpl = self.get_param('user_filter_tmpl')
|
self.user_filter_tmpl = self.get_param('user_filter_tmpl')
|
||||||
|
self.group_filter_tmpl = self.get_param('group_filter_tmpl')
|
||||||
|
self.search_filter_tmpl = self.get_param('search_filter_tmpl')
|
||||||
self.attrlist = []
|
self.attrlist = []
|
||||||
for a in attrslist:
|
for a in attrslist:
|
||||||
try:
|
try:
|
||||||
|
@ -77,6 +77,7 @@ ldap.starttls = 'on'
|
|||||||
ldap.checkcert = 'off'
|
ldap.checkcert = 'off'
|
||||||
ldap.user_filter_tmpl = '(uid=%(username)s)'
|
ldap.user_filter_tmpl = '(uid=%(username)s)'
|
||||||
ldap.group_filter_tmpl = '(member=%(userdn)s)'
|
ldap.group_filter_tmpl = '(member=%(userdn)s)'
|
||||||
|
ldap.search_filter_tmpl = '&(uid=%(searchstring)s*)(sn=%(searchstring)s*)'
|
||||||
ldap.timeout = 1
|
ldap.timeout = 1
|
||||||
|
|
||||||
ad.module = 'ldapcherry.backend.backendSamba4'
|
ad.module = 'ldapcherry.backend.backendSamba4'
|
||||||
|
@ -14,17 +14,18 @@ import cherrypy
|
|||||||
from ldap import SERVER_DOWN
|
from ldap import SERVER_DOWN
|
||||||
|
|
||||||
cfg = {
|
cfg = {
|
||||||
'module' : 'ldapcherry.backend.ldap',
|
'module' : 'ldapcherry.backend.ldap',
|
||||||
'groupdn' : 'ou=group,dc=example,dc=org',
|
'groupdn' : 'ou=group,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',
|
||||||
'uri' : 'ldap://ldap.ldapcherry.org:390',
|
'uri' : 'ldap://ldap.ldapcherry.org:390',
|
||||||
'ca' : './tests/test_env/etc/ldapcherry/TEST-cacert.pem',
|
'ca' : './tests/test_env/etc/ldapcherry/TEST-cacert.pem',
|
||||||
'starttls' : 'off',
|
'starttls' : 'off',
|
||||||
'checkcert' : 'off',
|
'checkcert' : 'off',
|
||||||
'user_filter_tmpl' : '(uid=%(username)s)',
|
'user_filter_tmpl' : '(uid=%(username)s)',
|
||||||
'group_filter_tmpl' : '(member=%(userdn)s)',
|
'group_filter_tmpl' : '(member=%(userdn)s)',
|
||||||
|
'search_filter_tmpl' : '&(uid=%(searchstring)s*)(sn=%(searchstring)s*)',
|
||||||
}
|
}
|
||||||
|
|
||||||
cherrypy.log.error = syslog_error
|
cherrypy.log.error = syslog_error
|
||||||
|
Loading…
Reference in New Issue
Block a user