1
0
mirror of https://github.com/SmallJoker/bitchange.git synced 2024-11-15 23:30:18 +01:00

Restrict title edit access to owner, fixes #11

This commit is contained in:
SmallJoker 2017-12-04 20:33:36 +01:00
parent 7aff3b50bb
commit e7798768d4

View File

@ -191,15 +191,15 @@ minetest.register_on_player_receive_fields(function(sender, formname, fields)
return
end
local meta = minetest.get_meta(pos)
local title = meta:get_string("title") or ""
local shop_owner = meta:get_string("owner")
if fields.quit then
exchange_shop[player_name] = nil
return
end
local meta = minetest.get_meta(pos)
local title = meta:get_string("title")
local shop_owner = meta:get_string("owner")
if fields.title then
if fields.title and bitchange.has_access(shop_owner, player_name) then
-- Limit title length
fields.title = fields.title:sub(1, 80)
if title ~= fields.title then