[gen] Bugfix while creating default users. Bugfix: do not perform LDAP authhentication when ldapConfig.enabled is False.
This commit is contained in:
parent
79ebc1cbf9
commit
5c41f1b3d2
2 changed files with 4 additions and 4 deletions
|
@ -870,10 +870,10 @@ class ToolMixin(BaseMixin):
|
|||
def getLdapUser(self, login, password):
|
||||
'''Returns a local User instance corresponding to a LDAP user if p_login
|
||||
and p_password correspong to a valid LDAP user.'''
|
||||
# Check if LDAP is configured.
|
||||
# Check if LDAP is configured
|
||||
cfg = self.getProductConfig(True).ldap
|
||||
if not cfg: return
|
||||
# Get a connector to the LDAP server and connect to the LDAP server.
|
||||
if not cfg or not cfg.enabled: return
|
||||
# Get a connector to the LDAP server and connect to the LDAP server
|
||||
serverUri = cfg.getServerUri()
|
||||
connector = LdapConnector(serverUri, tool=self)
|
||||
success, msg = connector.connect(cfg.adminLogin, cfg.adminPassword)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue