plugins/adhoc/mod_adhoc.lua
changeset 12434 0c1684c65716
parent 12391 05c250fa335a
child 12646 9061f9621330
equal deleted inserted replaced
12433:16a49f04d507 12434:0c1684c65716
    77 		local hostname = jid_host(from);
    77 		local hostname = jid_host(from);
    78 		if (command.permission == "admin" and not admin)
    78 		if (command.permission == "admin" and not admin)
    79 		    or (command.permission == "global_admin" and not global_admin)
    79 		    or (command.permission == "global_admin" and not global_admin)
    80 		    or (command.permission == "local_user" and hostname ~= module.host) then
    80 		    or (command.permission == "local_user" and hostname ~= module.host) then
    81 			origin.send(st.error_reply(stanza, "auth", "forbidden", "You don't have permission to execute this command"):up()
    81 			origin.send(st.error_reply(stanza, "auth", "forbidden", "You don't have permission to execute this command"):up()
    82 			    :add_child(commands[node]:cmdtag("canceled")
    82 			    :add_child(command:cmdtag("canceled")
    83 				:tag("note", {type="error"}):text("You don't have permission to execute this command")));
    83 				:tag("note", {type="error"}):text("You don't have permission to execute this command")));
    84 			return true
    84 			return true
    85 		end
    85 		end
    86 		-- User has permission now execute the command
    86 		-- User has permission now execute the command
    87 		adhoc_handle_cmd(commands[node], origin, stanza);
    87 		adhoc_handle_cmd(command, origin, stanza);
    88 		return true;
    88 		return true;
    89 	end
    89 	end
    90 end, 500);
    90 end, 500);
    91 
    91 
    92 local function adhoc_added(event)
    92 local function adhoc_added(event)