Fixed LDAP regex user search

This commit is contained in:
Adolfo Gómez García 2018-09-04 12:45:46 +02:00
parent 58886b00fa
commit 82c362b2b6
3 changed files with 4 additions and 3 deletions

View File

@ -43,7 +43,7 @@ import ldap
import re
import logging
__updated__ = '2018-02-01'
__updated__ = '2018-09-04'
logger = logging.getLogger(__name__)
@ -348,7 +348,7 @@ class RegexLdap(auths.Authenticator):
for r in ldaputil.getAsDict(
con=self.__connection(),
base=self._ldapBase,
ldapFilter='(&(&(objectClass={})({}={}*))(objectCategory=person))'.format(self._userClass, self._userIdAttr, ldaputil.escape(pattern)),
ldapFilter='(&(&(objectClass={})({}={}*)))'.format(self._userClass, self._userIdAttr, ldaputil.escape(pattern)),
attrList=None, # All attrs
sizeLimit=LDAP_RESULT_LIMIT
):

View File

@ -98,7 +98,7 @@ def connection(username, password, host, port=-1, ssl=False, timeout=3, debug=Fa
logger.exception('Exception connection:')
raise LDAPError('{}'.format(e))
logger.debug('Conneciton was success')
logger.debug('Connection was successful')
return l

View File

@ -110,6 +110,7 @@ def udsJs(context):
'customAuth': reverse('uds.web.views.customAuth', kwargs={'idAuth': ''}),
'services': reverse('modern.services'),
'enabler': reverse('ClientAccessEnabler', kwargs={ 'idService': 'param1', 'idTransport': 'param2' }),
'galeryImage': reverse('galleryImage', kwargs={ 'idImage': 'param1' }),
}
}