-print "Accessing LDAP directory as '" + AdminUser + "'";
-while (1):
- Password = getpass(AdminUser + "'s password: ");
-
- if len(Password) == 0:
- sys.exit(0)
-
- l = ldap.open(LDAPServer);
- UserDn = "uid=" + AdminUser + "," + BaseDn;
-
- # Connect to the ldap server
- try:
- l.simple_bind_s(UserDn,Password);
- except ldap.INVALID_CREDENTIALS:
- continue
- break