- if x[1].has_key("uidNumber") == 0:
- continue
-
- Pass = GetAttr(x, "userPassword")
- Line = ""
- # *LK* is the reference value for a locked account
- # password starting with ! is also a locked account
- if Pass.find("*LK*") != -1 or Pass.startswith("!"):
- # Format is <login>:<reason>
- Line = "%s:%s" % (GetAttr(x, "uid"), "Account is locked")
- DisabledUsers.append(x)
-
- if Line != "":
- F.write(Sanitize(Line) + "\n")
-
-
+ a = UDLdap.Account(x[0], x[1])
+ if a.pw_active(): continue
+ Line = "%s:%s" % (a['uid'], "Account is locked")
+ DisabledUsers.append(x)
+ F.write(Sanitize(Line) + "\n")
+