From: Frank Brehm Date: Fri, 30 Sep 2022 09:43:20 +0000 (+0200) Subject: Asking for a password on instancing all LDAP instances if none was configured. X-Git-Tag: 0.6.0^2~1^2~10 X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=1637c320bb926ee0c6864a41b654146457db6fae;p=pixelpark%2Fpp-admin-tools.git Asking for a password on instancing all LDAP instances if none was configured. --- diff --git a/lib/pp_admintools/app/ldap.py b/lib/pp_admintools/app/ldap.py index 1a13515..d57d922 100644 --- a/lib/pp_admintools/app/ldap.py +++ b/lib/pp_admintools/app/ldap.py @@ -50,7 +50,7 @@ from ..config.ldap import LdapConnectionInfo, LdapConfiguration # rom ..config.ldap import DEFAULT_PORT_LDAP, DEFAULT_PORT_LDAPS from ..config.ldap import DEFAULT_TIMEOUT -__version__ = '0.7.2' +__version__ = '0.7.3' LOG = logging.getLogger(__name__) _ = XLATOR.gettext @@ -577,6 +577,12 @@ class BaseLdapApplication(BaseDPXApplication): ldap_server = self.get_ldap_server_obj(inst) self.ldap_server[inst] = ldap_server + if not connect_info.bind_pw: + first_prompt = _("Password of user {usr} on LDAP instance {inst}:").format( + usr=self.colored(connect_info.bind_dn, 'CYAN'), + inst=self.colored(connect_info.url, 'CYAN')) + ' ' + connect_info.bind_pw = self.get_password(first_prompt, may_empty=False, repeat=False) + ldap_connection = self.connect_to_ldap_server(ldap_server, inst) self.ldap_connection[inst] = ldap_connection