<% local msg = {} if _SESSION["logined"] ~= nil then local domain = _POST["domain"] local stop = _POST["stop"] if stop ~= nil then c_StopDomain(domain,stop) c_AddAdminLog("administrator '".._SESSION["admin"].."' put domain ["..unescape(domain).."] offline.",ADMIN_LOG_OK) else c_StartDomain(domain) c_AddAdminLog("administrator '".._SESSION["admin"].."' put domain ["..unescape(domain).."] online.",ADMIN_LOG_OK) end for _,domain in pairs(c_GetDomainList()) do local online = tostring(c_IsDomainOnline(domain)) rawset(_SESSION,"online_"..domain,online) end SessionModule.save(_SESSION_ID) rawset(msg, "code", 0) print(json.encode(msg)) else rawset(msg, "code", -1) rawset(msg, "error", "not logged in") print(json.encode(msg)) end %>