From a45484c1313e25faa7cad4bdc7cd71f1a459f2f4 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Mon, 6 Dec 2021 22:23:38 +0100 Subject: mod_admin_shell: Only check that local users exist locally --- plugins/mod_admin_shell.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'plugins/mod_admin_shell.lua') diff --git a/plugins/mod_admin_shell.lua b/plugins/mod_admin_shell.lua index b7800764..98ddc7e3 100644 --- a/plugins/mod_admin_shell.lua +++ b/plugins/mod_admin_shell.lua @@ -1335,9 +1335,7 @@ function def_env.user:roles(jid, host, new_roles) if new_roles == nil then host, new_roles = userhost, host; end if not prosody.hosts[host] then return nil, "No such host: "..host; - elseif not prosody.hosts[userhost] then - return nil, "No such host: "..userhost; - elseif not um.user_exists(username, userhost) then + elseif prosody.hosts[userhost] and not um.user_exists(username, userhost) then return nil, "No such user"; end return um.set_roles(jid, host, coerce_roles(new_roles)); -- cgit v1.2.3