Software /
code /
prosody-modules
Comparison
mod_http_admin_api/mod_http_admin_api.lua @ 6309:342f88e8d522 draft default tip
Merge update
author | Trần H. Trung <xmpp:trần.h.trung@trung.fun> |
---|---|
date | Sun, 15 Jun 2025 01:08:46 +0700 |
parent | 6280:4b52d579bc70 |
comparison
equal
deleted
inserted
replaced
6279:b92aea4e7ff4 | 6309:342f88e8d522 |
---|---|
13 local announce = module:depends("announce"); | 13 local announce = module:depends("announce"); |
14 local invites = module:depends("invites"); | 14 local invites = module:depends("invites"); |
15 local tokens = module:depends("tokenauth"); | 15 local tokens = module:depends("tokenauth"); |
16 local mod_pep = module:depends("pep"); | 16 local mod_pep = module:depends("pep"); |
17 local mod_groups = module:depends("groups_internal"); | 17 local mod_groups = module:depends("groups_internal"); |
18 local mod_lastlog2 = module:depends("lastlog2"); | 18 local mod_account_activity = module:depends("account_activity"); |
19 | 19 |
20 local push_errors = module:shared("cloud_notify/push_errors"); | 20 local push_errors = module:shared("cloud_notify/push_errors"); |
21 | 21 |
22 local site_name = module:get_option_string("site_name", module.host); | 22 local site_name = module:get_option_string("site_name", module.host); |
23 | 23 |
27 | 27 |
28 local www_authenticate_header = ("Bearer realm=%q"):format(module.host.."/"..module.name); | 28 local www_authenticate_header = ("Bearer realm=%q"):format(module.host.."/"..module.name); |
29 | 29 |
30 local xmlns_pubsub = "http://jabber.org/protocol/pubsub"; | 30 local xmlns_pubsub = "http://jabber.org/protocol/pubsub"; |
31 local xmlns_nick = "http://jabber.org/protocol/nick"; | 31 local xmlns_nick = "http://jabber.org/protocol/nick"; |
32 | |
33 assert(mod_lastlog2.get_last_active, "Newer version of mod_lastlog2 is required to use this module"); | |
34 | 32 |
35 local deleted_users = module:open_store("accounts_cleanup"); | 33 local deleted_users = module:open_store("accounts_cleanup"); |
36 | 34 |
37 local function check_credentials(request) | 35 local function check_credentials(request) |
38 local auth_type, auth_data = string.match(request.headers.authorization or "", "^(%S+)%s(.+)$"); | 36 local auth_type, auth_data = string.match(request.headers.authorization or "", "^(%S+)%s(.+)$"); |
240 display_name = display_name; | 238 display_name = display_name; |
241 role = primary_role and primary_role.name or nil; | 239 role = primary_role and primary_role.name or nil; |
242 secondary_roles = secondary_roles; | 240 secondary_roles = secondary_roles; |
243 roles = legacy_roles; -- COMPAT w/0.12 | 241 roles = legacy_roles; -- COMPAT w/0.12 |
244 enabled = enabled; | 242 enabled = enabled; |
245 last_active = mod_lastlog2.get_last_active(username); | 243 last_active = mod_account_activity.get_last_active(username); |
246 deletion_request = not enabled and deleted_users:get(username) or nil; | 244 deletion_request = not enabled and deleted_users:get(username) or nil; |
247 avatar_info = get_user_avatar_info(username); | 245 avatar_info = get_user_avatar_info(username); |
248 }; | 246 }; |
249 end | 247 end |
250 | 248 |