From aa6445042163366b225cf65f6ce7186377f2faf6 Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Sat, 27 Jul 2013 16:15:29 +0100 Subject: Removed all the pre-exising core files. --- MCServer/Plugins/Core/web_whitelist.lua | 79 --------------------------------- 1 file changed, 79 deletions(-) delete mode 100644 MCServer/Plugins/Core/web_whitelist.lua (limited to 'MCServer/Plugins/Core/web_whitelist.lua') diff --git a/MCServer/Plugins/Core/web_whitelist.lua b/MCServer/Plugins/Core/web_whitelist.lua deleted file mode 100644 index 2c9ddb953..000000000 --- a/MCServer/Plugins/Core/web_whitelist.lua +++ /dev/null @@ -1,79 +0,0 @@ -local function HTMLDeleteButton( name ) - return "
" -end - -function HandleRequest_WhiteList( Request ) - local UpdateMessage = "" - if( Request.PostParams["whitelist-add"] ~= nil ) then - local PlayerName = Request.PostParams["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.PostParams["whitelist-delete"] ~= nil ) then - local PlayerName = Request.PostParams["whitelist-delete"] - WhiteListIni:DeleteValue( "WhiteList", PlayerName ) - UpdateMessage = "Removed " .. PlayerName .. " from whitelist." - WhiteListIni:WriteFile() - elseif( Request.PostParams["whitelist-reload"] ~= nil ) then - WhiteListIni:Erase() -- Empty entire loaded ini first, otherwise weird shit goes down - WhiteListIni:ReadFile() - UpdateMessage = "Loaded from disk" - elseif( Request.Params["whitelist-setenable"] ~= nil ) then - local Enabled = Request.Params["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 .. "

Whitelisted players

" - Content = Content .. "" - local KeyNum = WhiteListIni:FindKey("WhiteList") - local NumValues = WhiteListIni:GetNumValues(KeyNum) - if( NumValues > 0 ) then - for Num = 0, NumValues-1 do - if( WhiteListIni:GetValue(KeyNum, Num, "0") == "1" ) then - local PlayerName = WhiteListIni:GetValueName(KeyNum, Num ) - Content = Content .. "" - end - end - else - Content = Content .. "" - end - Content = Content .. "
" .. PlayerName .. "" .. HTMLDeleteButton( PlayerName ) .. "
None
" - Content = Content .. "

Add player to whitelist

" - Content = Content .. "
" - Content = Content .. "" - Content = Content .. "
" - Content = Content .. "
" - Content = Content .. "" - Content = Content .. "
" - Content = Content .. "
"..UpdateMessage - - if( WhiteListEnabled == true ) then - Content = Content .. "

Whitelist is currently enabled, click here to disable.

" - end - - return Content -end \ No newline at end of file -- cgit v1.2.3