<%
dim SQL, objCon, gid
gid = request.form("gid")
SQL = replace(trim(request("banemail"))," ", "")
if request("DO")="ban" then
if SQL<>"" then
SQL = "'"&replace(SQL,vbcrlf,"','")&"'"
SQL = "Update pgd_members Set banned=1 WHERE Email in ("&SQL&")"
set objCon = server.createobject("adodb.connection")
With objCon
.open = datastore
.execute SQL, , adExecuteNoRecords + adCmdText
.close
End With
set objCon = nothing
end if
response.write ("Users with invalid addresses banned successfully.
")
elseif request("DO")="movetogroup" then
Dim arrEmails, strSQL, strFinalEmail
if SQL<>"" and gid<>"-1" then
arrEmails = split(SQL,vbcrlf)
SQL = "'"&replace(SQL,vbcrlf,"','")&"'"
if isArray(arrEmails) then
set objcon = server.createobject("adodb.connection")
with objcon
.open datastore
for i = 0 to ubound(arrEmails)
if len(arrEmails(i))<>0 then
strSQL = dbOwnerPrefix&"spAddUserToGroup ("&gid&", 0,'"&arrEmails(i)&"', 1)"
.execute strSQL, , adCmdStoredProc+adExecuteNoRecords
'strFinalEmail = strFinalEmail&trim(arrEmails(i))&"','"
end if
next
.close
end with
set objcon = nothing
'strFinalEmail = "'"&CheckDelimitedFormat(strFinalEmail,"','")&"'"
end if
end if
if len(SQL)<>0 then call SendGroupWelcome ("",gid,SQL)
response.write ("Users with the above addresses moved successfully.
")
Application.lock
Application(dbName&"updatePMcache") = 1 ' cache needs updating
Application.unlock
end if
%>