server/sources/ldapuser.py
changeset 6427 c8a5ac2d1eaa
parent 6142 8bc6eac1fac1
child 6653 52d1568af412
equal deleted inserted replaced
6426:541659c39f6a 6427:c8a5ac2d1eaa
   160           'group': 'ldap-source', 'level': 3,
   160           'group': 'ldap-source', 'level': 3,
   161           }),
   161           }),
   162 
   162 
   163     )
   163     )
   164 
   164 
   165     def __init__(self, repo, appschema, source_config, *args, **kwargs):
   165     def __init__(self, repo, source_config, *args, **kwargs):
   166         AbstractSource.__init__(self, repo, appschema, source_config,
   166         AbstractSource.__init__(self, repo, source_config, *args, **kwargs)
   167                                 *args, **kwargs)
       
   168         self.host = source_config['host']
   167         self.host = source_config['host']
   169         self.protocol = source_config.get('protocol', 'ldap')
   168         self.protocol = source_config.get('protocol', 'ldap')
   170         self.authmode = source_config.get('auth-mode', 'simple')
   169         self.authmode = source_config.get('auth-mode', 'simple')
   171         self._authenticate = getattr(self, '_auth_%s' % self.authmode)
   170         self._authenticate = getattr(self, '_auth_%s' % self.authmode)
   172         self.cnx_dn = source_config.get('data-cnx-dn') or ''
   171         self.cnx_dn = source_config.get('data-cnx-dn') or ''