From dd12e5db66d89dc7310651a9860cf061141e0d67 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Wed, 8 Aug 2012 22:50:54 +0100 Subject: [PATCH] Fix tp permissions check to check player typing command not teleportee. If you don't want players inviting players to other worlds, do not give them essentials.world. --- Essentials/src/com/earth2me/essentials/commands/Commandtp.java | 2 +- .../src/com/earth2me/essentials/commands/Commandtpahere.java | 2 +- .../src/com/earth2me/essentials/commands/Commandtpall.java | 2 +- .../src/com/earth2me/essentials/commands/Commandtphere.java | 2 +- .../src/com/earth2me/essentials/commands/Commandtpohere.java | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtp.java b/Essentials/src/com/earth2me/essentials/commands/Commandtp.java index c1d4347c6..d6d6b76f9 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtp.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtp.java @@ -58,7 +58,7 @@ public class Commandtp extends EssentialsCommand throw new Exception(_("teleportDisabled", toPlayer.getDisplayName())); } if (target.getWorld() != toPlayer.getWorld() && ess.getSettings().isWorldTeleportPermissions() - && !target.isAuthorized("essentials.world." + toPlayer.getWorld().getName())) + && !user.isAuthorized("essentials.world." + toPlayer.getWorld().getName())) { throw new Exception(_("noPerm", "essentials.world." + toPlayer.getWorld().getName())); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpahere.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpahere.java index dba6bdb87..9d389ecac 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtpahere.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpahere.java @@ -26,7 +26,7 @@ public class Commandtpahere extends EssentialsCommand throw new Exception(_("teleportDisabled", player.getDisplayName())); } if (user.getWorld() != player.getWorld() && ess.getSettings().isWorldTeleportPermissions() - && !player.isAuthorized("essentials.world." + user.getWorld().getName())) + && !user.isAuthorized("essentials.world." + user.getWorld().getName())) { throw new Exception(_("noPerm", "essentials.world." + user.getWorld().getName())); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpall.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpall.java index 98e232609..6335a4a54 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtpall.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpall.java @@ -43,7 +43,7 @@ public class Commandtpall extends EssentialsCommand continue; } if (user.getWorld() != player.getWorld() && ess.getSettings().isWorldTeleportPermissions() - && !player.isAuthorized("essentials.world." + user.getWorld().getName())) + && !user.isAuthorized("essentials.world." + user.getWorld().getName())) { continue; } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtphere.java b/Essentials/src/com/earth2me/essentials/commands/Commandtphere.java index 804176bd3..92eb87226 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtphere.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtphere.java @@ -23,7 +23,7 @@ public class Commandtphere extends EssentialsCommand throw new Exception(_("teleportDisabled", player.getDisplayName())); } if (user.getWorld() != player.getWorld() && ess.getSettings().isWorldTeleportPermissions() - && !player.isAuthorized("essentials.world." + user.getWorld().getName())) + && !user.isAuthorized("essentials.world." + user.getWorld().getName())) { throw new Exception(_("noPerm", "essentials.world." + user.getWorld().getName())); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpohere.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpohere.java index 3f650f96d..880c4e362 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtpohere.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpohere.java @@ -31,7 +31,7 @@ public class Commandtpohere extends EssentialsCommand } if (user.getWorld() != player.getWorld() && ess.getSettings().isWorldTeleportPermissions() - && !player.isAuthorized("essentials.world." + user.getWorld().getName())) + && !user.isAuthorized("essentials.world." + user.getWorld().getName())) { throw new Exception(_("noPerm", "essentials.world." + user.getWorld().getName())); }