mod_http_admin_api: Include information about pending deletion request, if any
authorMatthew Wild <mwild1@gmail.com>
Wed, 06 Dec 2023 19:13:26 +0000
changeset 5783 6ab9e1763f35
parent 5782 32d662015a84
child 5784 f199bff16f1f
mod_http_admin_api: Include information about pending deletion request, if any
mod_http_admin_api/mod_http_admin_api.lua
--- a/mod_http_admin_api/mod_http_admin_api.lua	Wed Dec 06 15:50:46 2023 +0000
+++ b/mod_http_admin_api/mod_http_admin_api.lua	Wed Dec 06 19:13:26 2023 +0000
@@ -31,6 +31,8 @@
 
 assert(mod_lastlog2.get_last_active, "Newer version of mod_lastlog2 is required to use this module");
 
+local deleted_users = module:open_store("accounts_cleanup");
+
 local function check_credentials(request)
 	local auth_type, auth_data = string.match(request.headers.authorization or "", "^(%S+)%s(.+)$");
 	if not (auth_type and auth_data) then
@@ -211,6 +213,7 @@
 		roles = legacy_roles; -- COMPAT w/0.12
 		enabled = enabled;
 		last_active = mod_lastlog2.get_last_active(username);
+		deletion_request = deleted_users:get(username);
 	};
 end