import userdir_ldap
class Account:
- array_values = ['keyFingerPrint', 'mailWhitelist', 'mailRBL', 'mailRHSBL', 'supplementaryGid']
+ array_values = ['keyFingerPrint', 'mailWhitelist', 'mailRBL', 'mailRHSBL', 'supplementaryGid', 'sshRSAAuthKey', 'sudoPassword']
int_values = ['shadowExpire', 'gidNumber']
defaults = {
'accountStatus': 'active',
def pw_active(self):
if self['userPassword'] == '{crypt}*LK*':
return False
- if self['userPassword'].startswith("!"):
+ if self['userPassword'].startswith("{crypt}!"):
return False
return True
+ def get_password(self):
+ p = self['userPassword']
+ if not p.startswith('{crypt}') or len(p) > 50:
+ return p
+ else:
+ return p[7:]
+
# not expired
def shadow_active(self):
if 'shadowExpire' in self and \