Comparison

plugins/mod_admin_shell.lua @ 12675:db8c795ca81a

mod_admin_shell: Fix output from user:roles() It used _G.print instead of the shell session print, which would silently write to stdout
author Kim Alvefur <zash@zash.se>
date Thu, 25 Aug 2022 22:40:41 +0200
parent 12672:c8f59ce7d3cf
child 12676:3ab3ef9584e3
comparison
equal deleted inserted replaced
12674:72f431b4dc2c 12675:db8c795ca81a
1439 return nil, "Could not change password for user: "..err; 1439 return nil, "Could not change password for user: "..err;
1440 end 1440 end
1441 end 1441 end
1442 1442
1443 function def_env.user:role(jid, host) 1443 function def_env.user:role(jid, host)
1444 local print = self.session.print;
1444 local username, userhost = jid_split(jid); 1445 local username, userhost = jid_split(jid);
1445 if host == nil then host = userhost; end 1446 if host == nil then host = userhost; end
1446 if not prosody.hosts[host] then 1447 if not prosody.hosts[host] then
1447 return nil, "No such host: "..host; 1448 return nil, "No such host: "..host;
1448 elseif prosody.hosts[userhost] and not um.user_exists(username, userhost) then 1449 elseif prosody.hosts[userhost] and not um.user_exists(username, userhost) then