Comparison

core/usermanager.lua @ 10695:52886aad9ee1

usermanager: Fix traceback when checking admin status of host-only JIDs (fixes #1508)
author Matthew Wild <mwild1@gmail.com>
date Thu, 19 Mar 2020 14:12:40 +0000
parent 10659:8f95308c3c45
child 11473:afe80b64e209
comparison
equal deleted inserted replaced
10694:0cda5d597607 10695:52886aad9ee1
147 local actor_user, actor_host = jid_split(jid); 147 local actor_user, actor_host = jid_split(jid);
148 local roles; 148 local roles;
149 149
150 local authz_provider = (host ~= "*" and hosts[host].authz) or global_authz_provider; 150 local authz_provider = (host ~= "*" and hosts[host].authz) or global_authz_provider;
151 151
152 if actor_host == host then -- Local user 152 if actor_user and actor_host == host then -- Local user
153 roles = authz_provider.get_user_roles(actor_user); 153 roles = authz_provider.get_user_roles(actor_user);
154 else -- Remote user/JID 154 else -- Remote user/JID
155 roles = authz_provider.get_jid_roles(jid); 155 roles = authz_provider.get_jid_roles(jid);
156 end 156 end
157 157