From fe206323b5a8e04c8c5efe2b6519ac9d7f611f91 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Thu, 23 Feb 2023 14:44:35 +0100 Subject: mod_auth_internal_hashed: Implement methods to enable and disable users --- plugins/mod_auth_internal_hashed.lua | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'plugins/mod_auth_internal_hashed.lua') diff --git a/plugins/mod_auth_internal_hashed.lua b/plugins/mod_auth_internal_hashed.lua index d5fa8e12..0bafa23b 100644 --- a/plugins/mod_auth_internal_hashed.lua +++ b/plugins/mod_auth_internal_hashed.lua @@ -117,12 +117,17 @@ function provider.is_enabled(username) -- luacheck: ignore 212 return info.enabled; end -function provider.enable(username) -- luacheck: ignore 212 - error "NYI" +function provider.enable(username) + -- TODO map store? + local account = accounts:get(username); + account.disabled = nil; + return accounts:set(username, account); end -function provider.disable(username) -- luacheck: ignore 212 - error "NYI" +function provider.disable(username) + local account = accounts:get(username); + account.disabled = true; + return accounts:set(username, account); end function provider.users() -- cgit v1.2.3