Merge pull request #2821 from adfinis-forks/udm_user_pwhistory
univention udm_user: override password history.
This commit is contained in:
commit
638e25bead
1 changed files with 21 additions and 0 deletions
|
@ -184,6 +184,18 @@ options:
|
||||||
default: None
|
default: None
|
||||||
description:
|
description:
|
||||||
- Organisation
|
- Organisation
|
||||||
|
override_pw_history:
|
||||||
|
required: false
|
||||||
|
default: False
|
||||||
|
description:
|
||||||
|
- Override password history
|
||||||
|
aliases: [ overridePWHistory ]
|
||||||
|
override_pw_length:
|
||||||
|
required: false
|
||||||
|
default: False
|
||||||
|
description:
|
||||||
|
- Override password check
|
||||||
|
aliases: [ overridePWLength ]
|
||||||
pager_telephonenumber:
|
pager_telephonenumber:
|
||||||
required: false
|
required: false
|
||||||
default: []
|
default: []
|
||||||
|
@ -390,6 +402,12 @@ def main():
|
||||||
aliases=['mobileTelephoneNumber']),
|
aliases=['mobileTelephoneNumber']),
|
||||||
organisation = dict(default=None,
|
organisation = dict(default=None,
|
||||||
type='str'),
|
type='str'),
|
||||||
|
overridePWHistory = dict(default=False,
|
||||||
|
type='bool',
|
||||||
|
aliases=['override_pw_history']),
|
||||||
|
overridePWLength = dict(default=False,
|
||||||
|
type='bool',
|
||||||
|
aliases=['override_pw_length']),
|
||||||
pager_telephonenumber = dict(default=[],
|
pager_telephonenumber = dict(default=[],
|
||||||
type='list',
|
type='list',
|
||||||
aliases=['pagerTelephonenumber']),
|
aliases=['pagerTelephonenumber']),
|
||||||
|
@ -496,6 +514,7 @@ def main():
|
||||||
for k in obj.keys():
|
for k in obj.keys():
|
||||||
if (k != 'password' and
|
if (k != 'password' and
|
||||||
k != 'groups' and
|
k != 'groups' and
|
||||||
|
k != 'overridePWHistory' and
|
||||||
k in module.params and
|
k in module.params and
|
||||||
module.params[k] is not None):
|
module.params[k] is not None):
|
||||||
obj[k] = module.params[k]
|
obj[k] = module.params[k]
|
||||||
|
@ -507,6 +526,8 @@ def main():
|
||||||
else:
|
else:
|
||||||
old_password = obj['password'].split('}', 2)[1]
|
old_password = obj['password'].split('}', 2)[1]
|
||||||
if crypt.crypt(password, old_password) != old_password:
|
if crypt.crypt(password, old_password) != old_password:
|
||||||
|
obj['overridePWHistory'] = module.params['overridePWHistory']
|
||||||
|
obj['overridePWLength'] = module.params['overridePWLength']
|
||||||
obj['password'] = password
|
obj['password'] = password
|
||||||
|
|
||||||
diff = obj.diff()
|
diff = obj.diff()
|
||||||
|
|
Loading…
Reference in a new issue