mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
LDAP connection bugfix
This commit is contained in:
parent
4618264c86
commit
97de68996a
1 changed files with 3 additions and 2 deletions
|
@ -288,14 +288,15 @@ class YunoHostLDAP(Singleton):
|
||||||
print(_('Invalid password... Try again'))
|
print(_('Invalid password... Try again'))
|
||||||
else:
|
else:
|
||||||
need_password = False
|
need_password = False
|
||||||
|
|
||||||
self.level = self.level+1
|
|
||||||
try:
|
try:
|
||||||
self.conn.simple_bind_s('cn=admin,' + self.base, self.pwd)
|
self.conn.simple_bind_s('cn=admin,' + self.base, self.pwd)
|
||||||
self.connected = True
|
self.connected = True
|
||||||
except ldap.INVALID_CREDENTIALS:
|
except ldap.INVALID_CREDENTIALS:
|
||||||
raise YunoHostError(13, _('Invalid credentials'))
|
raise YunoHostError(13, _('Invalid credentials'))
|
||||||
|
|
||||||
|
self.level = self.level+1
|
||||||
|
|
||||||
def __exit__(self, type, value, traceback):
|
def __exit__(self, type, value, traceback):
|
||||||
self.level = self.level-1
|
self.level = self.level-1
|
||||||
if self.level == 0:
|
if self.level == 0:
|
||||||
|
|
Loading…
Reference in a new issue