home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
bombers.k12.ar.us
/
bombers.k12.ar.us.tar
/
bombers.k12.ar.us
/
survey
/
EmailListAction.asp
< prev
next >
Wrap
Text File
|
2006-11-29
|
2KB
|
59 lines
<!--#Include File="Include/Top_inc.asp"-->
<%
'***********************************************************************
' Application: SelectSurveyASP Advanced v8.1.11
' Author: Aaron Baril for ClassApps.com
' Page Description: This page works with EmailList.asp, and processes
' the form for registering new email lists by writing a database
' record to the SUR_EMAIL_LIST table.
'
' COPYRIGHT NOTICE
'
' See attached Software License Agreement
'
' (c) Copyright 2002 - 2006 by ClassApps.com. All rights reserved.
'***********************************************************************
%>
<!--#Include File="Include/Config_inc.asp"-->
<!--#Include File="Include/Utility_inc.asp"-->
<!--#Include File="Include/adovbs_inc.asp"-->
<!--#Include File="Include/Constants_inc.asp"-->
<!--#Include File="Include/ID_inc.asp"-->
<!--#Include File="Include/CurrentUser_inc.asp"-->
<!--#Include File="Include/SurveySecurity_inc.asp"-->
<%
'If the user does not have "Create" or "Admin" permission, redirect to the access denied page.
If lngUserSecurityLevel <> SUR_SECURITY_LEVEL_CREATE And lngUserSecurityLevel <> SUR_SECURITY_LEVEL_ADMIN Then
Response.Redirect "AccessDenied.asp?Reason=" & SUR_ACCESS_DENIED_NOT_ADMIN_SECURITY_LEVEL
End If
Dim strSQL
Dim conEmailList
'Initialization
Set conEmailList = Server.CreateObject("ADODB.Connection")
conEmailList.Open SURVEY_APP_CONNECTION
'If the email list was set to be the default, set all the other email lists not to be the defaults
If Request.Form("cboDefault") = SUR_BOOLEAN_POSITIVE Then
strSQL = "UPDATE sur_email_list " & _
"SET default_yn = 'N' " & _
"WHERE user_id = (SELECT user_id FROM sur_user WHERE username = " & SQLEncode(GetUsername()) & ")"
conEmailList.Execute ConvertSQL(strSQL), , adCmdText
End If
'Update the email list
strSQL = "UPDATE sur_email_list " & _
"SET list_name = " & SQLEncode(Request.Form("txtListName")) & ", " & _
"list_description = " & SQLEncode(Request.Form("txtDescription")) & ", " & _
"default_yn = " & SQLEncode(Request.Form("cboDefault")) & _
" WHERE email_list_id = " & Request.Form("EmailListID")
conEmailList.Execute ConvertSQL(strSQL), , adCmdText
'Clean up
conEmailList.Close
Set conEmailList = Nothing
'Redirect back to the list of email lists
Response.Redirect "EmailListList.asp"
%>