]> git.proxmox.com Git - pve-manager.git/commitdiff
Protect the user's tfa key setting.
authorWolfgang Link <w.link@proxmox.com>
Fri, 17 Jan 2020 13:48:59 +0000 (14:48 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 28 Jan 2020 12:46:54 +0000 (13:46 +0100)
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.

www/manager6/dc/UserEdit.js

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