diff options
4 files changed, 22 insertions, 12 deletions
diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index 4bd878828..5e9fbee56 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -368,6 +368,19 @@ public class Essentials extends JavaPlugin implements IEssentials return true; } + if (user != null && user.isJailed() && !user.isAuthorized(cmd, "essentials.jail.allow.")) + { + if (user.getJailTimeout() > 0) + { + user.sendMessage(_("playerJailedFor", user.getName(), Util.formatDateDiff(user.getJailTimeout()))); + } + else + { + user.sendMessage(_("jailMessage")); + } + return true; + } + // Run the command try { @@ -471,7 +484,7 @@ public class Essentials extends JavaPlugin implements IEssentials } return null; } - + @Override public User getOfflineUser(final String name) { diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index 1c5d04530..bb1e290f4 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -80,11 +80,6 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser return false; } - if (isJailed()) - { - return false; - } - try { return ess.getPermissionsHandler().hasPermission(base, node); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandseen.java b/Essentials/src/com/earth2me/essentials/commands/Commandseen.java index fc5a1f033..5c204fda5 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandseen.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandseen.java @@ -45,10 +45,10 @@ public class Commandseen extends EssentialsCommand : _("true") : _("false")))); sender.sendMessage(_("whoisMuted", (user.isMuted() - ? user.getMuteTimeout() > 0 - ? Util.formatDateDiff(user.getMuteTimeout()) - : _("true") - : _("false")))); + ? user.getMuteTimeout() > 0 + ? Util.formatDateDiff(user.getMuteTimeout()) + : _("true") + : _("false")))); if (extra) { sender.sendMessage(_("whoisIPAddress", user.getAddress().getAddress().toString())); @@ -71,7 +71,8 @@ public class Commandseen extends EssentialsCommand { sender.sendMessage(_("whoisIPAddress", player.getLastLoginAddress())); final Location loc = player.getLastLocation(); - if (loc != null) { + if (loc != null) + { sender.sendMessage(_("whoisLocation", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())); } } diff --git a/Essentials/src/com/earth2me/essentials/textreader/HelpInput.java b/Essentials/src/com/earth2me/essentials/textreader/HelpInput.java index 4efb6c43f..b091e2135 100644 --- a/Essentials/src/com/earth2me/essentials/textreader/HelpInput.java +++ b/Essentials/src/com/earth2me/essentials/textreader/HelpInput.java @@ -47,6 +47,7 @@ public class HelpInput implements IText newLines.clear(); lines.add(_("helpFrom", p.getDescription().getName())); } + final boolean isOnWhitelist = user.isAuthorized("essentials.help." + pluginNameLow); for (Map.Entry<String, Map<String, Object>> k : cmds.entrySet()) { @@ -81,7 +82,7 @@ public class HelpInput implements IText { permissions = value.get(PERMISSIONS); } - if (user.isAuthorized("essentials.help." + pluginNameLow)) + if (isOnWhitelist || user.isAuthorized("essentials.help." + pluginNameLow + "." + k.getKey())) { pluginLines.add(_("helpLine", k.getKey(), value.get(DESCRIPTION))); } |