Removed Passpartu feature

This commit is contained in:
Gabriele C 2015-07-29 14:12:01 +02:00
parent 41d87a9e06
commit 79759bf139
9 changed files with 13 additions and 130 deletions

View File

@ -59,7 +59,7 @@ typing commands or use the inventory. It can also kick players with uncommon lon
<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><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>Session Login!</li>
<li>Editable translations and messages!</li>

View File

@ -49,7 +49,6 @@ import fr.xephi.authme.commands.ConverterCommand;
import fr.xephi.authme.commands.EmailCommand;
import fr.xephi.authme.commands.LoginCommand;
import fr.xephi.authme.commands.LogoutCommand;
import fr.xephi.authme.commands.PasspartuCommand;
import fr.xephi.authme.commands.RegisterCommand;
import fr.xephi.authme.commands.UnregisterCommand;
import fr.xephi.authme.converter.Converter;
@ -243,7 +242,6 @@ public class AuthMe extends JavaPlugin {
this.getCommand("changepassword").setExecutor(new ChangePasswordCommand(this));
this.getCommand("logout").setExecutor(new LogoutCommand(this));
this.getCommand("unregister").setExecutor(new UnregisterCommand(this));
this.getCommand("passpartu").setExecutor(new PasspartuCommand(this));
this.getCommand("email").setExecutor(new EmailCommand(this));
this.getCommand("captcha").setExecutor(new CaptchaCommand(this));
this.getCommand("converter").setExecutor(new ConverterCommand(this));

View File

@ -1,9 +1,7 @@
package fr.xephi.authme;
import java.io.File;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.bukkit.Bukkit;
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.LimboPlayer;
import fr.xephi.authme.events.AuthMeTeleportEvent;
import fr.xephi.authme.security.RandomString;
import fr.xephi.authme.settings.Settings;
public class Utils {
@ -23,7 +20,6 @@ public class Utils {
private static Utils singleton;
int id;
public AuthMe plugin;
private static List<String> tokens = new ArrayList<String>();
public Utils(AuthMe 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
*/

View File

@ -15,7 +15,6 @@ import org.bukkit.OfflinePlayer;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.command.ConsoleCommandSender;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;
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 switchantibot on/off - Enable/Disable AntiBot feature");
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;
}
@ -80,19 +78,6 @@ public class AdminCommand implements CommandExecutor {
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")) {
sender.sendMessage("AuthMe Version: " + AuthMe.getInstance().getDescription().getVersion());
return true;

View File

@ -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;
}
}

View File

@ -84,7 +84,7 @@ public class AuthMePlayerListener implements Listener {
return;
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;
if (Settings.useEssentialsMotd && cmd.equalsIgnoreCase("/motd"))
return;
@ -411,7 +411,7 @@ public class AuthMePlayerListener implements Listener {
if (event.getResult() != PlayerLoginEvent.Result.ALLOWED)
return;
if (Settings.enablePasspartu && !Settings.countriesBlacklist.isEmpty()) {
if (!Settings.countriesBlacklist.isEmpty()) {
String code = plugin.getCountryCode(event.getAddress().getHostAddress());
if (((code == null) || (Settings.countriesBlacklist.contains(code) && !isAuthAvailable)) && !plugin.authmePermissible(player, "authme.bypassantibot")) {
event.setKickMessage(m.send("country_banned")[0]);

View File

@ -62,7 +62,7 @@ public final class Settings extends YamlConfiguration {
isResetInventoryIfCreative, isCachingEnabled,
isKickOnWrongPasswordEnabled, getEnablePasswordVerifier,
protectInventoryBeforeLogInEnabled, isBackupActivated,
isBackupOnStart, isBackupOnStop, enablePasspartu, isStopEnabled,
isBackupOnStart, isBackupOnStop, isStopEnabled,
reloadSupport, rakamakUseIp, noConsoleSpam, removePassword,
displayOtherAccounts, useCaptcha, emailRegistration, multiverse,
chestshop, bungee, banUnsafeIp, doubleEmailCheck,
@ -187,7 +187,6 @@ public final class Settings extends YamlConfiguration {
isBackupOnStart = configFile.getBoolean("BackupSystem.OnServerStart", false);
isBackupOnStop = configFile.getBoolean("BackupSystem.OnServeStop", false);
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);
reloadSupport = configFile.getBoolean("Security.ReloadCommand.useReloadCommandSupport", true);
allowCommands = (List<String>) configFile.getList("settings.restrictions.allowCommands");
@ -200,8 +199,6 @@ public final class Settings extends YamlConfiguration {
allowCommands.add("/l");
if (!allowCommands.contains("/reg"))
allowCommands.add("/reg");
if (!allowCommands.contains("/passpartu"))
allowCommands.add("/passpartu");
if (!allowCommands.contains("/email"))
allowCommands.add("/email");
if (!allowCommands.contains("/captcha"))
@ -420,8 +417,16 @@ public final class Settings extends YamlConfiguration {
}
if (contains("Performances.useMultiThreading"))
set("Performances.useMultiThreading", null);
if (contains("Performances"))
set("Performances", null);
if (contains("Passpartu.enablePasspartu"))
set("Passpartu.enablePasspartu", null);
if (contains("Passpartu"))
set("Passpartu", null);
if (!contains("Email.emailWhitelisted")) {
set("Email.emailWhitelisted", new ArrayList<String>());
changes = true;

View File

@ -84,7 +84,6 @@ settings:
- /register
- /l
- /reg
- /passpartu
- /email
- /captcha
# Maximum Registration per IP default: 1
@ -305,13 +304,6 @@ BackupSystem:
OnServerStop: true
# Windows only mysql installation Path
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:
SQLProblem:
# Stop the server if we can't contact the sql database

View File

@ -22,10 +22,7 @@ commands:
usage: /logout
unregister:
description: unregister your account
usage: /unregister password
passpartu:
description: compare passpartu token
usage: /passpartu token
usage: /unregister password
authme:
description: AuthMe op commands
usage: '/authme reload|register playername password|changepassword playername password|unregister playername|version'
@ -48,7 +45,6 @@ permissions:
authme.changepassword: true
authme.logout: true
authme.unregister: true
authme.passpartu: true
authme.l: true
authme.reg: true
authme.email: true
@ -87,9 +83,6 @@ permissions:
authme.email:
description: Email
default: true
authme.passpartu:
description: passpartu
default: true
authme.allow2accounts:
description: allow more accounts for same ip
default: false