This module allows remote access to LDAP. It wraps standard Python module for LDAP and provides some convenience functions.
- server (string) – Server address
- base (string) – Search base
LDAP class wrapping ldap access.
- uid (string) – Search string
- attribs (list of strings) – Attributes to read from LDAP, defaults to [‘cn’, ‘mail’, ‘ou’, ‘sn’, ‘givenName’]
list of dictionaries
Performs UID search and returns list of search results.
search_by(attr, val, attribs=None)¶
- attr – attribute name to search by
- val – value of the attribute to search for
- attribs – attributes to return
Performs search by any attribute.
Parameters: user (string) – Search string Return type: string Returns: Department name,
N/Ain case it was not found.
Performs LDAP search and grabs department name from it. Additionally some fixups are applied to department names to avoid more names for single department.