[FIX] auth_ldap: fix LDAP error handling
In order to ensure consistent results of all error conditions returned
by the LDAP server, the _authenticate() method should return `False`
for every kind of exception, not just for INVALID_CREDENTIALS.
This is not actually relevant in 12.0 as the result is exactly the
same, due to the way the `entry` variable is being initialized, but it
will make the code path "visibly consistent" across all supported
versions
closes odoo/odoo#72484
X-original-commit: 24a3f669e5199c35849dabbf7b0d37f43b684538
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
This commit is contained in:
@@ -139,6 +139,7 @@ class CompanyLDAP(models.Model):
|
||||
return False
|
||||
except ldap.LDAPError as e:
|
||||
_logger.error('An LDAP exception occurred: %s', e)
|
||||
return False
|
||||
return entry
|
||||
|
||||
def _query(self, conf, filter, retrieve_attributes=None):
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
Ireland, 2021-06-18
|
||||
|
||||
I hereby agree to the terms of the Odoo Individual Contributor License
|
||||
Agreement v1.0.
|
||||
|
||||
I declare that I am authorized and able to make this agreement and sign this
|
||||
declaration.
|
||||
|
||||
Signed,
|
||||
Manali Malpani manali.malpani@ibm.com https://github.com/manali-malpani
|
||||
Reference in New Issue
Block a user