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:
|
||||
pattern: *pattern_username
|
||||
--purge:
|
||||
help: Purge user's home and mail directories
|
||||
action: store_true
|
||||
|
||||
### 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 purge:
|
||||
subprocess.call(['rm', '-rf', '/home/{0}'.format(username)])
|
||||
subprocess.call(['rm', '-rf', '/var/mail/{0}'.format(username)])
|
||||
else:
|
||||
raise YunohostError('user_deletion_failed')
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue