Comparison

plugins/mod_admin_shell.lua @ 12018:c65789f5004e

mod_admin_shell: Only check that local users exist locally
author Kim Alvefur <zash@zash.se>
date Mon, 06 Dec 2021 22:23:38 +0100
parent 12014:efbf288b529e
child 12019:a0b6896bb538
comparison
equal deleted inserted replaced
12017:b3f040e57835 12018:c65789f5004e
1333 function def_env.user:roles(jid, host, new_roles) 1333 function def_env.user:roles(jid, host, new_roles)
1334 local username, userhost = jid_split(jid); 1334 local username, userhost = jid_split(jid);
1335 if new_roles == nil then host, new_roles = userhost, host; end 1335 if new_roles == nil then host, new_roles = userhost, host; end
1336 if not prosody.hosts[host] then 1336 if not prosody.hosts[host] then
1337 return nil, "No such host: "..host; 1337 return nil, "No such host: "..host;
1338 elseif not prosody.hosts[userhost] then 1338 elseif prosody.hosts[userhost] and not um.user_exists(username, userhost) then
1339 return nil, "No such host: "..userhost;
1340 elseif not um.user_exists(username, userhost) then
1341 return nil, "No such user"; 1339 return nil, "No such user";
1342 end 1340 end
1343 return um.set_roles(jid, host, coerce_roles(new_roles)); 1341 return um.set_roles(jid, host, coerce_roles(new_roles));
1344 end 1342 end
1345 1343