mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-11-24 11:15:19 +01:00
Fix #570 add max_acc and reg_acc placeholders
This commit is contained in:
parent
c5c0535fcd
commit
681e352bdc
@ -41,7 +41,7 @@ public enum MessageKey {
|
|||||||
|
|
||||||
REGISTER_EMAIL_MESSAGE("reg_email_msg"),
|
REGISTER_EMAIL_MESSAGE("reg_email_msg"),
|
||||||
|
|
||||||
MAX_REGISTER_EXCEEDED("max_reg", "%acc_nb"),
|
MAX_REGISTER_EXCEEDED("max_reg", "%max_acc", "%reg_acc"),
|
||||||
|
|
||||||
USAGE_REGISTER("usage_reg"),
|
USAGE_REGISTER("usage_reg"),
|
||||||
|
|
||||||
|
@ -73,6 +73,7 @@ public class AsyncRegister {
|
|||||||
|
|
||||||
//check this in both possiblities so don't use 'else if'
|
//check this in both possiblities so don't use 'else if'
|
||||||
Integer size = 0;
|
Integer size = 0;
|
||||||
|
Integer maxReg = Settings.getmaxRegPerIp;
|
||||||
if (database.isAuthAvailable(name)) {
|
if (database.isAuthAvailable(name)) {
|
||||||
m.send(player, MessageKey.NAME_ALREADY_REGISTERED);
|
m.send(player, MessageKey.NAME_ALREADY_REGISTERED);
|
||||||
return false;
|
return false;
|
||||||
@ -80,8 +81,8 @@ public class AsyncRegister {
|
|||||||
&& !plugin.getPermissionsManager().hasPermission(player, PlayerStatePermission.ALLOW_MULTIPLE_ACCOUNTS)
|
&& !plugin.getPermissionsManager().hasPermission(player, PlayerStatePermission.ALLOW_MULTIPLE_ACCOUNTS)
|
||||||
&& !ip.equalsIgnoreCase("127.0.0.1")
|
&& !ip.equalsIgnoreCase("127.0.0.1")
|
||||||
&& !ip.equalsIgnoreCase("localhost")
|
&& !ip.equalsIgnoreCase("localhost")
|
||||||
&& (size = database.getAllAuthsByIp(ip).size()) >= Settings.getmaxRegPerIp) {
|
&& (size = database.getAllAuthsByIp(ip).size()) >= maxReg) {
|
||||||
m.send(player, MessageKey.MAX_REGISTER_EXCEEDED, size.toString());
|
m.send(player, MessageKey.MAX_REGISTER_EXCEEDED, maxReg.toString(), size.toString());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -98,11 +99,12 @@ public class AsyncRegister {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void emailRegister() {
|
private void emailRegister() {
|
||||||
|
Integer maxReg = Settings.getmaxRegPerIp;
|
||||||
Integer size = 0;
|
Integer size = 0;
|
||||||
if (Settings.getmaxRegPerEmail > 0
|
if (Settings.getmaxRegPerEmail > 0
|
||||||
&& !plugin.getPermissionsManager().hasPermission(player, PlayerStatePermission.ALLOW_MULTIPLE_ACCOUNTS)
|
&& !plugin.getPermissionsManager().hasPermission(player, PlayerStatePermission.ALLOW_MULTIPLE_ACCOUNTS)
|
||||||
&& (size = database.countAuthsByEmail(email)) >= Settings.getmaxRegPerEmail) {
|
&& (size = database.getAllAuthsByIp(ip).size()) >= maxReg) {
|
||||||
m.send(player, MessageKey.MAX_REGISTER_EXCEEDED, size.toString());
|
m.send(player, MessageKey.MAX_REGISTER_EXCEEDED, maxReg.toString(), size.toString());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final HashedPassword hashedPassword = plugin.getPasswordSecurity().computeHash(password, name);
|
final HashedPassword hashedPassword = plugin.getPasswordSecurity().computeHash(password, name);
|
||||||
|
@ -12,7 +12,7 @@ login: '&2Successful login!'
|
|||||||
vb_nonActiv: '&cYour account isn''t activated yet, please check your emails!'
|
vb_nonActiv: '&cYour account isn''t activated yet, please check your emails!'
|
||||||
user_regged: '&cYou already have registered this username!'
|
user_regged: '&cYou already have registered this username!'
|
||||||
usage_reg: '&cUsage: /register <password> <ConfirmPassword>'
|
usage_reg: '&cUsage: /register <password> <ConfirmPassword>'
|
||||||
max_reg: '&cYou have exceeded the maximum number of registrations (%acc_nb) for your connection!'
|
max_reg: '&cYou have exceeded the maximum number of registrations (%reg_acc/%max_acc) for your connection!'
|
||||||
no_perm: '&4You don''t have the permission to perform this action!'
|
no_perm: '&4You don''t have the permission to perform this action!'
|
||||||
error: '&4An unexpected error occurred, please contact an administrator!'
|
error: '&4An unexpected error occurred, please contact an administrator!'
|
||||||
login_msg: '&cPlease, login with the command "/login <password>"'
|
login_msg: '&cPlease, login with the command "/login <password>"'
|
||||||
|
Loading…
Reference in New Issue
Block a user