mod_http_admin_api/mod_http_admin_api.lua
changeset 5783 6ab9e1763f35
parent 5779 4c3216d9b118
child 5785 cb25d341745f
equal deleted inserted replaced
5782:32d662015a84 5783: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 = {