<% local msg = {} if _SESSION["logined"] ~= nil then local domain = _POST["domain"] local group = _POST["group"] local oldname = _POST["oldname"] local resetstat = _POST["resetstat"] or nil if group ~= nil then group = json.decode(group) if oldname ~= group.groupname then local result = c_GroupExist(domain,group.groupname) if result == true then rawset(msg, "code", -3) rawset(msg, "error", "Group exists") print(json.encode(msg)) else c_DeleteGroup(domain,oldname) AddGroup(domain,group) rawset(msg, "code", 0) print(json.encode(msg)) end else if resetstat ~= nil then c_ResetGroupStatistic(domain,group.groupname) end AddGroup(domain,group) rawset(msg, "code", 0) print(json.encode(msg)) end end else rawset(msg, "code", -1) rawset(msg, "error", "not logged in") print(json.encode(msg)) end %>