X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;ds=sidebyside;f=UDLdap.py;h=9e2d2ee7e3b24408f10a588c77464860fddf03f5;hb=059c1ab2073bf678019edafff8c515ed1d2c341a;hp=9f8a0fd7375a05f88c9f0cfe12ecb558d42a290f;hpb=6171f9991eb458001488b215a09d34231d5890d4;p=mirror%2Fuserdir-ldap.git diff --git a/UDLdap.py b/UDLdap.py index 9f8a0fd..9e2d2ee 100644 --- a/UDLdap.py +++ b/UDLdap.py @@ -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):