<% local msg = {} if _SESSION["logined"] ~= nil then local domain = _POST["domain"] local bindaddress = _POST["bindaddress"] local ftp_port = _POST["ftp_port"] local ftps_port = _POST["ftps_port"] local http_port = _POST["http_port"] local https_port = _POST["https_port"] local ssh_port = _POST["ssh_port"] if domain ~= nil then local result = c_AddDomain(domain,bindaddress,ftp_port,ftps_port,http_port,https_port,ssh_port) if result == 1 then for _,domain in pairs(c_GetDomainList()) do local online = tostring(c_IsDomainOnline(domain)) rawset(_SESSION,"online_"..domain,online) end SessionModule.save(_SESSION_ID) end if result == 1 then rawset(msg, "code", 0) print(json.encode(msg)) else if result == 2 then rawset(msg, "code", -2) print(json.encode(msg)) else rawset(msg, "code", -3) print(json.encode(msg)) end end end else rawset(msg, "code", -1) rawset(msg, "error", "not logged in") print(json.encode(msg)) end %>