mirror of
https://github.com/minetest-mods/xban2.git
synced 2025-03-20 23:01:26 +00:00
Filter fields submission by privs.
This commit is contained in:
parent
33e3fcd15b
commit
877e550787
1 changed files with 5 additions and 0 deletions
5
gui.lua
5
gui.lua
|
@ -100,6 +100,11 @@ end
|
||||||
minetest.register_on_player_receive_fields(function(player, formname, fields)
|
minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||||
if formname ~= FORMNAME then return end
|
if formname ~= FORMNAME then return end
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
|
if not minetest.check_player_privs(name, { ban=true }) then
|
||||||
|
minetest.log("warning",
|
||||||
|
"[xban2] Received fields from unauthorized user: "..name)
|
||||||
|
return
|
||||||
|
end
|
||||||
local state = get_state(name)
|
local state = get_state(name)
|
||||||
if fields.player then
|
if fields.player then
|
||||||
local t = minetest.explode_textlist_event(fields.player)
|
local t = minetest.explode_textlist_event(fields.player)
|
||||||
|
|
Loading…
Add table
Reference in a new issue