summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2011-08-24 02:48:38 +0100
committerKHobbits <rob@khobbits.co.uk>2011-08-24 02:48:38 +0100
commit767362c9d8748fc91ee3fa77f3de17b46d60044b (patch)
tree7be4e08c3e49921f9b26df7224f778eb8fa96a1f
parentc7903459acb9ddf42dfc7f0f5370375842d0a033 (diff)
downloadEssentials-767362c9d8748fc91ee3fa77f3de17b46d60044b.tar
Essentials-767362c9d8748fc91ee3fa77f3de17b46d60044b.tar.gz
Essentials-767362c9d8748fc91ee3fa77f3de17b46d60044b.tar.lz
Essentials-767362c9d8748fc91ee3fa77f3de17b46d60044b.tar.xz
Essentials-767362c9d8748fc91ee3fa77f3de17b46d60044b.zip
Essentials.sethome.others doesn't imply essentials.sethome.multiple.
Restore essentials.home.others permission check.
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandhome.java2
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandsethome.java18
2 files changed, 16 insertions, 4 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandhome.java b/Essentials/src/com/earth2me/essentials/commands/Commandhome.java
index 2b285bfe7..f556ea360 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandhome.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandhome.java
@@ -25,7 +25,7 @@ public class Commandhome extends EssentialsCommand
if (args.length > 0)
{
nameParts = args[0].split(":");
- if (nameParts[0].length() == args[0].length())
+ if (nameParts[0].length() == args[0].length() || !user.isAuthorized("essentials.home.others"))
{
homeName = nameParts[0];
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java b/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java
index 594804de0..7f496371f 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java
@@ -17,16 +17,23 @@ public class Commandsethome extends EssentialsCommand
{
if (args.length > 0)
{
+ //Allowing both formats /sethome khobbits house | /sethome khobbits:house
+ final String[] nameParts = args[0].split(":");
+ if (nameParts[0].length() != args[0].length())
+ {
+ args = nameParts;
+ }
+
if (args.length < 2)
{
if (user.isAuthorized("essentials.sethome.multiple"))
{
if ((user.isAuthorized("essentials.sethome.multiple.unlimited")) || (user.getHomes().size() < ess.getSettings().getMultipleHomes())
- || (user.getHomes().contains(args[0].toLowerCase())))
+ || (user.getHomes().contains(args[0].toLowerCase())))
{
user.setHome(args[0].toLowerCase());
}
- else
+ else
{
throw new Exception(Util.format("maxHomes", ess.getSettings().getMultipleHomes()));
}
@@ -46,7 +53,12 @@ public class Commandsethome extends EssentialsCommand
{
throw new Exception(Util.i18n("playerNotFound"));
}
- usersHome.setHome(args[1].toLowerCase(), user.getLocation());
+ String name = args[1].toLowerCase();
+ if (!user.isAuthorized("essentials.sethome.multiple"))
+ {
+ name = "home";
+ }
+ usersHome.setHome(name, user.getLocation());
}
}
}