def numkeys(self):
return len(self['keyFingerPrint'])
+ def is_active_user(self):
+ return self['accountStatus'] == 'active' and self.numkeys() != 0
+
def latitude_dec(self, anonymized=False):
return userdir_ldap.DecDegree(self['latitude'], anonymized)
def longitude_dec(self, anonymized=False):
# Write out the position for each user
for x in DebianDDUsers:
- if x[1].has_key("privateSub") == 0:
+ a = UDLdap.Account(x[0], x[1])
+ if not a.is_active_user():
continue
-
- # If the account has no PGP key, do not write it
- if x[1].has_key("keyFingerPrint") == 0:
+ if not 'privateSub' in a:
continue
-
try:
- Line = "%s"%(GetAttr(x, "privateSub"))
+ Line = "%s"%(a['privateSub'])
Line = Sanitize(Line) + "\n"
F.write(Line)
except: