<%@ LANGUAGE="VBSCRIPT" %> <% '=============================================== ' Personals System 2002 ' ©2002 vSpin.net. www.vspin.net '=============================================== ' All rights reserved. ' Use of this code is covered by the terms and ' conditions in the license agreement. No ' unauthorized duplication or distribution is ' permitted. vSpin.net copyright notices must ' remain in the ASP sections of the code. '=============================================== %> <% ' *** Restrict Access To Page: Grant or deny access to this page MM_authorizedUsers="user,admin" MM_authFailedURL="login.asp" MM_grantAccess=false If Session("MM_Username") <> "" Then If (false Or CStr(Session("MM_UserAuthorization"))="") Or _ (InStr(1,MM_authorizedUsers,Session("MM_UserAuthorization"))>=1) Then MM_grantAccess = true End If End If If Not MM_grantAccess Then MM_qsChar = "?" If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&" MM_referrer = Request.ServerVariables("URL") if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" & Request.QueryString() MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" & Server.URLEncode(MM_referrer) Response.Redirect(MM_authFailedURL) End If admind = request("admindelete") %> <% dim xxxxm, rsheadUpdatee, rsheadUpdatee_numRows Dim MM_authorizedUsers, MM_authFailedURL, MM_grantAccess, admind, p_id, rsDelete, thepath, fs, aryFileType, numFileLoopCounter, ImageName Dim Uploader, File Set Uploader = New FileUploader Uploader.Upload() if NOT admind = "" AND rsSession("p_access") = "admin" OR rsSession("p_access") = "admin2" Then p_id = request("admindelete") set rsDelete = Server.CreateObject("ADODB.Command") rsDelete.ActiveConnection = MM_conn_STRING rsDelete.CommandText = "DELETE FROM p_ads WHERE p_user = '" + Replace(p_id, "'", "''") + "'" rsDelete.CommandType = 1 rsDelete.CommandTimeout = 0 rsDelete.Prepared = true rsDelete.Execute() set rsDelete = Server.CreateObject("ADODB.Command") rsDelete.ActiveConnection = MM_conn_STRING rsDelete.CommandText = "DELETE FROM p_questions WHERE p_user = '" + Replace(p_id, "'", "''") + "'" rsDelete.CommandType = 1 rsDelete.CommandTimeout = 0 rsDelete.Prepared = true rsDelete.Execute() thepath=Server.MapPath("ad_photos/") set fs=CreateObject("Scripting.FileSystemObject") aryFileType = split("jpg,jpeg,gif,png",",",-1) 'SPLITS LIST OF ACCEPTABLE FILE TYPES IN CONFIG.ASP INTO ARRAY numFileLoopCounter = Ubound(aryFileType) Do while numFileLoopCounter>-1 ImageName = p_id & "." & aryFileType(numFileLoopCounter) set fs=CreateObject("Scripting.FileSystemObject") If fs.FileExists(thepath & "\" & ImageName) then fs.DeleteFile(thepath & "\" & ImageName) End if numFileLoopCounter = numFileLoopCounter-1 Loop set fs=nothing set rsDelete = nothing set MM_conn_STRING = NOTHING response.redirect("default.asp?message=3") end if p_id = Uploader.Form("p_id") if (Session("MM_Username") <> "") then rsSession__MMColParam = Session("MM_Username") set rsDelete = Server.CreateObject("ADODB.Command") rsDelete.ActiveConnection = MM_conn_STRING rsDelete.CommandText = "DELETE FROM p_questions WHERE p_user = '" + Replace(rsSession__MMColParam, "'", "''") + "'" rsDelete.CommandType = 1 rsDelete.CommandTimeout = 0 rsDelete.Prepared = true rsDelete.Execute() set rsDelete2 = Server.CreateObject("ADODB.Command") rsDelete2.ActiveConnection = MM_conn_STRING rsDelete2.CommandText = "DELETE FROM p_ads WHERE p_user = '" + Replace(rsSession__MMColParam, "'", "''") + "' AND p_id = " + Replace(p_id, "'", "''") + "" rsDelete2.CommandType = 1 rsDelete2.CommandTimeout = 0 rsDelete2.Prepared = true rsDelete2.Execute() thepath=Server.MapPath("ad_photos/") set fs=CreateObject("Scripting.FileSystemObject") aryFileType = split("jpg,jpeg,gif,png",",",-1) 'SPLITS LIST OF ACCEPTABLE FILE TYPES IN CONFIG.ASP INTO ARRAY numFileLoopCounter = Ubound(aryFileType) Do while numFileLoopCounter>-1 ImageName = p_id & "." & aryFileType(numFileLoopCounter) set fs=CreateObject("Scripting.FileSystemObject") If fs.FileExists(thepath & "\" & ImageName) then fs.DeleteFile(thepath & "\" & ImageName) End if numFileLoopCounter = numFileLoopCounter-1 Loop set fs=nothing set rsDelete = nothing set MM_conn_STRING = NOTHING response.redirect("default.asp?message=3") %>