Protect the user's tfa key setting.

If oath or U2F is set, it should not be possible to change it
in the GUI on the user edit window.
It disables the second factor, but leave the tfa key behind
in the file tfa.cfg.
The key in the tfa.cfg file is a problem when the user tries to recreate a key.
The old key must be deleted before a new one can be created.
This commit is contained in:
Wolfgang Link 2020-01-17 14:48:59 +01:00 committed by Thomas Lamprecht
parent aa85713036
commit 5b25580d88

View File

@ -198,6 +198,11 @@ Ext.define('PVE.dc.UserEdit', {
} }
} }
me.setValues(data); me.setValues(data);
if (data.keys) {
if ( data.keys === 'x!oath' || data.keys === 'x!u2f' ) {
me.down('[name="keys"]').setDisabled(1);
}
}
} }
}); });
} }