mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-11-03 01:00:18 +01:00
Fix max email count #591
This commit is contained in:
parent
ab2c95869e
commit
af84ba6fce
@ -103,17 +103,16 @@ public class AsyncRegister implements Process {
|
|||||||
|
|
||||||
private void emailRegister() {
|
private void emailRegister() {
|
||||||
if (Settings.getmaxRegPerEmail > 0
|
if (Settings.getmaxRegPerEmail > 0
|
||||||
&& !ip.equalsIgnoreCase("127.0.0.1")
|
|
||||||
&& !ip.equalsIgnoreCase("localhost")
|
|
||||||
&& !plugin.getPermissionsManager().hasPermission(player, PlayerStatePermission.ALLOW_MULTIPLE_ACCOUNTS)) {
|
&& !plugin.getPermissionsManager().hasPermission(player, PlayerStatePermission.ALLOW_MULTIPLE_ACCOUNTS)) {
|
||||||
int maxReg = Settings.getmaxRegPerIp;
|
int maxReg = Settings.getmaxRegPerEmail;
|
||||||
List<String> otherAccounts = database.getAllAuthsByIp(ip);
|
int otherAccounts = database.countAuthsByEmail(email);
|
||||||
if (otherAccounts.size() >= maxReg) {
|
if (otherAccounts >= maxReg) {
|
||||||
service.send(player, MessageKey.MAX_REGISTER_EXCEEDED, Integer.toString(maxReg),
|
service.send(player, MessageKey.MAX_REGISTER_EXCEEDED, Integer.toString(maxReg),
|
||||||
Integer.toString(otherAccounts.size()), StringUtils.join(", ", otherAccounts.toString()));
|
Integer.toString(otherAccounts), "@");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final HashedPassword hashedPassword = service.computeHash(password, name);
|
final HashedPassword hashedPassword = service.computeHash(password, name);
|
||||||
PlayerAuth auth = PlayerAuth.builder()
|
PlayerAuth auth = PlayerAuth.builder()
|
||||||
.name(name)
|
.name(name)
|
||||||
|
Loading…
Reference in New Issue
Block a user