<% local msg = {} if _SESSION["logined"] ~= nil then local admin = _POST["admin"] if admin ~= nil then local oldname = _POST["oldname"] admin = json.decode(admin) if oldname ~= admin.username then c_DeleteAdmin(oldname) end if _SESSION["admin"] == admin.username then admin.readonly = false end AddAdmin(admin) rawset(msg, "code", 0) print(json.encode(msg)) else rawset(msg, "code", -2) rawset(msg, "error", "no admin") print(json.encode(msg)) end else rawset(msg, "code", -1) rawset(msg, "error", "not logged in") print(json.encode(msg)) end %>