Force a player just registered by an admin to log again

This commit is contained in:
vanhec_a 2015-10-12 15:10:14 +02:00
parent 5b98759b61
commit 8e90a5f9a8

View File

@ -233,6 +233,7 @@ public class AdminCommand implements CommandExecutor {
return true; return true;
} }
final String name = args[1].toLowerCase(); final String name = args[1].toLowerCase();
final String realName = args[1];
final String lowpass = args[2].toLowerCase(); final String lowpass = args[2].toLowerCase();
if (lowpass.contains("delete") || lowpass.contains("where") || lowpass.contains("insert") || lowpass.contains("modify") || lowpass.contains("from") || lowpass.contains("select") || lowpass.contains(";") || lowpass.contains("null") || !lowpass.matches(Settings.getPassRegex)) { if (lowpass.contains("delete") || lowpass.contains("where") || lowpass.contains("insert") || lowpass.contains("modify") || lowpass.contains("from") || lowpass.contains("select") || lowpass.contains(";") || lowpass.contains("null") || !lowpass.matches(Settings.getPassRegex)) {
m.send(sender, "password_error"); m.send(sender, "password_error");
@ -269,6 +270,9 @@ public class AdminCommand implements CommandExecutor {
m.send(sender, "error"); m.send(sender, "error");
return; return;
} }
plugin.database.setUnlogged(name);
if (Bukkit.getPlayerExact(realName) != null)
Bukkit.getPlayerExact(realName).kickPlayer("An admin just registered you, please log again");
m.send(sender, "registered"); m.send(sender, "registered");
ConsoleLogger.info(name + " registered"); ConsoleLogger.info(name + " registered");
} catch (NoSuchAlgorithmException ex) { } catch (NoSuchAlgorithmException ex) {