<%@ CodePage=65001 Language="VBScript"%> <% option explicit %> <% GetConfigVariables SetupDatabase dim ischemeid, SQL, sOwner, sResult, sAction, sPostUsername, sPostPassword, bIsAdmin, sError, bError CheckUsername sUsername, sPassword, sResult if bDisableSchemes = 1 then response.redirect "../category-view.asp" if (bBBSRegistrationRequired = 1 or bBBSAuthorizationRequired = 1) and (sResult <> "ok") then response.redirect "../logon.asp?error=needregistration" end if ischemeid= request("schemeid") if len(ischemeid) = 0 or not(isNumeric(ischemeid)) then response.redirect sValidatedBaseURL & "/schemes/view-schemes.asp" sAction = request("action") if len(request("username")) > 0 then sPostUsername = request("username") else sPostUsername = sUsername end if if len(request("password")) > 0 then sPostPassword = request("password") else sPostPassword = sPassword end if ' Check the username CheckUsername sPostUsername, sPostPassword, sResult ' Is the user an adminsitrator bIsAdmin = IsAdmin(sPostUsername, sPostPassword) sError = "You must either be the owner of this color scheme or a color scheme moderator to delete this." SQL = "select * from [colorschemes] where [schemeid]=" & ischemeid rsMaster.open SQL, dbConnection, adOpenForwardOnly, adLockReadOnly if not (rsMaster.EOF) then if sAction="delete" and ucase(sPostUsername) <> ucase(rsMaster("owner")) and not(isAdmin(sPostUsername, sPostPassword) or isColorSchemeModerator(sPostUsername, sPostPassword)) then berror = true end if end if %> <%=validateField(sBBSName)%> : Delete a color scheme <% if bDisplayBBSQuotes = 1 then%>
<%=sBBSRandomQuoteText%> <%=GetRandomQuote%>

<% else %>
<% end if %> <% if bError = False and sAction = "delete" then dbConnection.execute "delete from [colorschemes] where [schemeid]=" & ischemeid &";" %>
This color scheme has been deleted from the database, and any users currently using it will be reassigned to the default scheme.
Actions
Add a color scheme | View the color scheme | Return to the BBS
<% else if not rsMaster.EOF then %>
<%=sError%>
Delete a color scheme originally authored by <%=rsMaster("owner")%>
Username :
Password :
Scheme name : <%=validateField(rsMaster("name"))%>
<% else response.write "

error
Please return to the color scheme list and try again

" end if end if %>