Removed Passpartu feature
This commit is contained in:
parent
41d87a9e06
commit
79759bf139
@ -59,7 +59,7 @@ typing commands or use the inventory. It can also kick players with uncommon lon
|
|||||||
<li>Username spoofing protection.</li>
|
<li>Username spoofing protection.</li>
|
||||||
<li>Countries Whitelist/Blacklist! <a href="http://dev.bukkit.org/bukkit-plugins/authme-reloaded/pages/countries-codes/">(countries codes)</a></li>
|
<li>Countries Whitelist/Blacklist! <a href="http://dev.bukkit.org/bukkit-plugins/authme-reloaded/pages/countries-codes/">(countries codes)</a></li>
|
||||||
<li><strong>Built-in AntiBot System!</strong></li>
|
<li><strong>Built-in AntiBot System!</strong></li>
|
||||||
<li><del>Passpartu Feature: Admin can login with all account more info <a href="http://dev.bukkit.org/server-mods/authme-reloaded/pages/how-to-install-and-initial-configuration/">here</a></del> <strong>(Deprecated)</strong></li>
|
<li><strong>ForceLogin Feature: Admins can login with all account via console command!</strong></li>
|
||||||
<li><strong>Avoid the "Logged in from another location" message!</strong></li>
|
<li><strong>Avoid the "Logged in from another location" message!</strong></li>
|
||||||
<li>Session Login!</li>
|
<li>Session Login!</li>
|
||||||
<li>Editable translations and messages!</li>
|
<li>Editable translations and messages!</li>
|
||||||
|
|||||||
@ -49,7 +49,6 @@ import fr.xephi.authme.commands.ConverterCommand;
|
|||||||
import fr.xephi.authme.commands.EmailCommand;
|
import fr.xephi.authme.commands.EmailCommand;
|
||||||
import fr.xephi.authme.commands.LoginCommand;
|
import fr.xephi.authme.commands.LoginCommand;
|
||||||
import fr.xephi.authme.commands.LogoutCommand;
|
import fr.xephi.authme.commands.LogoutCommand;
|
||||||
import fr.xephi.authme.commands.PasspartuCommand;
|
|
||||||
import fr.xephi.authme.commands.RegisterCommand;
|
import fr.xephi.authme.commands.RegisterCommand;
|
||||||
import fr.xephi.authme.commands.UnregisterCommand;
|
import fr.xephi.authme.commands.UnregisterCommand;
|
||||||
import fr.xephi.authme.converter.Converter;
|
import fr.xephi.authme.converter.Converter;
|
||||||
@ -243,7 +242,6 @@ public class AuthMe extends JavaPlugin {
|
|||||||
this.getCommand("changepassword").setExecutor(new ChangePasswordCommand(this));
|
this.getCommand("changepassword").setExecutor(new ChangePasswordCommand(this));
|
||||||
this.getCommand("logout").setExecutor(new LogoutCommand(this));
|
this.getCommand("logout").setExecutor(new LogoutCommand(this));
|
||||||
this.getCommand("unregister").setExecutor(new UnregisterCommand(this));
|
this.getCommand("unregister").setExecutor(new UnregisterCommand(this));
|
||||||
this.getCommand("passpartu").setExecutor(new PasspartuCommand(this));
|
|
||||||
this.getCommand("email").setExecutor(new EmailCommand(this));
|
this.getCommand("email").setExecutor(new EmailCommand(this));
|
||||||
this.getCommand("captcha").setExecutor(new CaptchaCommand(this));
|
this.getCommand("captcha").setExecutor(new CaptchaCommand(this));
|
||||||
this.getCommand("converter").setExecutor(new ConverterCommand(this));
|
this.getCommand("converter").setExecutor(new ConverterCommand(this));
|
||||||
|
|||||||
@ -1,9 +1,7 @@
|
|||||||
package fr.xephi.authme;
|
package fr.xephi.authme;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
@ -14,7 +12,6 @@ import org.bukkit.entity.Player;
|
|||||||
import fr.xephi.authme.cache.limbo.LimboCache;
|
import fr.xephi.authme.cache.limbo.LimboCache;
|
||||||
import fr.xephi.authme.cache.limbo.LimboPlayer;
|
import fr.xephi.authme.cache.limbo.LimboPlayer;
|
||||||
import fr.xephi.authme.events.AuthMeTeleportEvent;
|
import fr.xephi.authme.events.AuthMeTeleportEvent;
|
||||||
import fr.xephi.authme.security.RandomString;
|
|
||||||
import fr.xephi.authme.settings.Settings;
|
import fr.xephi.authme.settings.Settings;
|
||||||
|
|
||||||
public class Utils {
|
public class Utils {
|
||||||
@ -23,7 +20,6 @@ public class Utils {
|
|||||||
private static Utils singleton;
|
private static Utils singleton;
|
||||||
int id;
|
int id;
|
||||||
public AuthMe plugin;
|
public AuthMe plugin;
|
||||||
private static List<String> tokens = new ArrayList<String>();
|
|
||||||
|
|
||||||
public Utils(AuthMe plugin) {
|
public Utils(AuthMe plugin) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
@ -161,40 +157,6 @@ public class Utils {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Random Token for passpartu
|
|
||||||
*/
|
|
||||||
public boolean obtainToken() {
|
|
||||||
try {
|
|
||||||
final String token = new RandomString(10).nextString();
|
|
||||||
tokens.add(token);
|
|
||||||
ConsoleLogger.info("[AuthMe] Security passpartu token: " + token);
|
|
||||||
Bukkit.getScheduler().runTaskLaterAsynchronously(plugin, new Runnable() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
tokens.remove(token);
|
|
||||||
}
|
|
||||||
|
|
||||||
}, 600);
|
|
||||||
return true;
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Read Token
|
|
||||||
*/
|
|
||||||
public boolean readToken(String inputToken) {
|
|
||||||
boolean ret = false;
|
|
||||||
if (tokens.contains(inputToken))
|
|
||||||
ret = true;
|
|
||||||
tokens.remove(inputToken);
|
|
||||||
return (ret);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Used for force player GameMode
|
* Used for force player GameMode
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -15,7 +15,6 @@ import org.bukkit.OfflinePlayer;
|
|||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandExecutor;
|
import org.bukkit.command.CommandExecutor;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.command.ConsoleCommandSender;
|
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.potion.PotionEffect;
|
import org.bukkit.potion.PotionEffect;
|
||||||
@ -71,7 +70,6 @@ public class AdminCommand implements CommandExecutor {
|
|||||||
sender.sendMessage("/authme firstspawn - Teleport yourself to the first spawn point");
|
sender.sendMessage("/authme firstspawn - Teleport yourself to the first spawn point");
|
||||||
sender.sendMessage("/authme switchantibot on/off - Enable/Disable AntiBot feature");
|
sender.sendMessage("/authme switchantibot on/off - Enable/Disable AntiBot feature");
|
||||||
sender.sendMessage("/authme forcelogin <playername> - Enforce the login of a connected player");
|
sender.sendMessage("/authme forcelogin <playername> - Enforce the login of a connected player");
|
||||||
sender.sendMessage("/authme passpartutoken - Generate a timed token to login with every player's account (CONSOLE ONLY)");
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -80,19 +78,6 @@ public class AdminCommand implements CommandExecutor {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((sender instanceof ConsoleCommandSender) && args[0].equalsIgnoreCase("passpartutoken")) {
|
|
||||||
if (args.length > 1) {
|
|
||||||
ConsoleLogger.info("[AuthMe] command usage: /authme passpartutoken");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (Utils.getInstance().obtainToken()) {
|
|
||||||
ConsoleLogger.info("[AuthMe] You have 30s to insert this token ingame with /passpartu <token>");
|
|
||||||
} else {
|
|
||||||
ConsoleLogger.info("[AuthMe] Security error on passpartu token, please redo the command.");
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (args[0].equalsIgnoreCase("version")) {
|
if (args[0].equalsIgnoreCase("version")) {
|
||||||
sender.sendMessage("AuthMe Version: " + AuthMe.getInstance().getDescription().getVersion());
|
sender.sendMessage("AuthMe Version: " + AuthMe.getInstance().getDescription().getVersion());
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@ -1,52 +0,0 @@
|
|||||||
package fr.xephi.authme.commands;
|
|
||||||
|
|
||||||
import org.bukkit.command.Command;
|
|
||||||
import org.bukkit.command.CommandExecutor;
|
|
||||||
import org.bukkit.command.CommandSender;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
|
|
||||||
import fr.xephi.authme.AuthMe;
|
|
||||||
import fr.xephi.authme.Utils;
|
|
||||||
import fr.xephi.authme.cache.auth.PlayerCache;
|
|
||||||
import fr.xephi.authme.settings.Messages;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author stefano
|
|
||||||
*/
|
|
||||||
public class PasspartuCommand implements CommandExecutor {
|
|
||||||
|
|
||||||
private Utils utils = Utils.getInstance();
|
|
||||||
public AuthMe plugin;
|
|
||||||
private Messages m = Messages.getInstance();
|
|
||||||
|
|
||||||
public PasspartuCommand(AuthMe plugin) {
|
|
||||||
this.plugin = plugin;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onCommand(CommandSender sender, Command cmnd, String label,
|
|
||||||
String[] args) {
|
|
||||||
|
|
||||||
if (!plugin.authmePermissible(sender, "authme." + label.toLowerCase())) {
|
|
||||||
m.send(sender, "no_perm");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (PlayerCache.getInstance().isAuthenticated(sender.getName().toLowerCase())) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((sender instanceof Player) && args.length == 1) {
|
|
||||||
if (utils.readToken(args[0])) {
|
|
||||||
// bypass login!
|
|
||||||
plugin.management.performLogin((Player) sender, "dontneed", true);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
sender.sendMessage("Time is expired or Token is Wrong!");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
sender.sendMessage("usage: /passpartu token");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -84,7 +84,7 @@ public class AuthMePlayerListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
String cmd = msg.split(" ")[0];
|
String cmd = msg.split(" ")[0];
|
||||||
if (cmd.equalsIgnoreCase("/login") || cmd.equalsIgnoreCase("/register") || cmd.equalsIgnoreCase("/passpartu") || cmd.equalsIgnoreCase("/l") || cmd.equalsIgnoreCase("/reg") || cmd.equalsIgnoreCase("/email") || cmd.equalsIgnoreCase("/captcha"))
|
if (cmd.equalsIgnoreCase("/login") || cmd.equalsIgnoreCase("/register") || cmd.equalsIgnoreCase("/l") || cmd.equalsIgnoreCase("/reg") || cmd.equalsIgnoreCase("/email") || cmd.equalsIgnoreCase("/captcha"))
|
||||||
return;
|
return;
|
||||||
if (Settings.useEssentialsMotd && cmd.equalsIgnoreCase("/motd"))
|
if (Settings.useEssentialsMotd && cmd.equalsIgnoreCase("/motd"))
|
||||||
return;
|
return;
|
||||||
@ -411,7 +411,7 @@ public class AuthMePlayerListener implements Listener {
|
|||||||
if (event.getResult() != PlayerLoginEvent.Result.ALLOWED)
|
if (event.getResult() != PlayerLoginEvent.Result.ALLOWED)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (Settings.enablePasspartu && !Settings.countriesBlacklist.isEmpty()) {
|
if (!Settings.countriesBlacklist.isEmpty()) {
|
||||||
String code = plugin.getCountryCode(event.getAddress().getHostAddress());
|
String code = plugin.getCountryCode(event.getAddress().getHostAddress());
|
||||||
if (((code == null) || (Settings.countriesBlacklist.contains(code) && !isAuthAvailable)) && !plugin.authmePermissible(player, "authme.bypassantibot")) {
|
if (((code == null) || (Settings.countriesBlacklist.contains(code) && !isAuthAvailable)) && !plugin.authmePermissible(player, "authme.bypassantibot")) {
|
||||||
event.setKickMessage(m.send("country_banned")[0]);
|
event.setKickMessage(m.send("country_banned")[0]);
|
||||||
|
|||||||
@ -62,7 +62,7 @@ public final class Settings extends YamlConfiguration {
|
|||||||
isResetInventoryIfCreative, isCachingEnabled,
|
isResetInventoryIfCreative, isCachingEnabled,
|
||||||
isKickOnWrongPasswordEnabled, getEnablePasswordVerifier,
|
isKickOnWrongPasswordEnabled, getEnablePasswordVerifier,
|
||||||
protectInventoryBeforeLogInEnabled, isBackupActivated,
|
protectInventoryBeforeLogInEnabled, isBackupActivated,
|
||||||
isBackupOnStart, isBackupOnStop, enablePasspartu, isStopEnabled,
|
isBackupOnStart, isBackupOnStop, isStopEnabled,
|
||||||
reloadSupport, rakamakUseIp, noConsoleSpam, removePassword,
|
reloadSupport, rakamakUseIp, noConsoleSpam, removePassword,
|
||||||
displayOtherAccounts, useCaptcha, emailRegistration, multiverse,
|
displayOtherAccounts, useCaptcha, emailRegistration, multiverse,
|
||||||
chestshop, bungee, banUnsafeIp, doubleEmailCheck,
|
chestshop, bungee, banUnsafeIp, doubleEmailCheck,
|
||||||
@ -187,7 +187,6 @@ public final class Settings extends YamlConfiguration {
|
|||||||
isBackupOnStart = configFile.getBoolean("BackupSystem.OnServerStart", false);
|
isBackupOnStart = configFile.getBoolean("BackupSystem.OnServerStart", false);
|
||||||
isBackupOnStop = configFile.getBoolean("BackupSystem.OnServeStop", false);
|
isBackupOnStop = configFile.getBoolean("BackupSystem.OnServeStop", false);
|
||||||
backupWindowsPath = configFile.getString("BackupSystem.MysqlWindowsPath", "C:\\Program Files\\MySQL\\MySQL Server 5.1\\");
|
backupWindowsPath = configFile.getString("BackupSystem.MysqlWindowsPath", "C:\\Program Files\\MySQL\\MySQL Server 5.1\\");
|
||||||
enablePasspartu = configFile.getBoolean("Passpartu.enablePasspartu", false);
|
|
||||||
isStopEnabled = configFile.getBoolean("Security.SQLProblem.stopServer", true);
|
isStopEnabled = configFile.getBoolean("Security.SQLProblem.stopServer", true);
|
||||||
reloadSupport = configFile.getBoolean("Security.ReloadCommand.useReloadCommandSupport", true);
|
reloadSupport = configFile.getBoolean("Security.ReloadCommand.useReloadCommandSupport", true);
|
||||||
allowCommands = (List<String>) configFile.getList("settings.restrictions.allowCommands");
|
allowCommands = (List<String>) configFile.getList("settings.restrictions.allowCommands");
|
||||||
@ -200,8 +199,6 @@ public final class Settings extends YamlConfiguration {
|
|||||||
allowCommands.add("/l");
|
allowCommands.add("/l");
|
||||||
if (!allowCommands.contains("/reg"))
|
if (!allowCommands.contains("/reg"))
|
||||||
allowCommands.add("/reg");
|
allowCommands.add("/reg");
|
||||||
if (!allowCommands.contains("/passpartu"))
|
|
||||||
allowCommands.add("/passpartu");
|
|
||||||
if (!allowCommands.contains("/email"))
|
if (!allowCommands.contains("/email"))
|
||||||
allowCommands.add("/email");
|
allowCommands.add("/email");
|
||||||
if (!allowCommands.contains("/captcha"))
|
if (!allowCommands.contains("/captcha"))
|
||||||
@ -420,8 +417,16 @@ public final class Settings extends YamlConfiguration {
|
|||||||
}
|
}
|
||||||
if (contains("Performances.useMultiThreading"))
|
if (contains("Performances.useMultiThreading"))
|
||||||
set("Performances.useMultiThreading", null);
|
set("Performances.useMultiThreading", null);
|
||||||
|
|
||||||
if (contains("Performances"))
|
if (contains("Performances"))
|
||||||
set("Performances", null);
|
set("Performances", null);
|
||||||
|
|
||||||
|
if (contains("Passpartu.enablePasspartu"))
|
||||||
|
set("Passpartu.enablePasspartu", null);
|
||||||
|
|
||||||
|
if (contains("Passpartu"))
|
||||||
|
set("Passpartu", null);
|
||||||
|
|
||||||
if (!contains("Email.emailWhitelisted")) {
|
if (!contains("Email.emailWhitelisted")) {
|
||||||
set("Email.emailWhitelisted", new ArrayList<String>());
|
set("Email.emailWhitelisted", new ArrayList<String>());
|
||||||
changes = true;
|
changes = true;
|
||||||
|
|||||||
@ -84,7 +84,6 @@ settings:
|
|||||||
- /register
|
- /register
|
||||||
- /l
|
- /l
|
||||||
- /reg
|
- /reg
|
||||||
- /passpartu
|
|
||||||
- /email
|
- /email
|
||||||
- /captcha
|
- /captcha
|
||||||
# Maximum Registration per IP default: 1
|
# Maximum Registration per IP default: 1
|
||||||
@ -305,13 +304,6 @@ BackupSystem:
|
|||||||
OnServerStop: true
|
OnServerStop: true
|
||||||
# Windows only mysql installation Path
|
# Windows only mysql installation Path
|
||||||
MysqlWindowsPath: 'C:\\Program Files\\MySQL\\MySQL Server 5.1\\'
|
MysqlWindowsPath: 'C:\\Program Files\\MySQL\\MySQL Server 5.1\\'
|
||||||
Passpartu:
|
|
||||||
# Enable or Disable Passpartu Feature,
|
|
||||||
# this feature let Admin Login with all registered
|
|
||||||
# Account they need, for example inspecting Player that
|
|
||||||
# is doing shit, they can login without know any
|
|
||||||
# Player password! More info on How TO
|
|
||||||
enablePasspartu: false
|
|
||||||
Security:
|
Security:
|
||||||
SQLProblem:
|
SQLProblem:
|
||||||
# Stop the server if we can't contact the sql database
|
# Stop the server if we can't contact the sql database
|
||||||
|
|||||||
@ -22,10 +22,7 @@ commands:
|
|||||||
usage: /logout
|
usage: /logout
|
||||||
unregister:
|
unregister:
|
||||||
description: unregister your account
|
description: unregister your account
|
||||||
usage: /unregister password
|
usage: /unregister password
|
||||||
passpartu:
|
|
||||||
description: compare passpartu token
|
|
||||||
usage: /passpartu token
|
|
||||||
authme:
|
authme:
|
||||||
description: AuthMe op commands
|
description: AuthMe op commands
|
||||||
usage: '/authme reload|register playername password|changepassword playername password|unregister playername|version'
|
usage: '/authme reload|register playername password|changepassword playername password|unregister playername|version'
|
||||||
@ -48,7 +45,6 @@ permissions:
|
|||||||
authme.changepassword: true
|
authme.changepassword: true
|
||||||
authme.logout: true
|
authme.logout: true
|
||||||
authme.unregister: true
|
authme.unregister: true
|
||||||
authme.passpartu: true
|
|
||||||
authme.l: true
|
authme.l: true
|
||||||
authme.reg: true
|
authme.reg: true
|
||||||
authme.email: true
|
authme.email: true
|
||||||
@ -87,9 +83,6 @@ permissions:
|
|||||||
authme.email:
|
authme.email:
|
||||||
description: Email
|
description: Email
|
||||||
default: true
|
default: true
|
||||||
authme.passpartu:
|
|
||||||
description: passpartu
|
|
||||||
default: true
|
|
||||||
authme.allow2accounts:
|
authme.allow2accounts:
|
||||||
description: allow more accounts for same ip
|
description: allow more accounts for same ip
|
||||||
default: false
|
default: false
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user