mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-12-25 01:57:53 +01:00
Handle client security checks properly
This commit is contained in:
parent
c39cb2d3e7
commit
2c4f5c6b9f
@ -18,7 +18,7 @@ allprojects {
|
||||
apply plugin: 'java'
|
||||
|
||||
group = 'us.dynmap'
|
||||
version = '3.1-beta-3'
|
||||
version = '3.1-SNAPSHOT'
|
||||
|
||||
}
|
||||
|
||||
|
@ -455,7 +455,7 @@ public class DynmapPlugin
|
||||
|
||||
private boolean hasPerm(EntityPlayer psender, String permission) {
|
||||
PermissionsHandler ph = PermissionsHandler.getHandler();
|
||||
if((psender != null) && ph.hasPermission(psender.getEntity().getName().getString(), permission)) {
|
||||
if((psender != null) && (ph != null) && ph.hasPermission(psender.getEntity().getName().getString(), permission)) {
|
||||
return true;
|
||||
}
|
||||
return permissions.has(psender, permission);
|
||||
@ -463,7 +463,7 @@ public class DynmapPlugin
|
||||
|
||||
private boolean hasPermNode(EntityPlayer psender, String permission) {
|
||||
PermissionsHandler ph = PermissionsHandler.getHandler();
|
||||
if((psender != null) && ph.hasPermissionNode(psender.getEntity().getName().getString(), permission)) {
|
||||
if((psender != null) && (ph != null) && ph.hasPermissionNode(psender.getEntity().getName().getString(), permission)) {
|
||||
return true;
|
||||
}
|
||||
return permissions.hasPermissionNode(psender, permission);
|
||||
@ -1594,8 +1594,12 @@ public class DynmapPlugin
|
||||
{
|
||||
dsender = new ForgeCommandSender(sender);
|
||||
}
|
||||
|
||||
try {
|
||||
core.processCommand(dsender, cmd, cmd, args);
|
||||
} catch (Exception x) {
|
||||
dsender.sendMessage("Command internal error: " + x.getMessage());
|
||||
Log.severe("Error with command: " + cmd + Arrays.deepToString(args), x);
|
||||
}
|
||||
}
|
||||
|
||||
private DynmapLocation toLoc(World worldObj, double x, double y, double z)
|
||||
|
@ -481,7 +481,7 @@ public class DynmapPlugin
|
||||
|
||||
private boolean hasPerm(PlayerEntity psender, String permission) {
|
||||
PermissionsHandler ph = PermissionsHandler.getHandler();
|
||||
if((psender != null) && ph.hasPermission(psender.getEntity().getName().getString(), permission)) {
|
||||
if((psender != null) && (ph != null) && ph.hasPermission(psender.getEntity().getName().getString(), permission)) {
|
||||
return true;
|
||||
}
|
||||
return permissions.has(psender, permission);
|
||||
@ -489,7 +489,7 @@ public class DynmapPlugin
|
||||
|
||||
private boolean hasPermNode(PlayerEntity psender, String permission) {
|
||||
PermissionsHandler ph = PermissionsHandler.getHandler();
|
||||
if((psender != null) && ph.hasPermissionNode(psender.getEntity().getName().getString(), permission)) {
|
||||
if((psender != null) && (ph != null) && ph.hasPermissionNode(psender.getEntity().getName().getString(), permission)) {
|
||||
return true;
|
||||
}
|
||||
return permissions.hasPermissionNode(psender, permission);
|
||||
@ -1620,8 +1620,12 @@ public class DynmapPlugin
|
||||
{
|
||||
dsender = new ForgeCommandSender(sender);
|
||||
}
|
||||
|
||||
try {
|
||||
core.processCommand(dsender, cmd, cmd, args);
|
||||
} catch (Exception x) {
|
||||
dsender.sendMessage("Command internal error: " + x.getMessage());
|
||||
Log.severe("Error with command: " + cmd + Arrays.deepToString(args), x);
|
||||
}
|
||||
}
|
||||
|
||||
private DynmapLocation toLoc(World worldObj, double x, double y, double z)
|
||||
|
@ -482,7 +482,7 @@ public class DynmapPlugin
|
||||
|
||||
private boolean hasPerm(PlayerEntity psender, String permission) {
|
||||
PermissionsHandler ph = PermissionsHandler.getHandler();
|
||||
if((psender != null) && ph.hasPermission(psender.getEntity().getName().getString(), permission)) {
|
||||
if((psender != null) && (ph != null) && ph.hasPermission(psender.getEntity().getName().getString(), permission)) {
|
||||
return true;
|
||||
}
|
||||
return permissions.has(psender, permission);
|
||||
@ -490,7 +490,7 @@ public class DynmapPlugin
|
||||
|
||||
private boolean hasPermNode(PlayerEntity psender, String permission) {
|
||||
PermissionsHandler ph = PermissionsHandler.getHandler();
|
||||
if((psender != null) && ph.hasPermissionNode(psender.getEntity().getName().getString(), permission)) {
|
||||
if((psender != null) && (ph != null) && ph.hasPermissionNode(psender.getEntity().getName().getString(), permission)) {
|
||||
return true;
|
||||
}
|
||||
return permissions.hasPermissionNode(psender, permission);
|
||||
@ -1620,8 +1620,12 @@ public class DynmapPlugin
|
||||
{
|
||||
dsender = new ForgeCommandSender(sender);
|
||||
}
|
||||
|
||||
try {
|
||||
core.processCommand(dsender, cmd, cmd, args);
|
||||
} catch (Exception x) {
|
||||
dsender.sendMessage("Command internal error: " + x.getMessage());
|
||||
Log.severe("Error with command: " + cmd + Arrays.deepToString(args), x);
|
||||
}
|
||||
}
|
||||
|
||||
private DynmapLocation toLoc(World worldObj, double x, double y, double z)
|
||||
|
@ -479,7 +479,7 @@ public class DynmapPlugin
|
||||
|
||||
private boolean hasPerm(PlayerEntity psender, String permission) {
|
||||
PermissionsHandler ph = PermissionsHandler.getHandler();
|
||||
if((psender != null) && ph.hasPermission(psender.getEntity().getName().getString(), permission)) {
|
||||
if ((psender != null) && (ph != null) && ph.hasPermission(psender.getEntity().getName().getString(), permission)) {
|
||||
return true;
|
||||
}
|
||||
return permissions.has(psender, permission);
|
||||
@ -487,7 +487,7 @@ public class DynmapPlugin
|
||||
|
||||
private boolean hasPermNode(PlayerEntity psender, String permission) {
|
||||
PermissionsHandler ph = PermissionsHandler.getHandler();
|
||||
if((psender != null) && ph.hasPermissionNode(psender.getEntity().getName().getString(), permission)) {
|
||||
if ((psender != null) && (ph != null) && ph.hasPermissionNode(psender.getEntity().getName().getString(), permission)) {
|
||||
return true;
|
||||
}
|
||||
return permissions.hasPermissionNode(psender, permission);
|
||||
@ -1617,8 +1617,12 @@ public class DynmapPlugin
|
||||
{
|
||||
dsender = new ForgeCommandSender(sender);
|
||||
}
|
||||
|
||||
try {
|
||||
core.processCommand(dsender, cmd, cmd, args);
|
||||
} catch (Exception x) {
|
||||
dsender.sendMessage("Command internal error: " + x.getMessage());
|
||||
Log.severe("Error with command: " + cmd + Arrays.deepToString(args), x);
|
||||
}
|
||||
}
|
||||
|
||||
private DynmapLocation toLoc(World worldObj, double x, double y, double z)
|
||||
|
@ -489,7 +489,7 @@ public class DynmapPlugin
|
||||
|
||||
private boolean hasPerm(PlayerEntity psender, String permission) {
|
||||
PermissionsHandler ph = PermissionsHandler.getHandler();
|
||||
if((psender != null) && ph.hasPermission(psender.getEntity().getName().getString(), permission)) {
|
||||
if ((psender != null) && (ph != null) && ph.hasPermission(psender.getName().getString(), permission)) {
|
||||
return true;
|
||||
}
|
||||
return permissions.has(psender, permission);
|
||||
@ -497,7 +497,7 @@ public class DynmapPlugin
|
||||
|
||||
private boolean hasPermNode(PlayerEntity psender, String permission) {
|
||||
PermissionsHandler ph = PermissionsHandler.getHandler();
|
||||
if((psender != null) && ph.hasPermissionNode(psender.getEntity().getName().getString(), permission)) {
|
||||
if ((psender != null) && (ph != null) && ph.hasPermissionNode(psender.getName().getString(), permission)) {
|
||||
return true;
|
||||
}
|
||||
return permissions.hasPermissionNode(psender, permission);
|
||||
@ -1627,8 +1627,12 @@ public class DynmapPlugin
|
||||
{
|
||||
dsender = new ForgeCommandSender(sender);
|
||||
}
|
||||
|
||||
try {
|
||||
core.processCommand(dsender, cmd, cmd, args);
|
||||
} catch (Exception x) {
|
||||
dsender.sendMessage("Command internal error: " + x.getMessage());
|
||||
Log.severe("Error with command: " + cmd + Arrays.deepToString(args), x);
|
||||
}
|
||||
}
|
||||
|
||||
private DynmapLocation toLoc(World worldObj, double x, double y, double z)
|
||||
|
Loading…
Reference in New Issue
Block a user