comparison mod_http_admin_api/mod_http_admin_api.lua @ 5779:6ab9e1763f35

mod_http_admin_api: Include information about pending deletion request, if any
author Matthew Wild <mwild1@gmail.com>
date Wed, 06 Dec 2023 19:13:26 +0000
parents 4c3216d9b118
children cb25d341745f
comparison
equal deleted inserted replaced
5778:32d662015a84 5779:6ab9e1763f35
28 28
29 local xmlns_pubsub = "http://jabber.org/protocol/pubsub"; 29 local xmlns_pubsub = "http://jabber.org/protocol/pubsub";
30 local xmlns_nick = "http://jabber.org/protocol/nick"; 30 local xmlns_nick = "http://jabber.org/protocol/nick";
31 31
32 assert(mod_lastlog2.get_last_active, "Newer version of mod_lastlog2 is required to use this module"); 32 assert(mod_lastlog2.get_last_active, "Newer version of mod_lastlog2 is required to use this module");
33
34 local deleted_users = module:open_store("accounts_cleanup");
33 35
34 local function check_credentials(request) 36 local function check_credentials(request)
35 local auth_type, auth_data = string.match(request.headers.authorization or "", "^(%S+)%s(.+)$"); 37 local auth_type, auth_data = string.match(request.headers.authorization or "", "^(%S+)%s(.+)$");
36 if not (auth_type and auth_data) then 38 if not (auth_type and auth_data) then
37 return false; 39 return false;
209 role = primary_role and primary_role.name or nil; 211 role = primary_role and primary_role.name or nil;
210 secondary_roles = secondary_roles; 212 secondary_roles = secondary_roles;
211 roles = legacy_roles; -- COMPAT w/0.12 213 roles = legacy_roles; -- COMPAT w/0.12
212 enabled = enabled; 214 enabled = enabled;
213 last_active = mod_lastlog2.get_last_active(username); 215 last_active = mod_lastlog2.get_last_active(username);
216 deletion_request = deleted_users:get(username);
214 }; 217 };
215 end 218 end
216 219
217 local function get_session_debug_info(session) 220 local function get_session_debug_info(session)
218 local info = { 221 local info = {