<% local msg = {} if _SESSION["logined"] ~= nil then local file = _POST["file"] or "" local result = "0" local CanChangedir = true if _SESSION["admin_basefolder"] ~= nil and _SESSION["admin_basefolder"] ~= "" then if c_StringLength(file) < c_StringLength(_SESSION["admin_basefolder"]) then CanChangedir = false else if c_StringFind(file, _SESSION["admin_basefolder"]) == -1 then CanChangedir = false end end end if _SESSION["admin_readonly"] ~= nil and _SESSION["admin_readonly"] == 1 then rawset(msg, "code", -2) rawset(msg, "error", "read only admin") print(json.encode(msg)) exit() end if _SESSION["admin_domainadmin"] ~= nil and _SESSION["admin_domainadmin"] == 1 then if c_StringFind(file.gsub(file,"//", "/").."/", c_GetAppPath() ) > -1 then rawset(msg, "code", -3) rawset(msg, "error", "domain admin") print(json.encode(msg)) exit() end end if file ~= nil and file ~= "" and CanChangedir == true then if c_FileExist(file) == true then rawset(msg, "code", 0) print(json.encode(msg)) exit() end end rawset(msg, "code", -4) rawset(msg, "error", "Invalid file path") print(json.encode(msg)) else rawset(msg, "code", -1) rawset(msg, "error", "not logged in") print(json.encode(msg)) end %>