home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
bombers.k12.ar.us
/
bombers.k12.ar.us.tar
/
bombers.k12.ar.us
/
survey
/
DeleteUser.asp
< prev
next >
Wrap
Text File
|
2006-11-29
|
2KB
|
49 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 single user.
'
' 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/ID_inc.asp"-->
<!--#Include File="Include/CurrentUser_inc.asp"-->
<!--#Include File="Include/SurveySecurity_inc.asp"-->
<!--#Include File="Include/Constants_inc.asp"-->
<%
'In order to delete a user, the user must have "Admin" permission
If lngUserSecurityLevel <> SUR_SECURITY_LEVEL_ADMIN Then
Response.Redirect "AccessDenied.asp?Reason=" & SUR_ACCESS_DENIED_NOT_ADMIN_SECURITY_LEVEL
End If
Dim strSQL
Dim conDeleteUser
'Initialization
Set conDeleteUser = Server.CreateObject("ADODB.Connection")
conDeleteUser.Open SURVEY_APP_CONNECTION
'Delete the entry from the role to user mapping table (SUR_USER_TO_ROLE_MAPPING)
strSQL = "DELETE FROM sur_user_to_role_mapping WHERE user_id = " & Request.QueryString("UserID")
conDeleteUser.Execute ConvertSQL(strSQL), , adCmdText
'Delete the user from the user table (SUR_USER)
strSQL = "DELETE FROM sur_user WHERE user_id = " & Request.QueryString("UserID")
conDeleteUser.Execute ConvertSQL(strSQL), , adCmdText
'Clean up
conDeleteUser.Close
Set conDeleteUser = Nothing
'Only admins can delete users, so direct back to the list of users.
Response.Redirect "UserList.asp"
%>