%
If Not session("admin_loggedin" & strSUnique) = Session.SessionID then Response.Redirect "default.asp"
Dim newRecords, masterUser
setLocale server_locale
userID = Request.form("ID")
adminTask = Request.form("itask")
If userID = Empty Or adminTask = Empty or Not isNumeric(userID) then
msg = "
Invalid Request!
"
Else
strSQLIDMatch = " WHERE userID = " & userID & ";"
set rs = objConn.Execute("SELECT " & tablUPfx & "User.userID, " & tablUPfx & "User.moder, " & tablUPfx & "User.elist, " & tablUPfx & "User.credits, " & tablUPfx & "User.ads FROM " & tablUPfx & "User" & strSQLIDMatch)
moderStatus = rs(1)
elistStatus = rs(2)
creditStatus = CCur(rs(3))
If moderStatus then moderStatus = 0: Else: moderStatus = 1
If elistStatus then elistStatus = 0: Else: elistStatus = 1
ads = rs(4)
If rs.EOF then
msg = "User Account Not Found!
"
Else
Select Case LCase(adminTask)
Case "delete"
If ads = 0 then
objConn.Execute("DELETE FROM " & tablUPfx & "User" & strSQLIDMatch)
objConn.Execute("DELETE FROM " & tablPfx & "Agent WHERE userID = " & userID & ";")
If isEvents then Call logEvent("Account Deleted", " User ID: " & userID, Empty, Empty, Empty, Empty)
Response.Redirect "admin_user.asp"
Else: Response.Write "
You must delete All Ads posted by this user First!
"
End If
Case "suspend"
objConn.Execute("UPDATE " & tablUPfx & "User SET status = " & 2 & strSQLIDMatch)
If isEvents then Call logEvent("Account Suspended", userID, userID, Empty, Empty, Empty)
Response.Redirect "admin_user.asp"
Case "activate"
objConn.Execute("UPDATE " & tablUPfx & "User SET status = " & 0 & strSQLIDMatch)
If isEvents then Call logEvent("Account Activated", userID, userID, " - Activated By Admin", Empty, Empty)
Response.Redirect "admin_user.asp"
Case "moderator"
objConn.Execute("UPDATE " & tablUPfx & "User SET moder = " & moderStatus & strSQLIDMatch)
Response.Redirect "admin_user.asp"
Case "add_credit"
credit = FormatNumber(creditStatus + CCur(Request.Form("D1")), 2)
objConn.Execute("UPDATE " & tablUPfx & "User SET credits = '" & credit & "'" & strSQLIDMatch)
Response.Redirect "admin_userdetp.asp?" & Request.Querystring
Case "remove_credit"
credit = FormatNumber(creditStatus - CCur(Request.Form("D1")), 2)
objConn.Execute("UPDATE " & tablUPfx & "User SET credits = '" & credit & "'" & strSQLIDMatch)
Response.Redirect "admin_userdetp.asp?" & Request.Querystring
Case "maillist"
objConn.Execute("UPDATE " & tablUPfx & "User SET elist = " & elistStatus & strSQLIDMatch)
Response.Redirect "admin_user.asp"
Case Else : msg = "Invalid Request!
"
End Select
End If
rs.close
End If
%>