2 Commits

Author SHA1 Message Date
785dc10644 Version 1.0.3-1 2013-02-20 16:11:04 +01:00
c671f04f65 Security Fix: added missing permission check for enable/disable border 2013-02-20 15:59:58 +01:00
4 changed files with 14 additions and 5 deletions

Binary file not shown.

View File

@ -5,7 +5,7 @@
<groupId>de.craftinc</groupId> <groupId>de.craftinc</groupId>
<artifactId>CraftincBorderProtection</artifactId> <artifactId>CraftincBorderProtection</artifactId>
<packaging>jar</packaging> <packaging>jar</packaging>
<version>1.0.3</version> <version>1.0.3-1</version>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

View File

@ -127,15 +127,24 @@ public class Commands implements CommandExecutor
// on // on
if ( args.length == 1 && ( args[0].equalsIgnoreCase("on") || args[0].equalsIgnoreCase("off") ) ) if ( args.length == 1 && ( args[0].equalsIgnoreCase("on") || args[0].equalsIgnoreCase("off") ) )
{ {
if ( !sender.hasPermission("craftinc.borderprotection.set") )
{
sender.sendMessage(Messages.noPermissionSet);
return false;
}
World world = ( (Player) sender ).getWorld(); World world = ( (Player) sender ).getWorld();
Border border = Border.getBorders().get(world); Border border = Border.getBorders().get(world);
if (border != null) if ( border != null )
{
if ( args[0].equalsIgnoreCase("on") )
{ {
if (args[0].equalsIgnoreCase("on")) {
border.enable(); border.enable();
sender.sendMessage(Messages.borderEnabled); sender.sendMessage(Messages.borderEnabled);
} else { }
else
{
border.disable(); border.disable();
sender.sendMessage(Messages.borderDisabled); sender.sendMessage(Messages.borderDisabled);
} }

View File

@ -95,7 +95,7 @@ public class Messages
ChatColor.YELLOW + "No border in this world."; ChatColor.YELLOW + "No border in this world.";
public static String noPermissionSet = public static String noPermissionSet =
ChatColor.RED + "Sorry, you don't have permission to set the border."; ChatColor.RED + "Sorry, you don't have permission to change the border.";
public static String borderEnabled = public static String borderEnabled =
ChatColor.YELLOW + "Border enabled."; ChatColor.YELLOW + "Border enabled.";