summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsnowleo <schneeleo@gmail.com>2011-07-16 04:05:43 +0200
committersnowleo <schneeleo@gmail.com>2011-07-16 04:05:43 +0200
commitd9b88a83d11540a31551754557ea4c625c65fdb2 (patch)
tree448a530e9372adf231728480cfc1dd654ffe37cb
parenta8fdce257b6160b7edf131a3488af7d22decd6f3 (diff)
downloadEssentials-d9b88a83d11540a31551754557ea4c625c65fdb2.tar
Essentials-d9b88a83d11540a31551754557ea4c625c65fdb2.tar.gz
Essentials-d9b88a83d11540a31551754557ea4c625c65fdb2.tar.lz
Essentials-d9b88a83d11540a31551754557ea4c625c65fdb2.tar.xz
Essentials-d9b88a83d11540a31551754557ea4c625c65fdb2.zip
restricted-commands have been removed from config.yml
Now we have a whitelist: player-commands
-rw-r--r--Essentials/src/com/earth2me/essentials/ConfigPermissionsHandler.java3
-rw-r--r--Essentials/src/com/earth2me/essentials/ISettings.java2
-rw-r--r--Essentials/src/com/earth2me/essentials/Settings.java11
-rw-r--r--Essentials/src/config.yml78
4 files changed, 49 insertions, 45 deletions
diff --git a/Essentials/src/com/earth2me/essentials/ConfigPermissionsHandler.java b/Essentials/src/com/earth2me/essentials/ConfigPermissionsHandler.java
index 9e3b24b0d..200aa34f8 100644
--- a/Essentials/src/com/earth2me/essentials/ConfigPermissionsHandler.java
+++ b/Essentials/src/com/earth2me/essentials/ConfigPermissionsHandler.java
@@ -30,7 +30,8 @@ public class ConfigPermissionsHandler implements IPermissionsHandler
public boolean hasPermission(final Player base, final String node)
{
final String[] cmds = node.split("\\.", 2);
- return !ess.getSettings().isCommandRestricted(cmds[cmds.length - 1]);
+ return !ess.getSettings().isCommandRestricted(cmds[cmds.length - 1])
+ && ess.getSettings().isPlayerCommand(cmds[cmds.length - 1]);
}
public String getPrefix(final Player base)
diff --git a/Essentials/src/com/earth2me/essentials/ISettings.java b/Essentials/src/com/earth2me/essentials/ISettings.java
index c641a8b3f..638f0593a 100644
--- a/Essentials/src/com/earth2me/essentials/ISettings.java
+++ b/Essentials/src/com/earth2me/essentials/ISettings.java
@@ -126,4 +126,6 @@ public interface ISettings extends IConf
boolean removeGodOnDisconnect();
boolean changeDisplayName();
+
+ boolean isPlayerCommand(String string);
}
diff --git a/Essentials/src/com/earth2me/essentials/Settings.java b/Essentials/src/com/earth2me/essentials/Settings.java
index 75063a15b..d63bc7194 100644
--- a/Essentials/src/com/earth2me/essentials/Settings.java
+++ b/Essentials/src/com/earth2me/essentials/Settings.java
@@ -100,6 +100,17 @@ public class Settings implements ISettings
}
return config.getBoolean("restrict-" + label.toLowerCase(), false);
}
+
+ @Override
+ public boolean isPlayerCommand(String label)
+ {
+ for (String c : config.getStringList("player-commands", new ArrayList<String>(0)))
+ {
+ if (!c.equalsIgnoreCase(label)) continue;
+ return true;
+ }
+ return false;
+ }
@Override
public boolean isCommandOverridden(String name)
diff --git a/Essentials/src/config.yml b/Essentials/src/config.yml
index 50c71aa65..d50144956 100644
--- a/Essentials/src/config.yml
+++ b/Essentials/src/config.yml
@@ -114,52 +114,42 @@ overridden-commands:
disabled-commands:
# - nick
-# Restricted commands will only be available to ops.
+# Restricted commands have been removed.
+# Now we have a whitelist, all commands not on this list are only available to ops.
# These will have NO EFFECT if you have Permissions installed!
# These are here only if you want something simpler than Permissions.
-restricted-commands:
- - bigtree
- - item
- - give
- - heal
- - plugin
- - time
- - top
- - tp
- - tphere
- - tree
- - setspawn
- - antioch
- - kick
- - ban
- - unban
- - top
- - jump
- - tpo
- - tppos
- - tpohere
- - economy
- - setwarp
- - delwarp
- - essentials
- - gc
- - spawnmob
- - broadcast
- - burn
- - ext
- - kill
- - ping
- - banip
- - unban
- - mute
- - kick
- - kickall
- - unbanip
- - togglejail
- - setjail
- - eco.loan
- - teleport.timer.bypass
- - teleport.cooldown.bypass
+player-commands:
+ - afk
+ - back
+ - back.ondeath
+ - balance
+ - clearinventory
+ - compass
+ - help
+ - helpop
+ - home
+ - home.others
+ - ignore
+ - info
+ - list
+ - mail
+ - motd
+ - msg
+ - nick
+ - pay
+ - powertool
+ - r
+ - rules
+ - seen
+ - sell
+ - sethome
+ - suicide
+ - tpa
+ - tpaccept
+ - tpahere
+ - tpdeny
+ - world
+ - worth
# Note: All items MUST be followed by a quantity!
# Times are measured in seconds.