mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-01-23 06:38:34 +01:00
Add a confirmation when setting admin permissions
This commit is contained in:
parent
6aeb7dcbc9
commit
f398768f4e
@ -84,6 +84,13 @@
|
|||||||
* @param {boolean} isAdmin
|
* @param {boolean} isAdmin
|
||||||
*/
|
*/
|
||||||
function saveAdminRole(isAdmin) {
|
function saveAdminRole(isAdmin) {
|
||||||
|
if (! confirm(trans('admin.confirm.change_admin_role'))) {
|
||||||
|
nextTick().then(() => {
|
||||||
|
managedUser.value.info.is_admin = ! isAdmin
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if(isAdmin === false && managedUser.value.info.id === user.id) {
|
if(isAdmin === false && managedUser.value.info.id === user.id) {
|
||||||
if (! confirm(trans('admin.confirm.demote_own_account'))) {
|
if (! confirm(trans('admin.confirm.demote_own_account'))) {
|
||||||
nextTick().then(() => {
|
nextTick().then(() => {
|
||||||
|
@ -27,7 +27,8 @@
|
|||||||
'purge_password_reset_request' => 'Are you sure you want to purge the request?',
|
'purge_password_reset_request' => 'Are you sure you want to purge the request?',
|
||||||
'delete_account' => 'Are you sure you want to delete this user?',
|
'delete_account' => 'Are you sure you want to delete this user?',
|
||||||
'edit_own_account' => 'This is your own account. Are you sure?',
|
'edit_own_account' => 'This is your own account. Are you sure?',
|
||||||
'demote_own_account' => 'You will no longer be an administrator. Are you sure?'
|
'change_admin_role' => 'This will have serious impacts on this user\'s permissions. Are you sure?',
|
||||||
|
'demote_own_account' => 'You will no longer be an administrator. Really sure?'
|
||||||
],
|
],
|
||||||
'administration' => 'Administration',
|
'administration' => 'Administration',
|
||||||
'logs' => 'Logs',
|
'logs' => 'Logs',
|
||||||
|
Loading…
Reference in New Issue
Block a user