<%
	'get pathToImageDir or pathToFileDir
	dim KT_PATH_VAR : KT_PATH_VAR = ""
	if UCase(Request.QueryString("submode")) = "FILE" then
		'we have pathToFileDir
		KT_PATH_VAR = Session("KTML2security")(5, intCounter)
	elseif UCase(Request.QueryString("submode")) = "IMG" then
		'we have pathToImageDir
		KT_PATH_VAR = Session("KTML2security")(4, intCounter)
	else
		'Response.Write "<script>alert('submode not passed!')</script>"
		'Response.End
	end if
	if len(ALT_PATH) > 0 then
		KT_PATH_VAR = ALT_PATH & KT_PATH_VAR
	end if

	'the checks must be made with realpaths
	dim minPath,realPath
	minPath = Server.MapPath(KT_PATH_VAR)
	realPath = Server.MapPath(KT_PATH_VAR & Request.QueryString("currentPath"))
	
	'''''''''''''''''''
	'Response.Write "realPath = " & realPath & "<br>"
	'Response.Write "minPath = " & minPath & "<br>"
	'Response.End

	dim secTest : secTest = false
	if Session("KTML2security")(9, intCounter) = 1 then
		if InStr(1,realPath, minPath)>=1 then 
			secTest = true
		end if
	end if

	'$sessionTest = isset($HTTP_SESSION_VARS["KTML2security"]) && isset($HTTP_GET_VARS['counter']) && isset($HTTP_SESSION_VARS["KTML2security"][$HTTP_GET_VARS['counter']]);
%>
