+ .."label[.5,1.2;"..minetest.formspec_escape("Be careful! This replaces the current init code for env "..env.name.." with the contents at the URL!").."]"
+ .."label[.5,1.2;"..minetest.formspec_escape("Be careful! This replaces the current init code for env "..env.name.." with the contents at the URL!").."]"
+ .."button[8.5,2;2.5,1;urlsave;Save URL only]"
+ .."button[8.5,2;2.5,1;urlsave;Save URL only]"
+ .."label[4,0;"..msg.."]"
+ .."label[2.5,0;"..msg.."]"
+ if http then
+ if http then
+ form = form.."button[1,2;3,1;replace;Replace init code] button[4.5,2;3.5,1;replacerun;Replace and Run init code]"
+ form = form.."button[1,2;3,1;replace;Replace init code] button[4.5,2;3.5,1;replacerun;Replace and Run init code]"
+ if fields.replace or fields.replacerun or fields.urlsave then
+ if fields.replace or fields.replacerun or fields.urlsave then
+ if fields.sync_url ~= env.sync_url then
+ if fields.sync_url ~= env.sync_url then
+ if minetest.check_player_privs(pname, {atlatc_sync_seturl=true}) then
+ env.sync_url = fields.sync_url
+ env.sync_url = fields.sync_url
+ env.sync_err = nil
+ env.sync_err = nil
+ else
+ minetest.show_formspec(pname, formname, get_sync_form(env, pname, "You don't have the privilege to set the URL for the init code. (atlatc_sync_seturl)"))
minetest.register_privilege("atlatc", { description = "Player can place and modify LUA ATC components. Grant with care! Allows to execute bad LUA code.", give_to_singleplayer = false, default= false })
minetest.register_privilege("atlatc", { description = "Player can place and modify LUA ATC components. Grant with care! Allows to execute bad LUA code.", give_to_singleplayer = false, default= false })
+minetest.register_privilege("atlatc_sync", { description = "Player can overwrite init code of LUA ATC environments with content at a remote URL. GRANT WITH MUCH CARE! Allows to easily introduce and execute bad LUA code if able to influence the code the set URL is pointing to.", give_to_singleplayer = false, default= false })
+minetest.register_privilege("atlatc_sync_seturl", { description = "Player can set the sync URL of LUA ATC environments. GRANT WITH EXTREME CARE! Allows to immediately introduce and execute any bad LUA code. Best leave this to admins.", give_to_singleplayer = false, default= false })
@@ -22,9 +22,9 @@
--Size of code input forms in X,Y notation. Must be at least 10x10