Diff

plugins/mod_auth_internal_hashed.lua @ 12903:13950bf92802

mod_auth_internal_hashed: Implement methods to enable and disable users
author Kim Alvefur <zash@zash.se>
date Thu, 23 Feb 2023 14:44:35 +0100
parent 12902:0a0a251bcd6c
child 12916:5a06d07596f9
line wrap: on
line diff
--- a/plugins/mod_auth_internal_hashed.lua	Thu Feb 23 14:34:10 2023 +0100
+++ b/plugins/mod_auth_internal_hashed.lua	Thu Feb 23 14:44:35 2023 +0100
@@ -117,12 +117,17 @@
 	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()