mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
Ask for password again if it fails
This commit is contained in:
parent
509a3a7f78
commit
576e2eb7ef
1 changed files with 11 additions and 4 deletions
|
@ -282,10 +282,17 @@ class YunoHostLDAP(Singleton):
|
||||||
if password: self.pwd = password
|
if password: self.pwd = password
|
||||||
elif self.pwd: pass
|
elif self.pwd: pass
|
||||||
else:
|
else:
|
||||||
|
need_password = True
|
||||||
|
while need_password:
|
||||||
try:
|
try:
|
||||||
self.pwd = getpass.getpass(colorize(_('Admin Password: '), 'yellow'))
|
self.pwd = getpass.getpass(colorize(_('Admin Password: '), 'yellow'))
|
||||||
|
self.conn.simple_bind_s('cn=admin,' + self.base, self.pwd)
|
||||||
except KeyboardInterrupt, EOFError:
|
except KeyboardInterrupt, EOFError:
|
||||||
raise YunoHostError(125, _("Interrupted"))
|
raise YunoHostError(125, _("Interrupted"))
|
||||||
|
except ldap.INVALID_CREDENTIALS:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
need_password = False
|
||||||
|
|
||||||
self.level = self.level+1
|
self.level = self.level+1
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue