mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Added removal of "/var/mail/<username>" directory when removing user with --purge option.
This commit is contained in:
parent
5338319890
commit
0ed392cec0
2 changed files with 2 additions and 3 deletions
|
@ -148,6 +148,7 @@ user:
|
|||
extra:
|
||||
pattern: *pattern_username
|
||||
--purge:
|
||||
help: Purge user's home and mail directories
|
||||
action: store_true
|
||||
|
||||
### user_update()
|
||||
|
|
|
@ -256,6 +256,7 @@ def user_delete(operation_logger, auth, username, purge=False):
|
|||
if auth.update('cn=sftpusers,ou=groups', {'memberUid': memberlist}):
|
||||
if purge:
|
||||
subprocess.call(['rm', '-rf', '/home/{0}'.format(username)])
|
||||
subprocess.call(['rm', '-rf', '/var/mail/{0}'.format(username)])
|
||||
else:
|
||||
raise MoulinetteError(169, m18n.n('user_deletion_failed'))
|
||||
|
||||
|
@ -532,6 +533,3 @@ def _hash_user_password(password):
|
|||
|
||||
salt = '$6$' + salt + '$'
|
||||
return '{CRYPT}' + crypt.crypt(str(password), salt)
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue