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
commit1d9218e3d91778066dbf5fc39174d15f4e50c18a (patch)
tree37c01ff37a812c546c2a1352268d1862a5f257f5
parent50443ee16b1fa88818f248e5774e33e13fe27ccc (diff)
downloadEssentials-1d9218e3d91778066dbf5fc39174d15f4e50c18a.tar
Essentials-1d9218e3d91778066dbf5fc39174d15f4e50c18a.tar.gz
Essentials-1d9218e3d91778066dbf5fc39174d15f4e50c18a.tar.lz
Essentials-1d9218e3d91778066dbf5fc39174d15f4e50c18a.tar.xz
Essentials-1d9218e3d91778066dbf5fc39174d15f4e50c18a.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()));
}
}