73 lines
2.8 KiB
Plaintext
73 lines
2.8 KiB
Plaintext
<%@ Language=JavaScript %>
|
|
<% /*
|
|
$Revision$
|
|
$Id$
|
|
|
|
File: fac_StreamFile.asp
|
|
Description: Streamt een systeemfile. Internal use only, daarom minstens PRSSYS
|
|
|
|
Parameters: logger: 0=reguliere logfile, 1=putorders, 2=immediate putorders, 3=AiAi
|
|
ago: : aantal maanden (Putorders) of dagen (AiAi) terug
|
|
Context:
|
|
Note: Let op dat wel met de Responsebuffer limiet zitten.
|
|
Ongedocumenteerd wordt echter een door StreamFile de parameter zipfile=1 ondersteund
|
|
*/ %>
|
|
<%
|
|
DOCTYPE_Disable = 1;
|
|
var TERMS_CONDITIONS_OK = true;
|
|
var Logging_disable = 1; // Anders geeft *opvragen* van de logfile al logging
|
|
|
|
if (Application("otap_environment") == "O")
|
|
ANONYMOUS_Allowed = 1;
|
|
|
|
%>
|
|
<!-- #include file="../Shared/common.inc" -->
|
|
<!-- #include file="../shared/FlexFiles.inc" -->
|
|
<%
|
|
Application("otap_environment") == "O" || user.checkAutorisation("WEB_PRSSYS"); // Sommige files worden we nog strenger
|
|
|
|
var logger = getQParamInt("logger", -1); // 0=normal, 1=puo_scheduled, 2=puo_immediate. 3=aiai
|
|
|
|
if (logger == 0)
|
|
{
|
|
Application("otap_environment") == "O" || user.checkAutorisation("WEB_FACTAB");
|
|
var logfilename = "log_" + customerId + ".html.log";
|
|
var filePath = Server.MapPath(rooturl + "/") + "/temp";
|
|
StreamFile(filePath, logfilename, "text/html", "inline");
|
|
Response.End;
|
|
}
|
|
|
|
if (logger == 1 || logger == 2) // Putorders
|
|
{
|
|
var ago = getQParamInt("ago", 0);
|
|
var dt = new Date();
|
|
dt.setMonth(dt.getMonth() - ago); // zoveel maanden in het verleden
|
|
var month = dt.getMonth() + 1;
|
|
var year = dt.getYear();
|
|
var schedulelog = logger == 1;
|
|
var logname = "putorders" + (schedulelog?"":"I") + "_" + customerId + "_" + year + "_" + padout(month) + ".log";
|
|
var pathname = schedulelog?"../../cust/" + customerId + "/tasks/":"../../temp/";
|
|
var filePath = Server.MapPath(pathname);
|
|
StreamFile(filePath, logname, "text/plain", "inline");
|
|
Response.End;
|
|
}
|
|
|
|
if (logger == 3) // AiAi
|
|
{
|
|
Application("otap_environment") == "O" || user.checkAutorisation("WEB_FACTAB");
|
|
var f = fso.GetFolder(Server.MapPath(rooturl + "/") + "/temp/");
|
|
var filePath = Server.MapPath(rooturl + "/") + "/temp/500_error";
|
|
if (!fso.FolderExists(filePath))
|
|
abort_with_warning("No AiAi folder?");
|
|
|
|
var ago = getQParamInt("ago", 0);
|
|
var dt = new Date();
|
|
dt.setDate(dt.getDate() - ago); // zoveel dagen in het verleden
|
|
var nowtxt = toISODateString(dt);
|
|
var logfilename = "log_" + nowtxt + ".html.log";
|
|
StreamFile(filePath, logfilename, "text/html", "inline");
|
|
Response.End;
|
|
}
|
|
|
|
%>
|