{% -- ADMIN ONLY if verified and verified.privs ~= 255 then verified = nil end if verified then local pohst = request:post() if pohst and pohst.csrf and DB.csrfverify(verified.id, Escapes.urlunescape(tostring(pohst.csrf))) then -- Basic settings if pohst["sitename"] and not Escapes.urlunescape(pohst["sitename"]):match"^%s*$" then BigGlobe.cfg.sitename = Escapes.urlspunescape(pohst["sitename"]) end BigGlobe.cfg.enable18plus = pohst["enable18plus"] ~= nil -- Tag categories for i=1,BigGlobe.cfg.tc.n do if pohst["tcn" .. i] then BigGlobe.cfg.tc[i].name = Escapes.urlspunescape(pohst["tcn" .. i]) end if pohst["tcc" .. i] then BigGlobe.cfg.tc[i].col = tonumber(Escapes.urlunescape(pohst["tcc" .. i]):sub(2), 16) or 0 end end -- New tag if pohst["ntn"] and tonumber(pohst["ntc"]) then local cat = tonumber(pohst["ntc"]) if cat >= 1 and cat <= BigGlobe.cfg.tc.n then DB.tagadd(Escapes.urlspunescape(pohst["ntn"]), cat, pohst["nta"] ~= nil) end end -- Tag editing if pohst["ettags"] and (#pohst["ettags"] > 0) then local tagarr = {} for tagstr in pohst["ettags"]:gmatch("%d+") do table.insert(tagarr, tonumber(tagstr)) end local newname = pohst["etname"] and Escapes.urlspunescape(pohst["etname"]) if newname and newname:match"^%s*$" then newname = nil end local newcategory = tonumber(pohst["etcat"]) local newadultonly = pohst["eta"] ~= nil local del = pohst["etdel"] if del and del:match"^%s*$" then del = nil end DB.updatetags(tagarr, newname, newcategory, newadultonly, del) end -- Mods if pohst["mods"] then local newmods = {} for m in Escapes.urlspunescape(pohst["mods"]):gmatch"[^,]+" do if not m:match("^%s*$") then table.insert(newmods, m) end end DB.setmodsviaemails(newmods) end -- Ruleset if pohst["ruleset"] then BigGlobe.cfg.ruleset = Escapes.urlspunescape(pohst["ruleset"]) end -- X-Sendfile if pohst["sendfilehdr"] then BigGlobe.cfg.sendfile = Escapes.urlunescape(pohst["sendfilehdr"]) end if pohst["sendfileprefix"] then BigGlobe.cfg.sendfileprefix = Escapes.urlunescape(pohst["sendfileprefix"]) end BigGlobe.sv() end else response:statusCode(403) end %} {% title = "Administrative Settings" %} {% function content() %} {% if verified then %}
{% else %}You are not authorized to view this page.
{% end %} {% end %} {# base.inc