%@ LANGUAGE = "VBScript" ENABLESESSIONSTATE = True %>
<%Option Explicit%>
<%Response.Buffer = True%>
<%
'***********************************************************
'** Copyright Notice **
'** Tassietek - MailerPro **
'** Copyright 2001-2004 Tassietek All Rights Reserved. **
'***********************************************************
'** PREVENT PAGE FROM BEING CACHED
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 2
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "No-Store"
'** CHECKING TO SEE IF LOGGED IN IF NOT TAKE YOU TO THE LOGIN PAGE
If Request.Cookies("login") = "" Then
Response.Cookies("action") = "error"
Response.Write("")
Response.End
Elseif Request.Cookies("login") = "3" Then
Response.Redirect"sendemail.asp"
End If
If Session("Start") = "" Then
Response.Cookies("a") = "ended"
Response.Redirect"login.asp?logoff=1"
End If
%>
<%
'** VARIABLES
Dim strerror
Dim strnotfound
Dim rs
Dim sql
'** ADDING BANNED EMAIL OR DOMAIN TO BANNED TABLE
If Request("action") = "ban" Then
'** CHECKING TO SEE IF ALREADY IN ALL LISTS
Set rs = conn.execute("Select * From " & tbl_prefix & "banned Where banned = '" & Trim(Lcase(Request("fld_ban"))) & "' And type = " & Request("fld_type") & " And listID = 'all_lists'",adOpenForwardOnly,adLockReadOnly)
If err <> 0 Then
Response.Write""
err.clear
Response.End
End If
If Not rs.EOF Then
strerror = Trim(Lcase(Request("fld_ban"))) & " as already been banned in All Lists."
strnotfound = "false"
Else
strnotfound = "true"
End If
rs.close
Set rs = nothing
'** CHECKING TO SEE IF ALREADY IN ALL LISTS
If Request("fld_ban") <> "all_lists" Then
Set rs = conn.execute("Select * From " & tbl_prefix & "banned Where banned = '" & Trim(Lcase(Request("fld_ban"))) & "' And type = " & Request("fld_type") & " And listID = 'all_lists'",adOpenForwardOnly,adLockReadOnly)
If err <> 0 Then
Response.Write""
err.clear
Response.End
End If
If Not rs.EOF Then
strerror = Trim(Lcase(Request("fld_ban"))) & " as already been banned in All Lists."
strnotfound = "false"
Else
strnotfound = "true"
End If
rs.close
Set rs = nothing
End If
'** IF NOT FOUND ADDING TO BANNED TABLE
If strnotfound = "true" Then
Set rs = conn.execute("Select * From " & tbl_prefix & "banned Where listID = '" & Request("fld_list_name") & "' And banned = '" & Trim(Lcase(Request("fld_ban"))) & "' And type = " & Request("fld_type"),adOpenForwardOnly,adLockReadOnly)
If err <> 0 Then
Response.Write""
err.clear
Response.End
End If
If rs.EOF Then
conn.execute"Insert Into " & tbl_prefix & "banned (listID,banned,type) Values ('" & Request("fld_list_name") & "','" & Trim(Lcase(Request("fld_ban"))) & "'," & Request("fld_type") & ")", ,adExecuteNoRecords
If err <> 0 Then
Response.Write""
err.clear
Response.End
End If
Else
strerror = Trim(Lcase(Request("fld_ban"))) & " as already been banned in " & getlistname(Request("fld_list_name")) & "."
End If
rs.Close
Set rs = nothing
End If
End If
%>
<%
'** ASSURING THAT ALL DATABASE CONNECTIONS ARE CLOSED
On Error Resume Next
rs.close
Set rs = nothing
rsfun.close
Set rsfun = nothing
conn.close
Set conn = nothing
on error goto 0
%>