summaryrefslogtreecommitdiffstats
path: root/Plugins/Core/web_whitelist.lua
diff options
context:
space:
mode:
authorfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-01-31 21:56:42 +0100
committerfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-01-31 21:56:42 +0100
commit968f41ba511f8f74377b1a1c7b61ff759ebe3078 (patch)
treec52f95f94444254cd93e8e3460f7013eaab18b41 /Plugins/Core/web_whitelist.lua
parentSlight code cleanup, no big changes (diff)
downloadcuberite-968f41ba511f8f74377b1a1c7b61ff759ebe3078.tar
cuberite-968f41ba511f8f74377b1a1c7b61ff759ebe3078.tar.gz
cuberite-968f41ba511f8f74377b1a1c7b61ff759ebe3078.tar.bz2
cuberite-968f41ba511f8f74377b1a1c7b61ff759ebe3078.tar.lz
cuberite-968f41ba511f8f74377b1a1c7b61ff759ebe3078.tar.xz
cuberite-968f41ba511f8f74377b1a1c7b61ff759ebe3078.tar.zst
cuberite-968f41ba511f8f74377b1a1c7b61ff759ebe3078.zip
Diffstat (limited to 'Plugins/Core/web_whitelist.lua')
-rw-r--r--Plugins/Core/web_whitelist.lua16
1 files changed, 8 insertions, 8 deletions
diff --git a/Plugins/Core/web_whitelist.lua b/Plugins/Core/web_whitelist.lua
index 1a99a9f95..2c9ddb953 100644
--- a/Plugins/Core/web_whitelist.lua
+++ b/Plugins/Core/web_whitelist.lua
@@ -4,8 +4,8 @@ end
function HandleRequest_WhiteList( Request )
local UpdateMessage = ""
- if( Request.PostParams:get("whitelist-add") ~= "" ) then
- local PlayerName = Request.PostParams:get("whitelist-add")
+ if( Request.PostParams["whitelist-add"] ~= nil ) then
+ local PlayerName = Request.PostParams["whitelist-add"]
if( WhiteListIni:GetValueB("WhiteList", PlayerName, false) == true ) then
UpdateMessage = "<b>".. PlayerName.."</b> is already on the whitelist"
@@ -14,18 +14,18 @@ function HandleRequest_WhiteList( Request )
UpdateMessage = "Added <b>" .. PlayerName .. "</b> to whitelist."
WhiteListIni:WriteFile()
end
- elseif( Request.PostParams:get("whitelist-delete") ~= "" ) then
- local PlayerName = Request.PostParams:get("whitelist-delete")
+ elseif( Request.PostParams["whitelist-delete"] ~= nil ) then
+ local PlayerName = Request.PostParams["whitelist-delete"]
WhiteListIni:DeleteValue( "WhiteList", PlayerName )
UpdateMessage = "Removed <b>" .. PlayerName .. "</b> from whitelist."
WhiteListIni:WriteFile()
- elseif( Request.PostParams:get("whitelist-reload") ~= "" ) then
+ 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:get("whitelist-setenable") ~= "" ) then
- local Enabled = Request.Params:get("whitelist-setenable");
- local CreateNewValue = false;
+ 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