HEX
Server: Microsoft-IIS/10.0
System: Windows NT ITPWINWEBSVR22 10.0 build 20348 (Windows Server 2022) AMD64
User: www.conferencesearch.co.uk (0)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: D:/web/hyperflight/! bs5/scanner-block.asp
<%Option Explicit%>
<html>
<head>
<title>Scanner Block</title>
</head>

<body>

<%
' /scanner-block.asp  (protect behind auth or a secret key as needed)
' (SS,16/11/25) see ChatGPT (Remove IIS server header)
Dim action : action = LCase(Request("action"))

If action = "start" Then
  Application.Lock
  Application("ScannerBlockUntil") = DateAdd("h", 24, Now())
  Application.Unlock
  Response.Write "Suppression ON until: " & Application("ScannerBlockUntil")

ElseIf action = "until" Then
  ' Set a custom end timestamp, e.g. /scanner-block.asp?action=until&ts=2025-11-17 18:00
  Dim ts : ts = Trim(Request("ts") & "")
  If ts <> "" Then
    Application.Lock
    Application("ScannerBlockUntil") = CDate(ts)
    Application.Unlock
    Response.Write "Suppression ON until: " & Application("ScannerBlockUntil")
  Else
    Response.Write "Provide ts=YYYY-MM-DD hh:mm"
  End If

ElseIf action = "stop" Then
  Application.Lock
  Application("ScannerBlockUntil") = Null
  Application.Unlock
  Response.Write "Suppression OFF"

Else
  Dim v : v = Application("ScannerBlockUntil")
  Response.Write "Status: "
  If IsEmpty(v) Or IsNull(v) Or (CStr(v) = "") Then
    Response.Write "OFF"
  Else
    Response.Write "ON until " & v
  End If
  Response.Write "<br>Use ?action=start | ?action=until&ts=YYYY-MM-DD hh:mm | ?action=stop"
End If
%>

</body>
</html>