summaryrefslogtreecommitdiffstats
path: root/EssentialsGroupManager
diff options
context:
space:
mode:
authorElgarL <ElgarL@palmergames.com>2013-02-17 09:22:36 -0800
committerElgarL <ElgarL@palmergames.com>2013-02-17 09:22:36 -0800
commit36e354388caf76288b912aa9e0fc031990dd3ca7 (patch)
tree65e6de51e3ed57ef6e29d485d45a8fe3f934d3e1 /EssentialsGroupManager
parentbbd0021a8b86999d16ba15ee6fb72698d9818376 (diff)
parent880fb29b44c2caee6d325ff17e7596631c1c877b (diff)
downloadEssentials-36e354388caf76288b912aa9e0fc031990dd3ca7.tar
Essentials-36e354388caf76288b912aa9e0fc031990dd3ca7.tar.gz
Essentials-36e354388caf76288b912aa9e0fc031990dd3ca7.tar.lz
Essentials-36e354388caf76288b912aa9e0fc031990dd3ca7.tar.xz
Essentials-36e354388caf76288b912aa9e0fc031990dd3ca7.zip
Merge pull request #338 from necrodoom/patch-57
if variable is inside ' ', strip them
Diffstat (limited to 'EssentialsGroupManager')
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java34
1 files changed, 26 insertions, 8 deletions
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java
index 299db2a22..600be1aba 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java
@@ -718,6 +718,11 @@ public class GroupManager extends JavaPlugin {
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player> <permission>)");
return false;
}
+ String auxString = args[1];
+ if (auxString.startsWith("'") && auxString.endsWith("'"))
+ {
+ auxString = auxString.substring(1, auxString.length() - 1)
+ }
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
return false;
}
@@ -739,13 +744,13 @@ public class GroupManager extends JavaPlugin {
}
// Validating permissions of user
permissionResult = permissionHandler.checkUserOnlyPermission(auxUser, args[1]);
- if (args[1].startsWith("+")) {
+ if (auxString.startsWith("+")) {
if (permissionResult.resultType.equals(PermissionCheckResult.Type.EXCEPTION)) {
sender.sendMessage(ChatColor.RED + "The user already has direct access to that permission.");
sender.sendMessage(ChatColor.RED + "Node: " + permissionResult.accessLevel);
return false;
}
- } else if (args[1].startsWith("-")) {
+ } else if (auxString.startsWith("-")) {
if (permissionResult.resultType.equals(PermissionCheckResult.Type.EXCEPTION)) {
sender.sendMessage(ChatColor.RED + "The user already has an exception for this node.");
sender.sendMessage(ChatColor.RED + "Node: " + permissionResult.accessLevel);
@@ -763,8 +768,8 @@ public class GroupManager extends JavaPlugin {
}
}
// Seems OK
- auxUser.addPermission(args[1]);
- sender.sendMessage(ChatColor.YELLOW + "You added '" + args[1] + "' to player '" + auxUser.getName() + "' permissions.");
+ auxUser.addPermission(auxString);
+ sender.sendMessage(ChatColor.YELLOW + "You added '" + auxString + "' to player '" + auxUser.getName() + "' permissions.");
targetPlayer = this.getServer().getPlayer(auxUser.getName());
if (targetPlayer != null)
@@ -954,6 +959,11 @@ public class GroupManager extends JavaPlugin {
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <group> <permission>)");
return false;
}
+ String auxString = args[1];
+ if (auxString.startsWith("'") && auxString.endsWith("'"))
+ {
+ auxString = auxString.substring(1, auxString.length() - 1)
+ }
auxGroup = dataHolder.getGroup(args[0]);
if (auxGroup == null) {
sender.sendMessage(ChatColor.RED + "The specified group does not exist!");
@@ -967,13 +977,13 @@ public class GroupManager extends JavaPlugin {
}
// Validating permissions of user
permissionResult = permissionHandler.checkGroupOnlyPermission(auxGroup, args[1]);
- if (args[1].startsWith("+")) {
+ if (auxString.startsWith("+")) {
if (permissionResult.resultType.equals(PermissionCheckResult.Type.EXCEPTION)) {
sender.sendMessage(ChatColor.RED + "The group already has direct access to that permission.");
sender.sendMessage(ChatColor.RED + "Node: " + permissionResult.accessLevel);
return false;
}
- } else if (args[1].startsWith("-")) {
+ } else if (auxString.startsWith("-")) {
if (permissionResult.resultType.equals(PermissionCheckResult.Type.EXCEPTION)) {
sender.sendMessage(ChatColor.RED + "The group already has an exception for this node.");
sender.sendMessage(ChatColor.RED + "Node: " + permissionResult.accessLevel);
@@ -991,8 +1001,8 @@ public class GroupManager extends JavaPlugin {
}
}
// Seems OK
- auxGroup.addPermission(args[1]);
- sender.sendMessage(ChatColor.YELLOW + "You added '" + args[1] + "' to group '" + auxGroup.getName() + "' permissions.");
+ auxGroup.addPermission(auxString);
+ sender.sendMessage(ChatColor.YELLOW + "You added '" + auxString + "' to group '" + auxGroup.getName() + "' permissions.");
BukkitPermissions.updateAllPlayers();
@@ -1234,6 +1244,10 @@ public class GroupManager extends JavaPlugin {
auxString += " ";
}
}
+ if (auxString.startsWith("'") && auxString.endsWith("'"))
+ {
+ auxString = auxString.substring(1, auxString.length() - 1)
+ }
auxUser.getVariables().addVar(args[1], Variables.parseVariableValue(auxString));
sender.sendMessage(ChatColor.YELLOW + "Variable " + ChatColor.GOLD + args[1] + ChatColor.YELLOW + ":'" + ChatColor.GREEN + auxString + ChatColor.YELLOW + "' added to the user " + auxUser.getName());
@@ -1382,6 +1396,10 @@ public class GroupManager extends JavaPlugin {
auxString += " ";
}
}
+ if (auxString.startsWith("'") && auxString.endsWith("'"))
+ {
+ auxString = auxString.substring(1, auxString.length() - 1)
+ }
auxGroup.getVariables().addVar(args[1], Variables.parseVariableValue(auxString));
sender.sendMessage(ChatColor.YELLOW + "Variable " + ChatColor.GOLD + args[1] + ChatColor.YELLOW + ":'" + ChatColor.GREEN + auxString + ChatColor.YELLOW + "' added to the group " + auxGroup.getName());