<%
include("language.html")

if _SESSION["username"] ~= nil and _SESSION["currentpath"] ~= nil then
	local filename = _POST["filename"] or _GET["filename"] or nil
	if filename ~= nil then
		local nowdir = _POST["nowpath"] or _GET["nowpath"] or string.gsub(_SESSION["currentpath"],":{{","%[")
		nowdir = string.gsub(nowdir,"}}:","%]")
		local status = c_CreateNewFile(_SESSION["username"],filename,nowdir)
		if status == 1 then
			c_AddWebLog("Empty file '"..filename.."' created",_SESSION_ID,DOMAIN_LOG_WEB_RESPOND)
			print("")
		else
			print(RESULT_STR[tonumber(status)])
		end
	else
		print(LANG["error_no_filename"])
	end
else
	print("session expired")
end

%>