summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2012-03-20 11:53:05 +0000
committerKHobbits <rob@khobbits.co.uk>2012-03-20 11:53:05 +0000
commite752538568a7547f68800df003bd96b46ecedf27 (patch)
treec54d9193853e84e13dab0e0cd046b98ef71ea8e0
parent970364886c4bf2400460c4903381ba295f89dfac (diff)
downloadEssentials-e752538568a7547f68800df003bd96b46ecedf27.tar
Essentials-e752538568a7547f68800df003bd96b46ecedf27.tar.gz
Essentials-e752538568a7547f68800df003bd96b46ecedf27.tar.lz
Essentials-e752538568a7547f68800df003bd96b46ecedf27.tar.xz
Essentials-e752538568a7547f68800df003bd96b46ecedf27.zip
Fix per world teleport permission checking.
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtp.java5
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtpa.java10
2 files changed, 10 insertions, 5 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtp.java b/Essentials/src/com/earth2me/essentials/commands/Commandtp.java
index 72739966b..05451fdcf 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtp.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtp.java
@@ -49,6 +49,11 @@ public class Commandtp extends EssentialsCommand
user.sendMessage(_("teleporting"));
final User target = getPlayer(server, args, 0);
final User toPlayer = getPlayer(server, args, 1);
+ if (target.getWorld() != toPlayer.getWorld() && ess.getSettings().getIsWorldTeleportPermissions()
+ && !user.isAuthorized("essentials.world." + toPlayer.getWorld().getName()))
+ {
+ throw new Exception(_("noPerm", "essentials.world." + toPlayer.getWorld().getName()));
+ }
target.getTeleport().now(toPlayer, false, TeleportCause.COMMAND);
target.sendMessage(_("teleportAtoB", user.getDisplayName(), toPlayer.getDisplayName()));
break;
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpa.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpa.java
index 97fa15d5c..90e8e69d9 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtpa.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpa.java
@@ -25,6 +25,11 @@ public class Commandtpa extends EssentialsCommand
{
throw new Exception(_("teleportDisabled", player.getDisplayName()));
}
+ if (user.getWorld() != player.getWorld() && ess.getSettings().getIsWorldTeleportPermissions()
+ && !user.isAuthorized("essentials.world." + player.getWorld().getName()))
+ {
+ throw new Exception(_("noPerm", "essentials.world." + player.getWorld().getName()));
+ }
if (!player.isIgnoredPlayer(user.getName()))
{
player.requestTeleport(user, false);
@@ -36,11 +41,6 @@ public class Commandtpa extends EssentialsCommand
player.sendMessage(_("teleportRequestTimeoutInfo", ess.getSettings().getTpaAcceptCancellation()));
}
}
- if (user.getWorld() != player.getWorld() && ess.getSettings().getIsWorldTeleportPermissions()
- && !user.isAuthorized("essentials.world." + player.getWorld().getName()))
- {
- throw new Exception(_("noPerm", "essentials.world." + player.getWorld().getName()));
- }
user.sendMessage(_("requestSent", player.getDisplayName()));
}
}