From ae42eb5913b0bbba0223539b53bf053717774bbc Mon Sep 17 00:00:00 2001 From: jgg <> Date: Sat, 25 Sep 1999 17:27:53 +0000 Subject: [PATCH] Added pgp key stats --- ud-ldapshow | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/ud-ldapshow b/ud-ldapshow index 5faef77..9899129 100755 --- a/ud-ldapshow +++ b/ud-ldapshow @@ -83,6 +83,20 @@ if arguments[0] == "devcount": Count = Count + 1; print "There are",Count,"developers as of",time.strftime("%a, %d %b %Y %H:%M:%S +0000",time.gmtime(time.time())); +if arguments[0] == "keystat": + Attrs = l.search_s(BaseDn,ldap.SCOPE_ONELEVEL,"keyfingerprint=*",\ + ["keyfingerprint"]); + KeyCount = 0; + GPGCount = 0; + for x in Attrs: + if x[1].has_key("keyfingerprint"): + KeyCount = KeyCount + 1; + for I in x[1]["keyfingerprint"]: + if len(I) == 40: + GPGCount = GPGCount + 1; + break; + print "There are",KeyCount,"accounts with PGP2/5 keys and",GPGCount,"of them have PGP5 keys"; + if arguments[0] == "multikeys": Attrs = l.search_s(BaseDn,ldap.SCOPE_ONELEVEL,"uid=*",\ ["uid","cn","sn","keyfingerprint"]); -- 2.20.1