X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=UDLdap.py;h=46bd7d07f68ac94eed5efa7d5141bbd9b8a8d442;hb=1bd1a3c991bde81e15d751542676f76f104bd2f8;hp=9f8a0fd7375a05f88c9f0cfe12ecb558d42a290f;hpb=6171f9991eb458001488b215a09d34231d5890d4;p=mirror%2Fuserdir-ldap.git diff --git a/UDLdap.py b/UDLdap.py index 9f8a0fd..46bd7d0 100644 --- a/UDLdap.py +++ b/UDLdap.py @@ -3,7 +3,7 @@ import time import userdir_ldap class Account: - array_values = ['keyFingerPrint'] + array_values = ['keyFingerPrint', 'mailWhitelist', 'mailRBL', 'mailRHSBL'] int_values = ['shadowExpire'] defaults = { 'accountStatus': 'active', @@ -54,6 +54,8 @@ class Account: def pw_active(self): if self['userPassword'] == '{crypt}*LK*': return False + if self['userPassword'].startswith("!"): + return False return True # not expired @@ -66,6 +68,9 @@ class Account: 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):