mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Merge pull request #602 from eauchat/stretch-unstable
Also remove /var/mail/<username> directory on user delete (with --purge option)
This commit is contained in:
commit
3e1064a3df
2 changed files with 2 additions and 0 deletions
|
@ -148,6 +148,7 @@ user:
|
||||||
extra:
|
extra:
|
||||||
pattern: *pattern_username
|
pattern: *pattern_username
|
||||||
--purge:
|
--purge:
|
||||||
|
help: Purge user's home and mail directories
|
||||||
action: store_true
|
action: store_true
|
||||||
|
|
||||||
### user_update()
|
### user_update()
|
||||||
|
|
|
@ -251,6 +251,7 @@ def user_delete(operation_logger, auth, username, purge=False):
|
||||||
if auth.update('cn=sftpusers,ou=groups', {'memberUid': memberlist}):
|
if auth.update('cn=sftpusers,ou=groups', {'memberUid': memberlist}):
|
||||||
if purge:
|
if purge:
|
||||||
subprocess.call(['rm', '-rf', '/home/{0}'.format(username)])
|
subprocess.call(['rm', '-rf', '/home/{0}'.format(username)])
|
||||||
|
subprocess.call(['rm', '-rf', '/var/mail/{0}'.format(username)])
|
||||||
else:
|
else:
|
||||||
raise YunohostError('user_deletion_failed')
|
raise YunohostError('user_deletion_failed')
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue