<% local msg = {} function in_array(domain,domainArray) for _,tempdomain in pairs(domainArray) do if tempdomain == domain then return true end end return false end function GetOwnDomainList() rawset(msg, "code", 0) local domains = {} local id = 1 local domainArray = Split(_SESSION["admin_domainlist"],",") local bContinue = false for _,domain_str in pairs(c_GetDomainList()) do bContinue = false if _SESSION["admin_domainadmin"] == 1 and in_array(domain_str,domainArray) == false then bContinue = true end if bContinue == false then local domain = {} rawset(domain,"id",id) rawset(domain,"domain",domain_str) rawset(domain,"connections",c_GetSessionCount(domain_str)) rawset(domain,"status",c_IsDomainOnline(domain_str)) table.insert(domains,domain) id = id+1 end end rawset(msg, "data", domains) print(json.encode(msg)) end if _SESSION["logined"] ~= nil then GetOwnDomainList() else rawset(msg, "code", -1) rawset(msg, "error", "not logged in") print(json.encode(msg)) end %>