local function HTMLDeleteButton( name ) return "
" end function HandleRequest_WhiteList( Request ) local UpdateMessage = "" if( Request.Params:get("whitelist-add") ~= "" ) then local PlayerName = Request.Params:get("whitelist-add") if( WhiteListIni:GetValueB("WhiteList", PlayerName, false) == true ) then UpdateMessage = "".. PlayerName.." is already on the whitelist" else WhiteListIni:SetValueB("WhiteList", PlayerName, true ) UpdateMessage = "Added " .. PlayerName .. " to whitelist." WhiteListIni:WriteFile() end elseif( Request.Params:get("whitelist-delete") ~= "" ) then local PlayerName = Request.Params:get("whitelist-delete") WhiteListIni:DeleteValue( "WhiteList", PlayerName ) UpdateMessage = "Removed " .. PlayerName .. " from whitelist." WhiteListIni:WriteFile() elseif( Request.Params:get("whitelist-reload") ~= "" ) then WhiteListIni:Erase() -- Empty entire loaded ini first, otherwise weird shit goes down WhiteListIni:ReadFile() UpdateMessage = "Loaded from disk" elseif( Request.Params:get("whitelist-setenable") ~= "" ) then local Enabled = Request.Params:get("whitelist-setenable"); local CreateNewValue = false; if( WhiteListIni:FindValue( WhiteListIni:FindKey("WhiteListSettings"), "WhiteListOn" ) == cIniFile.noID ) then -- Find out whether the value is in the ini CreateNewValue = true end if( Enabled == "1" ) then WhiteListIni:SetValueB("WhiteListSettings", "WhiteListOn", true, CreateNewValue ) else WhiteListIni:SetValueB("WhiteListSettings", "WhiteListOn", false, CreateNewValue ) end WhiteListIni:WriteFile() end local Content = "" local WhiteListEnabled = WhiteListIni:GetValueB("WhiteListSettings", "WhiteListOn", false) if( WhiteListEnabled == false ) then Content = Content .. "Whitelist is currently disabled! Click here to enable.
" end Content = Content .. "" .. PlayerName .. " | " .. HTMLDeleteButton( PlayerName ) .. " |
None |
Whitelist is currently enabled, click here to disable.
" end return Content end