home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
bombers.k12.ar.us
/
bombers.k12.ar.us.tar
/
bombers.k12.ar.us
/
survey_unconfigured
/
DeleteTemplate.asp
< prev
next >
Wrap
Text File
|
2006-10-25
|
2KB
|
45 lines
<!--#Include File="Include/Top_inc.asp"-->
<%
'***********************************************************************
' Application: SelectSurveyASP Advanced v8.1.11
' Author: Aaron Baril for ClassApps.com
' Page Description: This page deletes a template, and then redirects the
' user back to the list of templates.
'
' 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/CurrentUser_inc.asp"-->
<!--#Include File="Include/SurveySecurity_inc.asp"-->
<!--#Include File="Include/Constants_inc.asp"-->
<%
'In order to delete the template, the user must be the template owner or must be an admin
If IsUserTemplateOwner(Request.QueryString("TemplateID")) = False And lngUserSecurityLevel <> SUR_SECURITY_LEVEL_ADMIN Then
Response.Redirect "AccessDenied.asp?SurveyID=" & Request.QueryString("SurveyID") & "&Reason=" & SUR_ACCESS_DENIED_NOT_TEMPLATE_OWNER
End If
Dim strSQL
Dim conDelete
'Initialization
Set conDelete = Server.CreateObject("ADODB.Connection")
conDelete.Open SURVEY_APP_CONNECTION
'Delete the template from the template table (SUR_TEMPLATE)
strSQL = "DELETE FROM sur_template WHERE template_id = " & Request.QueryString("TemplateID")
conDelete.Execute ConvertSQL(strSQL), , adCmdText
'Clean up
conDelete.Close
Set conDelete = Nothing
'Redirect to the main list of templates
Response.Redirect "TemplateList.asp"
%>