summaryrefslogtreecommitdiffstats
path: root/MCServer/Plugins/ProtectionAreas/Storage.lua
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-06-08 21:49:26 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-06-08 21:49:26 +0200
commit52fcb41dd374f8acdefc602474ff14de8929fd45 (patch)
treed32065d28a139fc141cfae994b2d4ee35457b1e2 /MCServer/Plugins/ProtectionAreas/Storage.lua
parentProtectionAreas: Implemented adding users to an area in the DB (diff)
downloadcuberite-52fcb41dd374f8acdefc602474ff14de8929fd45.tar
cuberite-52fcb41dd374f8acdefc602474ff14de8929fd45.tar.gz
cuberite-52fcb41dd374f8acdefc602474ff14de8929fd45.tar.bz2
cuberite-52fcb41dd374f8acdefc602474ff14de8929fd45.tar.lz
cuberite-52fcb41dd374f8acdefc602474ff14de8929fd45.tar.xz
cuberite-52fcb41dd374f8acdefc602474ff14de8929fd45.tar.zst
cuberite-52fcb41dd374f8acdefc602474ff14de8929fd45.zip
Diffstat (limited to 'MCServer/Plugins/ProtectionAreas/Storage.lua')
-rw-r--r--MCServer/Plugins/ProtectionAreas/Storage.lua12
1 files changed, 10 insertions, 2 deletions
diff --git a/MCServer/Plugins/ProtectionAreas/Storage.lua b/MCServer/Plugins/ProtectionAreas/Storage.lua
index defa9b394..c444016f2 100644
--- a/MCServer/Plugins/ProtectionAreas/Storage.lua
+++ b/MCServer/Plugins/ProtectionAreas/Storage.lua
@@ -289,8 +289,16 @@ end
--- Removes the user from all areas in the specified world
function cStorage:RemoveUserAll(a_UserName, a_WorldName)
- -- TODO
- LOGWARNING("cStorage:RemoveUserAll(): Not implemented yet!");
+ assert(a_UserName);
+ assert(a_WorldName);
+ assert(self);
+
+ local sql = "DELETE FROM AllowedUsers WHERE UserName = '" .. a_UserName .."'";
+ if (not(self:DBExec(sql))) then
+ LOGWARNING("SQL error while removing user " .. a_UserName .. " from all areas");
+ return false;
+ end
+ return true;
end