mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-11-28 05:05:14 +01:00
commit
d91f48bf08
@ -1,6 +1,7 @@
|
|||||||
package fr.xephi.authme.commands;
|
package fr.xephi.authme.commands;
|
||||||
|
|
||||||
import java.security.NoSuchAlgorithmException;
|
import java.security.NoSuchAlgorithmException;
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandExecutor;
|
import org.bukkit.command.CommandExecutor;
|
||||||
@ -121,7 +122,7 @@ public class EmailCommand implements CommandExecutor {
|
|||||||
}
|
}
|
||||||
PlayerCache.getInstance().updatePlayer(auth);
|
PlayerCache.getInstance().updatePlayer(auth);
|
||||||
m.send(player, "email_changed");
|
m.send(player, "email_changed");
|
||||||
player.sendMessage(m.send("email_defined").toString() + auth.getEmail());
|
player.sendMessage(Arrays.toString(m.send("email_defined")) + auth.getEmail());
|
||||||
} else if (PlayerCache.getInstance().isAuthenticated(name)) {
|
} else if (PlayerCache.getInstance().isAuthenticated(name)) {
|
||||||
m.send(player, "email_confirm");
|
m.send(player, "email_confirm");
|
||||||
} else {
|
} else {
|
||||||
|
@ -36,7 +36,7 @@ public enum HashAlgorithm {
|
|||||||
this.classe = classe;
|
this.classe = classe;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Class<?> getclass() {
|
public Class<?> getclasse() {
|
||||||
return classe;
|
return classe;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ public class PasswordSecurity {
|
|||||||
EncryptionMethod method;
|
EncryptionMethod method;
|
||||||
try {
|
try {
|
||||||
if (alg != HashAlgorithm.CUSTOM)
|
if (alg != HashAlgorithm.CUSTOM)
|
||||||
method = (EncryptionMethod) alg.getclass().newInstance();
|
method = (EncryptionMethod) alg.getclasse().newInstance();
|
||||||
else method = null;
|
else method = null;
|
||||||
} catch (InstantiationException e) {
|
} catch (InstantiationException e) {
|
||||||
throw new NoSuchAlgorithmException("Problem with this hash algorithm");
|
throw new NoSuchAlgorithmException("Problem with this hash algorithm");
|
||||||
@ -123,7 +123,7 @@ public class PasswordSecurity {
|
|||||||
EncryptionMethod method;
|
EncryptionMethod method;
|
||||||
try {
|
try {
|
||||||
if (algo != HashAlgorithm.CUSTOM)
|
if (algo != HashAlgorithm.CUSTOM)
|
||||||
method = (EncryptionMethod) algo.getclass().newInstance();
|
method = (EncryptionMethod) algo.getclasse().newInstance();
|
||||||
else method = null;
|
else method = null;
|
||||||
} catch (InstantiationException e) {
|
} catch (InstantiationException e) {
|
||||||
throw new NoSuchAlgorithmException("Problem with this hash algorithm");
|
throw new NoSuchAlgorithmException("Problem with this hash algorithm");
|
||||||
@ -156,7 +156,7 @@ public class PasswordSecurity {
|
|||||||
for (HashAlgorithm algo : HashAlgorithm.values()) {
|
for (HashAlgorithm algo : HashAlgorithm.values()) {
|
||||||
if (algo != HashAlgorithm.CUSTOM)
|
if (algo != HashAlgorithm.CUSTOM)
|
||||||
try {
|
try {
|
||||||
EncryptionMethod method = (EncryptionMethod) algo.getclass().newInstance();
|
EncryptionMethod method = (EncryptionMethod) algo.getclasse().newInstance();
|
||||||
if (method.comparePassword(hash, password, playerName)) {
|
if (method.comparePassword(hash, password, playerName)) {
|
||||||
PlayerAuth nAuth = AuthMe.getInstance().database.getAuth(playerName);
|
PlayerAuth nAuth = AuthMe.getInstance().database.getAuth(playerName);
|
||||||
if (nAuth != null) {
|
if (nAuth != null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user