<%@language = "javascript" %>
<% /*
    $Revision$
    $Id$

    File:    WisLog.asp
    Remark:  Wist de html logfile of zet de logging aan/uit
             Je moet ingelogd zijn met FACTAB rechten
    Context: Met knop vanuit de logfile
*/
var TERMS_CONDITIONS_OK = true;

if (Application("otap_environment") == "O")
    ANONYMOUS_Allowed = 1;
%>
<!--#include file="../Shared/common.inc"-->
<%
    Application("otap_environment") == "O" || user.checkAutorisation("WEB_FACTAB");

    var fso = Server.CreateObject("Scripting.FileSystemObject");
    var logurl = shared.tempFolder() + "/log_" + customerId + ".html";

    if (CheckForLogging(Request.QueryString("logging")))
    {
        if (__Logging > 0)
            Response.Redirect(rooturl + "/appl/fac/fac_StreamFile.asp?logger=0");
        else
            Response.Write("Logging is nu uit");
        Response.End;
    }

    var logfile = logurl;
    if (fso.FileExists(logfile))
    {
        fso.DeleteFile (logfile);
        Response.Write("Logfile " + logfile + " has been erased.");
        __DoLog("Logfile cleared at " + toISODateTimeString(new Date(), true));
        Response.Redirect (rooturl + "/appl/fac/fac_StreamFile.asp?logger=0");
    }
    else
    {
        Response.Write("Strange: file " & logfile & " not found?")
    }
%>
<% ASPPAGE_END(); %> 
