<% '################################################################################# '## Snitz Forums 2000 v3.4.07 '################################################################################# '## Copyright (C) 2000-09 Michael Anderson, Pierre Gorissen, '## Huw Reddick and Richard Kinser '## '## This program is free software; you can redistribute it and/or '## modify it under the terms of the GNU General Public License '## as published by the Free Software Foundation; either version 2 '## of the License, or (at your option) any later version. '## '## All copyright notices regarding Snitz Forums 2000 '## must remain intact in the scripts and in the outputted HTML '## The "powered by" text/logo with a link back to '## http://forum.snitz.com in the footer of the pages MUST '## remain visible when the pages are viewed on the internet or intranet. '## '## This program is distributed in the hope that it will be useful, '## but WITHOUT ANY WARRANTY; without even the implied warranty of '## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the '## GNU General Public License for more details. '## '## You should have received a copy of the GNU General Public License '## along with this program; if not, write to the Free Software '## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. '## '## Support can be obtained from our support forums at: '## http://forum.snitz.com '## '## Correspondence and Marketing Questions can be sent to: '## manderson@snitz.com '## '################################################################################# %> <% If Session(strCookieURL & "Approval") <> "15916941253" Then scriptname = split(request.servervariables("SCRIPT_NAME"),"/") Response.Redirect "admin_login.asp?target=" & scriptname(ubound(scriptname)) End If Response.Write " " & vbNewLine & _ " " & vbNewLine & _ " " & vbNewLine & _ " " & vbNewLine & _ "
" & vbNewLine & _ " " & getCurrentIcon(strIconFolderOpen,"","") & " All Forums
" & vbNewLine & _ " " & getCurrentIcon(strIconBar,"","") & getCurrentIcon(strIconFolderOpen,"","") & " Admin Section
" & vbNewLine & _ " " & getCurrentIcon(strIconBlank,"","") & getCurrentIcon(strIconBar,"","") & getCurrentIcon(strIconFolderOpenTopic,"","") & " Blocked E-Mail Domains
" & vbNewLine Dim strMethodType If Request.Form("Method_Type") <> "" Then strMethodType = LCase(Trim(Request.Form("Method_Type"))) Else If Request.QueryString("Method_Type") <> "" Then strMethodType = LCase(Trim(Request.QueryString("Method_Type"))) Else strMethodType = "blank" End If End If Select Case strMethodType Case "add" '### Add the e-mail domain to the list Dim strSpammServer : strSpammServer = LCase(Trim(chkString(Request.Form("SpamServer"),"sqlstring"))) Err_Msg = "" if strSpammServer = "" then Err_Msg = Err_Msg & "
  • You need to enter an address to block.
  • " end if if (Instr(strSpammServer, " ") > 0 ) then Err_Msg = Err_Msg & "
  • You cannot have spaces in your address.
  • " end if 'Comment out down to the next comment to let it take me@example.com and/or .ex as well If Left(strSpammServer,1) = "@" Then If InStr(1,strSpammServer,".",vbTextCompare) = 0 Then Err_Msg = Err_Msg & "
  • You need to have a TLD (.com, .net, .whatever) in your address.
  • " End If Else If InStr(1,strSpammServer,"@",vbTextCompare) <> 0 Then Err_Msg = Err_Msg & "
  • You can only enter a domain (@example.com), not a specific address (me@example.com).
  • " Else If InStr(1,strSpammServer,".",vbTextCompare) = 0 Then Err_Msg = Err_Msg & "
  • You need to enter a valid domain (@example.com).
  • " Else strSpammServer = "@" & strSpammServer End If End If End if 'Comment out up to the previous comment to let it take me@example.com and/or .ex as well If Err_Msg = "" Then strSQL = "SELECT SPAM_ID, SPAM_SERVER FROM " & strFilterTablePrefix & "SPAM_MAIL WHERE SPAM_SERVER = '"& strSpammServer &"'" set rs = my_conn.execute(strSQL) If Not rs.EOF And Not rs.BOF Then Err_Msg = Err_Msg & "
  • '" & strSpammServer & "' is already in the list.
  • " End If rs.Close Set rs = Nothing End If if Err_Msg = "" then strSQL = "INSERT INTO " & strFilterTablePrefix & "SPAM_MAIL (SPAM_SERVER) VALUES ('" & strSpammServer & "')" my_Conn.Execute (strSql) Response.Write "

    " & _ "E-Mail domain added.

    Back to the list

    " & vbNewLine & _ "" & vbNewLine else Response.Write "

    There Was A Problem With Your Details

    " & vbNewLine & _ " " & vbNewLine & _ " " & vbNewLine & _ " " & vbNewLine & _ " " & vbNewLine & _ "
      " & Err_Msg & "
    " & vbNewLine & _ "

    Go Back To Enter Data

    " & vbNewLine end if '############### Add SpamServer end Case "delete" '### Delete the domain from the list if its a valid ID If Request.QueryString("id") <> "" And IsNumeric(Request.QueryString("id")) Then Dim intSpamID : intSpamID = cLng(Request.QueryString("id")) strSQL = "DELETE FROM " & strFilterTablePrefix & "SPAM_MAIL WHERE SPAM_ID = " & intSpamID my_Conn.Execute (strSql) Response.Write "

    " & _ "E-Mail domain deleted.

    Back to the list

    " & vbNewLine & _ "" & vbNewLine Else 'Not a numerid ID, forward them to the admin page Response.Redirect("admin_spamserver.asp") End If '############### Delete SpamServer end Case Else '### Show the admin form and the list of currently blocked domains Response.Write " " & vbNewLine & _ " " & vbNewLine & _ " " & vbNewLine & _ " " & vbNewLine & _ "
    " & vbNewLine & _ " " & vbNewLine & _ " " & vbNewLine & _ " " & vbNewLine & _ " " & vbNewLine & _ " " & vbNewLine & _ " " & vbNewLine & _ " " & vbNewLine & _ " " & vbNewLine & _ " " & vbNewLine & _ " " & vbNewLine & _ " "& vbNewLine & _ " " & vbNewLine & _ " " & vbNewLine & _ "
    Blocked E-Mail Domains
    Insert E-Mail Domain: 
    " & _ "(Like '@example.com') 
    " & _ "
    " & vbNewLine & _ " " & vbNewLine & _ " 
    E-Mail Domains blocked: " & vbNewLine Set rs = my_conn.Execute("SELECT SPAM_ID, SPAM_SERVER FROM " & strFilterTablePrefix & "SPAM_MAIL") If rs.EOF or rs.BOF Then Response.Write "No blocked e-mail domains found." & vbNewLine Else Do Until rs.EOF Response.Write rs("SPAM_SERVER") & " " & getCurrentIcon(strIconTrashcan,"Delete Spam Server address","") & "
    " & vbNewLine rs.MoveNext Loop End If rs.Close Set rs = Nothing Response.Write "
    " & vbNewLine & _ "
    " & vbNewLine End Select WriteFooter %>