]> git.proxmox.com Git - pve-manager.git/commitdiff
ui: user view: show tfa lock status
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Tue, 6 Jun 2023 10:05:04 +0000 (12:05 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 7 Jun 2023 16:08:01 +0000 (18:08 +0200)
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
www/manager6/dc/UserView.js

index bbfc4f7c6eac1a3863bee5706f65bb48326ef16b..e46ed13e44a55162ab99dfe0778ffb1ced471064 100644 (file)
@@ -158,17 +158,31 @@ Ext.define('PVE.dc.UserView', {
                },
                {
                    header: 'TFA',
-                   width: 50,
+                   width: 120,
                    sortable: true,
-                   renderer: function(v) {
+                   renderer: function(v, metaData, record) {
                        let tfa_type = PVE.Parser.parseTfaType(v);
                        if (tfa_type === undefined) {
                            return Proxmox.Utils.noText;
-                       } else if (tfa_type === 1) {
-                           return Proxmox.Utils.yesText;
-                       } else {
+                       }
+
+                       if (tfa_type !== 1) {
                            return tfa_type;
                        }
+
+                       let locked_until = record.data['tfa-locked-until'];
+                       if (locked_until !== undefined) {
+                           let now = new Date().getTime() / 1000;
+                           if (locked_until > now) {
+                               return gettext('Locked');
+                           }
+                       }
+
+                       if (record.data['totp-locked']) {
+                           return gettext('TOTP Locked');
+                       }
+
+                       return Proxmox.Utils.yesText;
                    },
                    dataIndex: 'keys',
                },