summaryrefslogtreecommitdiffstats
path: root/MCServer/Plugins/ProtectionAreas/Storage.lua
diff options
context:
space:
mode:
Diffstat (limited to '')
-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