diff options
author | Gary Kim <gary@garykim.dev> | 2019-11-03 16:22:59 +0800 |
---|---|---|
committer | Gary Kim <gary@garykim.dev> | 2019-11-05 20:39:07 +0800 |
commit | 0efa78d1e207e3b345fd435494f892974e441f61 (patch) | |
tree | b17412f47c2e5ddf8dc57730ef5cd1833b614bd9 /apps/settings/src | |
parent | 827a3c545afbffead72a89931ab1a4a07ce3a3d2 (diff) | |
download | nextcloud-server-0efa78d1e207e3b345fd435494f892974e441f61.tar.gz nextcloud-server-0efa78d1e207e3b345fd435494f892974e441f61.zip |
Prompt on destructive user actions
Signed-off-by: Gary Kim <gary@garykim.dev>
Diffstat (limited to 'apps/settings/src')
-rw-r--r-- | apps/settings/src/components/UserList/UserRow.vue | 60 |
1 files changed, 46 insertions, 14 deletions
diff --git a/apps/settings/src/components/UserList/UserRow.vue b/apps/settings/src/components/UserList/UserRow.vue index c27523dfadf..435f1b8bb7c 100644 --- a/apps/settings/src/components/UserList/UserRow.vue +++ b/apps/settings/src/components/UserList/UserRow.vue @@ -1,7 +1,9 @@ <!-- - @copyright Copyright (c) 2018 John Molakvoæ <skjnldsv@protonmail.com> + - @copyright Copyright (c) 2019 Gary Kim <gary@garykim.dev> - - @author John Molakvoæ <skjnldsv@protonmail.com> + - @author Gary Kim <gary@garykim.dev> - - @license GNU AGPL version 3 or any later version - @@ -428,25 +430,55 @@ export default { }, wipeUserDevices() { - this.loading.wipe = true - this.loading.all = true let userid = this.user.id - return this.$store.dispatch('wipeUserDevices', userid) - .then(() => { - this.loading.wipe = false - this.loading.all = false - }) + OC.dialogs.confirmDestructive( + t('settings', 'In case of lost device or exiting the organization, this can remotely wipe the Nextcloud data from all devices associated with {userid}. Only works if the devices are connected to the internet.', { userid: userid }), + t('settings', 'Remote wipe of devices'), + { + type: OC.dialogs.YES_NO_BUTTONS, + confirm: t('settings', 'Wipe {userid}\'s devices', { userid: userid }), + confirmClasses: 'error', + cancel: t('settings', 'Cancel') + }, + (result) => { + if (result) { + this.loading.wipe = true + this.loading.all = true + this.$store.dispatch('wipeUserDevices', userid) + .then(() => { + this.loading.wipe = false + this.loading.all = false + }) + } + }, + true + ) }, deleteUser() { - this.loading.delete = true - this.loading.all = true let userid = this.user.id - return this.$store.dispatch('deleteUser', userid) - .then(() => { - this.loading.delete = false - this.loading.all = false - }) + OC.dialogs.confirmDestructive( + t('settings', 'Fully delete {userid}\'s account including all their personal files, app data, etc.', { userid: userid }), + t('settings', 'Account deletion'), + { + type: OC.dialogs.YES_NO_BUTTONS, + confirm: t('settings', 'Delete {userid}\'s account', { userid: userid }), + confirmClasses: 'error', + cancel: t('settings', 'Cancel') + }, + (result) => { + if (result) { + this.loading.delete = true + this.loading.all = true + return this.$store.dispatch('deleteUser', userid) + .then(() => { + this.loading.delete = false + this.loading.all = false + }) + } + }, + true + ) }, enableDisableUser() { |