]> git.proxmox.com Git - pve-access-control.git/blobdiff - PVE/API2/User.pm
bump version to 5.1-9
[pve-access-control.git] / PVE / API2 / User.pm
index 89c83430165e1ce84b2dbe051b48cae0c8c06d63..4458fc1edb35f0f2dfb9dd9f654810bab6007ca2 100644 (file)
@@ -15,7 +15,6 @@ use PVE::RESTHandler;
 use base qw(PVE::RESTHandler);
 
 register_standard_option('user-enable', {
-    title => "Enable",
     description => "Enable the account (default). You can set this to '0' to disable the account",
     type => 'boolean',
     optional => 1,
@@ -356,11 +355,14 @@ __PACKAGE__->register_method ({
                    $plugin->delete_user($cfg, $realm, $ruid);
                }
 
+               # Remove TFA data before removing the user entry as the user entry tells us whether
+               # we need ot update priv/tfa.cfg.
+               PVE::AccessControl::user_set_tfa($userid, $realm, undef, undef, $usercfg, $domain_cfg);
+
                delete $usercfg->{users}->{$userid};
 
                PVE::AccessControl::delete_user_group($userid, $usercfg);
                PVE::AccessControl::delete_user_acl($userid, $usercfg);
-
                cfs_write_file("user.cfg", $usercfg);
            }, "delete user failed");