+if arguments[0] == "echelon":
+ Attrs = l.search_s(BaseDn,ldap.SCOPE_ONELEVEL,\
+ "(&(|(activity-pgp=*)(activity-from=*))(&(keyFingerPrint=*)(gidNumber=800)))",\
+ ["activity-pgp","activity-from"]);
+ Count = 0;
+ PGPCount = 0;
+ for x in Attrs:
+ Count = Count + 1;
+ if x[1].has_key("activity-pgp"):
+ PGPCount = PGPCount + 1;
+ print "Echelon has seen",Count,"developers, with",PGPCount,"PGP confirms as of",time.strftime("%a, %d %b %Y %H:%M:%S +0000",time.gmtime(time.time()));
+
+if arguments[0] == "missing":
+ Attrs = l.search_s(BaseDn,ldap.SCOPE_ONELEVEL,\
+ "(&(!(|(activity-pgp=*)(activity-from=*)))(&(keyFingerPrint=*)(gidNumber=800)))",\
+ ["uid","cn","sn","mn"]);
+ Attrs.sort();
+ for x in Attrs:
+ print EmailAddress(x);
+
+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";
+