<% local msg = {} if _SESSION["logined"] ~= nil then local domain = _GET["domain"] or _POST["domain"] local accessway = c_AccessDataWay(domain) local totalrecords = 0 local totalpages = 0 if accessway == 2 or accessway == 3 then totalrecords,totalpages = c_GetUserPageCount(domain) end local data = {} data["accessway"] = accessway data["totalrecords"] = totalrecords data["totalpages"] = totalpages local pages = c_GetGroupPageCount(domain) if pages == 0 then pages = 1 end local grouplist = {} for i=1,pages do local tempGroups = Split(c_GetGroupListPage(domain,i), "\n") for _,tempName in pairs(tempGroups) do if tempName ~= nil and tempName ~= "" then table.insert(grouplist,tempName) end end end table.sort(grouplist, function(a , b) return string.lower(a) < string.lower(b) end) data["grouplist"] = grouplist rawset(msg, "code", 0) rawset(msg, "data", data) print(json.encode(msg)) else rawset(msg, "code", -1) rawset(msg, "error", "not logged in") print(json.encode(msg)) end %>