'
+# TODO incorrect_verification_code: '&cIncorrect code, please type "/verification " into the chat, using the code you received by email'
+# TODO verification_code_verified: '&2Your identity has been verified! You can now execute all commands within the current session!'
+# TODO verification_code_already_verified: '&2You can already execute every sensitive command within the current session!'
+# TODO verification_code_expired: '&3Your code has expired! Execute an other sensitive command to get a new code!'
+# TODO verification_code_email_needed: '&3To verify your identity you need to link an email address with your account!!'
+
# Time units
second: 'секунда'
seconds: 'секунди'
diff --git a/src/main/resources/messages/messages_br.yml b/src/main/resources/messages/messages_br.yml
index c617d8b95..9c4557bf6 100644
--- a/src/main/resources/messages/messages_br.yml
+++ b/src/main/resources/messages/messages_br.yml
@@ -100,6 +100,15 @@ usage_captcha: '&3Para iniciar sessão você tem que resolver um código captcha
wrong_captcha: '&cCaptcha errado, por favor, escreva "/captcha THE_CAPTCHA" no chat!'
valid_captcha: '&2Código Captcha resolvido corretamente!'
+# Verification code
+# TODO verification_code_required: '&3This command is sensitive and requires an email verification! Check your inbox and follow the email''s instructions.'
+# TODO usage_verification_code: '&cUsage: /verification '
+# TODO incorrect_verification_code: '&cIncorrect code, please type "/verification " into the chat, using the code you received by email'
+# TODO verification_code_verified: '&2Your identity has been verified! You can now execute all commands within the current session!'
+# TODO verification_code_already_verified: '&2You can already execute every sensitive command within the current session!'
+# TODO verification_code_expired: '&3Your code has expired! Execute an other sensitive command to get a new code!'
+# TODO verification_code_email_needed: '&3To verify your identity you need to link an email address with your account!!'
+
# Time units
second: 'segundo'
seconds: 'segundos'
diff --git a/src/main/resources/messages/messages_cz.yml b/src/main/resources/messages/messages_cz.yml
index 5b60ffdaf..4e9ed8dd3 100644
--- a/src/main/resources/messages/messages_cz.yml
+++ b/src/main/resources/messages/messages_cz.yml
@@ -95,6 +95,15 @@ usage_captcha: '&cPoužij: /captcha '
wrong_captcha: '&cŠpatné opsana Captcha, pouzij prosim: /captcha THE_CAPTCHA'
valid_captcha: '&cZadaná captcha je v pořádku!'
+# Verification code
+# TODO verification_code_required: '&3This command is sensitive and requires an email verification! Check your inbox and follow the email''s instructions.'
+# TODO usage_verification_code: '&cUsage: /verification '
+# TODO incorrect_verification_code: '&cIncorrect code, please type "/verification " into the chat, using the code you received by email'
+# TODO verification_code_verified: '&2Your identity has been verified! You can now execute all commands within the current session!'
+# TODO verification_code_already_verified: '&2You can already execute every sensitive command within the current session!'
+# TODO verification_code_expired: '&3Your code has expired! Execute an other sensitive command to get a new code!'
+# TODO verification_code_email_needed: '&3To verify your identity you need to link an email address with your account!!'
+
# Time units
second: 'sekundy'
seconds: 'sekund'
diff --git a/src/main/resources/messages/messages_de.yml b/src/main/resources/messages/messages_de.yml
index 874b1d3c8..fc48a9f6b 100644
--- a/src/main/resources/messages/messages_de.yml
+++ b/src/main/resources/messages/messages_de.yml
@@ -95,6 +95,15 @@ usage_captcha: '&3Um dich einzuloggen, tippe dieses Captcha so ein: /captcha '
+# TODO incorrect_verification_code: '&cIncorrect code, please type "/verification " into the chat, using the code you received by email'
+# TODO verification_code_verified: '&2Your identity has been verified! You can now execute all commands within the current session!'
+# TODO verification_code_already_verified: '&2You can already execute every sensitive command within the current session!'
+# TODO verification_code_expired: '&3Your code has expired! Execute an other sensitive command to get a new code!'
+# TODO verification_code_email_needed: '&3To verify your identity you need to link an email address with your account!!'
+
# Time units
second: 'Sekunde'
seconds: 'Sekunden'
diff --git a/src/main/resources/messages/messages_en.yml b/src/main/resources/messages/messages_en.yml
index fc815663f..8879f0ca6 100644
--- a/src/main/resources/messages/messages_en.yml
+++ b/src/main/resources/messages/messages_en.yml
@@ -95,6 +95,15 @@ usage_captcha: '&3To login you have to solve a captcha code, please use the comm
wrong_captcha: '&cWrong captcha, please type "/captcha THE_CAPTCHA" into the chat!'
valid_captcha: '&2Captcha code solved correctly!'
+# Verification code
+verification_code_required: '&3This command is sensitive and requires an email verification! Check your inbox and follow the email''s instructions.'
+usage_verification_code: '&cUsage: /verification '
+incorrect_verification_code: '&cIncorrect code, please type "/verification " into the chat, using the code you received by email'
+verification_code_verified: '&2Your identity has been verified! You can now execute all commands within the current session!'
+verification_code_already_verified: '&2You can already execute every sensitive command within the current session!'
+verification_code_expired: '&3Your code has expired! Execute an other sensitive command to get a new code!'
+verification_code_email_needed: '&3To verify your identity you need to link an email address with your account!!'
+
# Time units
second: 'second'
seconds: 'seconds'
diff --git a/src/main/resources/messages/messages_eo.yml b/src/main/resources/messages/messages_eo.yml
index 162bc3638..938c0362b 100644
--- a/src/main/resources/messages/messages_eo.yml
+++ b/src/main/resources/messages/messages_eo.yml
@@ -95,6 +95,15 @@ usage_captcha: '&3Ensaluti vi devas solvi captcha kodo, bonvolu uzi la komando:
wrong_captcha: '&cMalĝusta captcha, bonvolu tajpi "/captcha THE_CAPTCHA" en la babilejo!'
valid_captcha: '&2Captcha kodo solvita ĝuste!'
+# Verification code
+# TODO verification_code_required: '&3This command is sensitive and requires an email verification! Check your inbox and follow the email''s instructions.'
+# TODO usage_verification_code: '&cUsage: /verification '
+# TODO incorrect_verification_code: '&cIncorrect code, please type "/verification " into the chat, using the code you received by email'
+# TODO verification_code_verified: '&2Your identity has been verified! You can now execute all commands within the current session!'
+# TODO verification_code_already_verified: '&2You can already execute every sensitive command within the current session!'
+# TODO verification_code_expired: '&3Your code has expired! Execute an other sensitive command to get a new code!'
+# TODO verification_code_email_needed: '&3To verify your identity you need to link an email address with your account!!'
+
# Time units
second: 'sekundo'
seconds: 'sekundoj'
diff --git a/src/main/resources/messages/messages_es.yml b/src/main/resources/messages/messages_es.yml
index c5f2fe071..cdef5a651 100644
--- a/src/main/resources/messages/messages_es.yml
+++ b/src/main/resources/messages/messages_es.yml
@@ -99,6 +99,15 @@ usage_captcha: '&cUso: /captcha '
wrong_captcha: '&cCaptcha incorrecto, por favor usa: /captcha THE_CAPTCHA'
valid_captcha: '&c¡ Captcha ingresado correctamente !'
+# Verification code
+# TODO verification_code_required: '&3This command is sensitive and requires an email verification! Check your inbox and follow the email''s instructions.'
+# TODO usage_verification_code: '&cUsage: /verification '
+# TODO incorrect_verification_code: '&cIncorrect code, please type "/verification " into the chat, using the code you received by email'
+# TODO verification_code_verified: '&2Your identity has been verified! You can now execute all commands within the current session!'
+# TODO verification_code_already_verified: '&2You can already execute every sensitive command within the current session!'
+# TODO verification_code_expired: '&3Your code has expired! Execute an other sensitive command to get a new code!'
+# TODO verification_code_email_needed: '&3To verify your identity you need to link an email address with your account!!'
+
# Time units
second: 'segundo'
seconds: 'segundos'
diff --git a/src/main/resources/messages/messages_et.yml b/src/main/resources/messages/messages_et.yml
index 044522cc2..56ea26277 100644
--- a/src/main/resources/messages/messages_et.yml
+++ b/src/main/resources/messages/messages_et.yml
@@ -95,6 +95,15 @@ usage_captcha: '&3Sisselogimiseks pead lahendama captcha. Tee seda kasutades kä
wrong_captcha: '&cVale captcha, kirjuta "/captcha THE_CAPTCHA" chatti!'
valid_captcha: '&2Captcha lahendatud!'
+# Verification code
+# TODO verification_code_required: '&3This command is sensitive and requires an email verification! Check your inbox and follow the email''s instructions.'
+# TODO usage_verification_code: '&cUsage: /verification '
+# TODO incorrect_verification_code: '&cIncorrect code, please type "/verification " into the chat, using the code you received by email'
+# TODO verification_code_verified: '&2Your identity has been verified! You can now execute all commands within the current session!'
+# TODO verification_code_already_verified: '&2You can already execute every sensitive command within the current session!'
+# TODO verification_code_expired: '&3Your code has expired! Execute an other sensitive command to get a new code!'
+# TODO verification_code_email_needed: '&3To verify your identity you need to link an email address with your account!!'
+
# Time units
second: 'sekund'
seconds: 'sekundit'
diff --git a/src/main/resources/messages/messages_eu.yml b/src/main/resources/messages/messages_eu.yml
index 28ba966ab..a55565645 100644
--- a/src/main/resources/messages/messages_eu.yml
+++ b/src/main/resources/messages/messages_eu.yml
@@ -96,6 +96,15 @@ recovery_email: '&cPasahitza ahaztu duzu? Erabili /email recovery '
# TODO wrong_captcha: '&cWrong captcha, please type "/captcha THE_CAPTCHA" into the chat!'
# TODO valid_captcha: '&2Captcha code solved correctly!'
+# Verification code
+# TODO verification_code_required: '&3This command is sensitive and requires an email verification! Check your inbox and follow the email''s instructions.'
+# TODO usage_verification_code: '&cUsage: /verification '
+# TODO incorrect_verification_code: '&cIncorrect code, please type "/verification " into the chat, using the code you received by email'
+# TODO verification_code_verified: '&2Your identity has been verified! You can now execute all commands within the current session!'
+# TODO verification_code_already_verified: '&2You can already execute every sensitive command within the current session!'
+# TODO verification_code_expired: '&3Your code has expired! Execute an other sensitive command to get a new code!'
+# TODO verification_code_email_needed: '&3To verify your identity you need to link an email address with your account!!'
+
# Time units
# TODO second: 'second'
# TODO seconds: 'seconds'
diff --git a/src/main/resources/messages/messages_fi.yml b/src/main/resources/messages/messages_fi.yml
index 0f491ce62..31ef37aa5 100644
--- a/src/main/resources/messages/messages_fi.yml
+++ b/src/main/resources/messages/messages_fi.yml
@@ -96,6 +96,15 @@ usage_captcha: '&cKäyttötapa: /captcha '
wrong_captcha: '&cVäärä varmistus, käytä : /captcha THE_CAPTCHA'
valid_captcha: '&cSinun varmistus onnistui.!'
+# Verification code
+# TODO verification_code_required: '&3This command is sensitive and requires an email verification! Check your inbox and follow the email''s instructions.'
+# TODO usage_verification_code: '&cUsage: /verification '
+# TODO incorrect_verification_code: '&cIncorrect code, please type "/verification " into the chat, using the code you received by email'
+# TODO verification_code_verified: '&2Your identity has been verified! You can now execute all commands within the current session!'
+# TODO verification_code_already_verified: '&2You can already execute every sensitive command within the current session!'
+# TODO verification_code_expired: '&3Your code has expired! Execute an other sensitive command to get a new code!'
+# TODO verification_code_email_needed: '&3To verify your identity you need to link an email address with your account!!'
+
# Time units
# TODO second: 'second'
# TODO seconds: 'seconds'
diff --git a/src/main/resources/messages/messages_fr.yml b/src/main/resources/messages/messages_fr.yml
index 53fef0728..32e4a0ca9 100644
--- a/src/main/resources/messages/messages_fr.yml
+++ b/src/main/resources/messages/messages_fr.yml
@@ -101,6 +101,15 @@ usage_captcha: '&cTrop de tentatives de connexion échouées, utilisez: /captcha
wrong_captcha: '&cCaptcha incorrect, écrivez de nouveau: /captcha THE_CAPTCHA'
valid_captcha: '&aCaptché validé! Veuillez maintenant vous connecter.'
+# Verification code
+# TODO verification_code_required: '&3This command is sensitive and requires an email verification! Check your inbox and follow the email''s instructions.'
+# TODO usage_verification_code: '&cUsage: /verification '
+# TODO incorrect_verification_code: '&cIncorrect code, please type "/verification " into the chat, using the code you received by email'
+# TODO verification_code_verified: '&2Your identity has been verified! You can now execute all commands within the current session!'
+# TODO verification_code_already_verified: '&2You can already execute every sensitive command within the current session!'
+# TODO verification_code_expired: '&3Your code has expired! Execute an other sensitive command to get a new code!'
+# TODO verification_code_email_needed: '&3To verify your identity you need to link an email address with your account!!'
+
# Unités de temps
second: 'seconde'
seconds: 'secondes'
diff --git a/src/main/resources/messages/messages_gl.yml b/src/main/resources/messages/messages_gl.yml
index cdf5ddbe4..8c03f366c 100644
--- a/src/main/resources/messages/messages_gl.yml
+++ b/src/main/resources/messages/messages_gl.yml
@@ -96,6 +96,15 @@ usage_captcha: '&cNecesitas escribir un captcha, por favor escribe: /captcha '
+# TODO incorrect_verification_code: '&cIncorrect code, please type "/verification " into the chat, using the code you received by email'
+# TODO verification_code_verified: '&2Your identity has been verified! You can now execute all commands within the current session!'
+# TODO verification_code_already_verified: '&2You can already execute every sensitive command within the current session!'
+# TODO verification_code_expired: '&3Your code has expired! Execute an other sensitive command to get a new code!'
+# TODO verification_code_email_needed: '&3To verify your identity you need to link an email address with your account!!'
+
# Time units
# TODO second: 'second'
# TODO seconds: 'seconds'
diff --git a/src/main/resources/messages/messages_hu.yml b/src/main/resources/messages/messages_hu.yml
index ef627aeb4..63972b468 100644
--- a/src/main/resources/messages/messages_hu.yml
+++ b/src/main/resources/messages/messages_hu.yml
@@ -80,7 +80,6 @@ email_added: '&2Az email címed rögzítése sikeresen megtörtént!'
email_confirm: '&cKérlek, ellenőrízd az email címedet!'
email_changed: '&2Az email cím cseréje sikeresen megtörtént!'
email_send: '&2A jelszó visszaállításhoz szükséges emailt elküldtük! Ellenőrizd a leveleidet!'
-email_exists: '&cA visszaállító emailt elküldtük! Hiba esetén újra kérheted az alábbi parancs segítségével:'
email_show: '&2A jelenlegi email-ed a következő: &f%email'
incomplete_email_settings: 'Hiba: nem lett beállítva az összes szükséges beállítás az email küldéshez. Vedd fel a kapcsolatot egy adminnal.'
email_already_used: '&4Ez az email cím már használatban van!'
@@ -88,6 +87,7 @@ email_send_failure: 'Nem sikerült elküldeni az emailt. Lépj kapcsolatba egy a
show_no_email: '&2Ehhez a felhasználóhoz jelenleg még nincs email hozzárendelve.'
add_email: '&3Kérlek, rendeld hozzá a felhasználódhoz az email címedet "&7/email add &3".'
recovery_email: '&3Ha elfelejtetted a jelszavad, használd az "&7/email recovery &3".'
+# TODO change_password_expired: 'You cannot change your password using this command anymore.'
email_cooldown_error: '&cEgy emailt már kiküldtünk. Következő email küldése előtt várnod kell: %time.'
# Captcha
@@ -95,6 +95,15 @@ usage_captcha: '&3A bejelentkezéshez CAPTCHA szükséges, kérlek, használd a
wrong_captcha: '&cHibás CAPTCHA, kérlek, írd be a következő parancsot: "&7/captcha THE_CAPTCHA&c"!'
valid_captcha: '&2A CAPTCHA sikeresen feloldva!'
+# Verification code
+# TODO verification_code_required: '&3This command is sensitive and requires an email verification! Check your inbox and follow the email''s instructions.'
+# TODO usage_verification_code: '&cUsage: /verification '
+# TODO incorrect_verification_code: '&cIncorrect code, please type "/verification " into the chat, using the code you received by email'
+# TODO verification_code_verified: '&2Your identity has been verified! You can now execute all commands within the current session!'
+# TODO verification_code_already_verified: '&2You can already execute every sensitive command within the current session!'
+# TODO verification_code_expired: '&3Your code has expired! Execute an other sensitive command to get a new code!'
+# TODO verification_code_email_needed: '&3To verify your identity you need to link an email address with your account!!'
+
# Time units
second: 'másodperc'
seconds: 'másodperc'
diff --git a/src/main/resources/messages/messages_id.yml b/src/main/resources/messages/messages_id.yml
index 79472486a..e36004344 100644
--- a/src/main/resources/messages/messages_id.yml
+++ b/src/main/resources/messages/messages_id.yml
@@ -96,6 +96,15 @@ usage_captcha: '&3Kamu harus menyelesaikan kode captcha untuk login, silahkan gu
wrong_captcha: '&cCaptcha salah, gunakan command "/captcha THE_CAPTCHA" pada chat!'
valid_captcha: '&2Kode captcha terselesaikan!'
+# Verification code
+# TODO verification_code_required: '&3This command is sensitive and requires an email verification! Check your inbox and follow the email''s instructions.'
+# TODO usage_verification_code: '&cUsage: /verification '
+# TODO incorrect_verification_code: '&cIncorrect code, please type "/verification " into the chat, using the code you received by email'
+# TODO verification_code_verified: '&2Your identity has been verified! You can now execute all commands within the current session!'
+# TODO verification_code_already_verified: '&2You can already execute every sensitive command within the current session!'
+# TODO verification_code_expired: '&3Your code has expired! Execute an other sensitive command to get a new code!'
+# TODO verification_code_email_needed: '&3To verify your identity you need to link an email address with your account!!'
+
# Time units
# TODO second: 'second'
# TODO seconds: 'seconds'
diff --git a/src/main/resources/messages/messages_it.yml b/src/main/resources/messages/messages_it.yml
index 75c6d9e4c..7261c54cb 100644
--- a/src/main/resources/messages/messages_it.yml
+++ b/src/main/resources/messages/messages_it.yml
@@ -97,6 +97,15 @@ usage_captcha: '&3Per poterti autenticare devi risolvere un captcha, per favore
wrong_captcha: '&cCaptcha sbagliato, per favore riprova scrivendo: "/captcha THE_CAPTCHA" in chat!'
valid_captcha: '&2Il captcha inserito è valido!'
+# Verification code
+# TODO verification_code_required: '&3This command is sensitive and requires an email verification! Check your inbox and follow the email''s instructions.'
+# TODO usage_verification_code: '&cUsage: /verification '
+# TODO incorrect_verification_code: '&cIncorrect code, please type "/verification " into the chat, using the code you received by email'
+# TODO verification_code_verified: '&2Your identity has been verified! You can now execute all commands within the current session!'
+# TODO verification_code_already_verified: '&2You can already execute every sensitive command within the current session!'
+# TODO verification_code_expired: '&3Your code has expired! Execute an other sensitive command to get a new code!'
+# TODO verification_code_email_needed: '&3To verify your identity you need to link an email address with your account!!'
+
# Unità di tempo
second: 'secondo'
seconds: 'secondi'
diff --git a/src/main/resources/messages/messages_ko.yml b/src/main/resources/messages/messages_ko.yml
index 79f93fbca..caced5202 100644
--- a/src/main/resources/messages/messages_ko.yml
+++ b/src/main/resources/messages/messages_ko.yml
@@ -34,7 +34,6 @@ tempban_max_logins: '&c너무 많이 로그인에 실패하여 잠시 서버에
max_reg: '&c당신은 가입할 수 있는 계정 한도를 초과했습니다 (%reg_count/%max_acc %reg_names)!'
no_perm: '&4이 작업을 수행할 수 있는 권한이 없습니다!'
error: '&4예기치 않은 오류가 발생했습니다, 관리자에게 알려주세요!'
-unsafe_spawn: '&c마지막으로 접속한 위치가 안전하지 않습니다, 이 세계의 스폰 지점으로 텔레포트 됩니다.'
kick_forvip: '&3서버가 꽉 차있을땐 VIP 플레이어만 접속이 가능합니다!'
# AntiBot
@@ -48,7 +47,11 @@ accounts_owned_self: '%count 개의 계정을 소유하고 있습니다:'
accounts_owned_other: '플레이어 %name 는 %count 개의 계정을 소유하고 있습니다:'
two_factor_create: '&2당신의 비밀 코드는 %code 입니다. %url 에서 스캔할 수 있습니다'
recovery_code_sent: '비밀번호 재설정을 위한 복구 코드가 이메일로 전송되었습니다.'
+# TODO: Missing tags %count
recovery_code_incorrect: '복구 코드가 올바르지 않습니다! "/email recovery [이메일 주소]"를 이용하여 새로 생성하세요'
+# TODO recovery_tries_exceeded: 'You have exceeded the maximum number attempts to enter the recovery code. Use "/email recovery [email]" to generate a new one.'
+# TODO recovery_code_correct: 'Recovery code entered correctly!'
+# TODO recovery_change_password: 'Please use the command /email setpassword to change your password immediately.'
vb_nonActiv: '&c계정이 아직 활성화되지 않았습니다, 이메일을 확인해보세요!'
usage_unreg: '&c사용법: /unregister <비밀번호>'
pwd_changed: '&2비밀번호가 변경되었습니다!'
@@ -82,7 +85,6 @@ email_added: '&2계정에 이메일 주소를 추가했습니다!'
email_confirm: '&c이메일 주소를 확인해주세요!'
email_changed: '&2이메일 주소가 변경되었습니다!'
email_send: '&2복구 이메일을 보냈습니다! 메일함을 확인해보세요!'
-email_exists: '&c복구 이메일을 이미 보냈습니다! 아래 명령어를 사용하여 취소하고 다시 보낼 수 있습니다:'
email_show: '&2현재 이메일 주소: &f%email'
incomplete_email_settings: '오류: 메일을 보내기 위해 필요한 설정이 되어 있지 않습니다. 관리자에게 알려주세요.'
email_already_used: '&4이메일 주소가 이미 사용 중입니다.'
@@ -90,8 +92,29 @@ email_send_failure: '이메일을 보낼 수 없습니다. 관리자에게 알
show_no_email: '&2현재 이 계정과 연결된 이메일 주소가 없습니다.'
add_email: '&3다음 명령어로 계정에 이메일 주소를 추가하세요: /email add <이메일 주소> <이메일 주소 확인>'
recovery_email: '&3비밀번호를 잊으셨나요? 이 명령어를 사용해보세요: /email recovery <이메일 주소>'
+# TODO change_password_expired: 'You cannot change your password using this command anymore.'
+# TODO email_cooldown_error: '&cAn email was already sent recently. You must wait %time before you can send a new one.'
# Captcha
usage_captcha: '&3로그인 하려면 CAPTCHA 코드를 입력해야 합니다, 이 명령어를 사용하세요: /captcha '
wrong_captcha: '&c잘못된 CAPTCHA 코드 입니다, "/captcha THE_CAPTCHA"을 입력해주세요!'
valid_captcha: '&2CAPTCHA 코드가 확인되었습니다!'
+
+# Verification Code
+# TODO verification_code_required: '&3This command is sensitive and requires an email verification! Check your inbox and follow the email''s instructions.'
+# TODO usage_verification_code: '&cUsage: /verification '
+# TODO incorrect_verification_code: '&cIncorrect code, please type "/verification " into the chat, using the code you received by email'
+# TODO verification_code_verified: '&2Your identity has been verified! You can now execute all commands within the current session!'
+# TODO verification_code_already_verified: '&2You can already execute every sensitive command within the current session!'
+# TODO verification_code_expired: '&3Your code has expired! Execute an other sensitive command to get a new code!'
+# TODO verification_code_email_needed: '&3To verify your identity you need to link an email address with your account!!'
+
+# Time units
+# TODO second: 'second'
+# TODO seconds: 'seconds'
+# TODO minute: 'minute'
+# TODO minutes: 'minutes'
+# TODO hour: 'hour'
+# TODO hours: 'hours'
+# TODO day: 'day'
+# TODO days: 'days'
diff --git a/src/main/resources/messages/messages_lt.yml b/src/main/resources/messages/messages_lt.yml
index 297510879..ec67058f9 100644
--- a/src/main/resources/messages/messages_lt.yml
+++ b/src/main/resources/messages/messages_lt.yml
@@ -96,6 +96,15 @@ usage_captcha: '&cPanaudojimas: /captcha '
wrong_captcha: '&cNeteisinga Captcha, naudokite : /captcha THE_CAPTCHA'
valid_captcha: '&cJusu captcha Teisinga!'
+# Verification code
+# TODO verification_code_required: '&3This command is sensitive and requires an email verification! Check your inbox and follow the email''s instructions.'
+# TODO usage_verification_code: '&cUsage: /verification '
+# TODO incorrect_verification_code: '&cIncorrect code, please type "/verification " into the chat, using the code you received by email'
+# TODO verification_code_verified: '&2Your identity has been verified! You can now execute all commands within the current session!'
+# TODO verification_code_already_verified: '&2You can already execute every sensitive command within the current session!'
+# TODO verification_code_expired: '&3Your code has expired! Execute an other sensitive command to get a new code!'
+# TODO verification_code_email_needed: '&3To verify your identity you need to link an email address with your account!!'
+
# Time units
# TODO second: 'second'
# TODO seconds: 'seconds'
diff --git a/src/main/resources/messages/messages_nl.yml b/src/main/resources/messages/messages_nl.yml
index 18a3e4d7b..84aa01259 100644
--- a/src/main/resources/messages/messages_nl.yml
+++ b/src/main/resources/messages/messages_nl.yml
@@ -95,6 +95,15 @@ usage_captcha: '&3Om in te loggen moet je een captcha-code oplossen, gebruik het
wrong_captcha: '&cVerkeerde captcha-code, typ alsjeblieft "/captcha THE_CAPTCHA" in de chat!'
valid_captcha: '&2De captcha-code is geldig!'
+# Verification code
+# TODO verification_code_required: '&3This command is sensitive and requires an email verification! Check your inbox and follow the email''s instructions.'
+# TODO usage_verification_code: '&cUsage: /verification '
+# TODO incorrect_verification_code: '&cIncorrect code, please type "/verification " into the chat, using the code you received by email'
+# TODO verification_code_verified: '&2Your identity has been verified! You can now execute all commands within the current session!'
+# TODO verification_code_already_verified: '&2You can already execute every sensitive command within the current session!'
+# TODO verification_code_expired: '&3Your code has expired! Execute an other sensitive command to get a new code!'
+# TODO verification_code_email_needed: '&3To verify your identity you need to link an email address with your account!!'
+
# Time units
second: 'seconde'
seconds: 'seconden'
diff --git a/src/main/resources/messages/messages_pl.yml b/src/main/resources/messages/messages_pl.yml
index 3ccc03cf3..5dfca5b12 100644
--- a/src/main/resources/messages/messages_pl.yml
+++ b/src/main/resources/messages/messages_pl.yml
@@ -95,6 +95,15 @@ usage_captcha: '&cWpisz: /captcha '
wrong_captcha: '&cZły kod, proszę wpisać: /captcha THE_CAPTCHA'
valid_captcha: '&cTwój kod jest nieprawidłowy!'
+# Verification code
+# TODO verification_code_required: '&3This command is sensitive and requires an email verification! Check your inbox and follow the email''s instructions.'
+# TODO usage_verification_code: '&cUsage: /verification '
+# TODO incorrect_verification_code: '&cIncorrect code, please type "/verification " into the chat, using the code you received by email'
+# TODO verification_code_verified: '&2Your identity has been verified! You can now execute all commands within the current session!'
+# TODO verification_code_already_verified: '&2You can already execute every sensitive command within the current session!'
+# TODO verification_code_expired: '&3Your code has expired! Execute an other sensitive command to get a new code!'
+# TODO verification_code_email_needed: '&3To verify your identity you need to link an email address with your account!!'
+
# Time units
second: 'sekundy'
seconds: 'sekund'
diff --git a/src/main/resources/messages/messages_pt.yml b/src/main/resources/messages/messages_pt.yml
index 2ce053240..d895ca0e7 100644
--- a/src/main/resources/messages/messages_pt.yml
+++ b/src/main/resources/messages/messages_pt.yml
@@ -97,6 +97,15 @@ usage_captcha: '&cPrecisa digitar um captcha, escreva: /captcha '
wrong_captcha: '&cCaptcha errado, por favor escreva: /captcha THE_CAPTCHA'
valid_captcha: '&cO seu captcha é válido!'
+# Verification code
+# TODO verification_code_required: '&3This command is sensitive and requires an email verification! Check your inbox and follow the email''s instructions.'
+# TODO usage_verification_code: '&cUsage: /verification '
+# TODO incorrect_verification_code: '&cIncorrect code, please type "/verification " into the chat, using the code you received by email'
+# TODO verification_code_verified: '&2Your identity has been verified! You can now execute all commands within the current session!'
+# TODO verification_code_already_verified: '&2You can already execute every sensitive command within the current session!'
+# TODO verification_code_expired: '&3Your code has expired! Execute an other sensitive command to get a new code!'
+# TODO verification_code_email_needed: '&3To verify your identity you need to link an email address with your account!!'
+
# Time units
second: 'segundo'
seconds: 'segundos'
diff --git a/src/main/resources/messages/messages_ro.yml b/src/main/resources/messages/messages_ro.yml
index c7ae75160..43a92170d 100644
--- a/src/main/resources/messages/messages_ro.yml
+++ b/src/main/resources/messages/messages_ro.yml
@@ -95,6 +95,15 @@ usage_captcha: '&3Pentru a te autentifica, te rugam sa folosesti comanda "/captc
wrong_captcha: '&cCodul de verificare este gresit, te rugam foloseste comanda "/captcha THE_CAPTCHA"!'
valid_captcha: '&2Codul de verificare a fost scris corect!'
+# Verification code
+# TODO verification_code_required: '&3This command is sensitive and requires an email verification! Check your inbox and follow the email''s instructions.'
+# TODO usage_verification_code: '&cUsage: /verification '
+# TODO incorrect_verification_code: '&cIncorrect code, please type "/verification " into the chat, using the code you received by email'
+# TODO verification_code_verified: '&2Your identity has been verified! You can now execute all commands within the current session!'
+# TODO verification_code_already_verified: '&2You can already execute every sensitive command within the current session!'
+# TODO verification_code_expired: '&3Your code has expired! Execute an other sensitive command to get a new code!'
+# TODO verification_code_email_needed: '&3To verify your identity you need to link an email address with your account!!'
+
# Time units
second: 'secunda'
seconds: 'secunde'
diff --git a/src/main/resources/messages/messages_ru.yml b/src/main/resources/messages/messages_ru.yml
index cde26ecf2..dd9e7a703 100644
--- a/src/main/resources/messages/messages_ru.yml
+++ b/src/main/resources/messages/messages_ru.yml
@@ -95,6 +95,15 @@ usage_captcha: '&3Необходимо ввести текст с каптчи.
wrong_captcha: '&cНеверно! Используйте «/captcha THE_CAPTCHA».'
valid_captcha: '&2Вы успешно решили каптчу!'
+# Verification code
+# TODO verification_code_required: '&3This command is sensitive and requires an email verification! Check your inbox and follow the email''s instructions.'
+# TODO usage_verification_code: '&cUsage: /verification '
+# TODO incorrect_verification_code: '&cIncorrect code, please type "/verification " into the chat, using the code you received by email'
+# TODO verification_code_verified: '&2Your identity has been verified! You can now execute all commands within the current session!'
+# TODO verification_code_already_verified: '&2You can already execute every sensitive command within the current session!'
+# TODO verification_code_expired: '&3Your code has expired! Execute an other sensitive command to get a new code!'
+# TODO verification_code_email_needed: '&3To verify your identity you need to link an email address with your account!!'
+
# Единицы времени
second: 'с.'
seconds: 'с.'
diff --git a/src/main/resources/messages/messages_sk.yml b/src/main/resources/messages/messages_sk.yml
index 8c0d689f4..04d335e72 100644
--- a/src/main/resources/messages/messages_sk.yml
+++ b/src/main/resources/messages/messages_sk.yml
@@ -102,6 +102,15 @@ usage_captcha: '&3Pre prihlásenie musíš vyriešiť captcha kód, prosím pou
wrong_captcha: '&cNesprávny kód captcha, prosím napíš "/captcha THE_CAPTCHA" do chatu!'
valid_captcha: '&2Správne si vyriešil captcha kód!'
+# Verification code
+# TODO verification_code_required: '&3This command is sensitive and requires an email verification! Check your inbox and follow the email''s instructions.'
+# TODO usage_verification_code: '&cUsage: /verification '
+# TODO incorrect_verification_code: '&cIncorrect code, please type "/verification " into the chat, using the code you received by email'
+# TODO verification_code_verified: '&2Your identity has been verified! You can now execute all commands within the current session!'
+# TODO verification_code_already_verified: '&2You can already execute every sensitive command within the current session!'
+# TODO verification_code_expired: '&3Your code has expired! Execute an other sensitive command to get a new code!'
+# TODO verification_code_email_needed: '&3To verify your identity you need to link an email address with your account!!'
+
# Time units
second: 'sek.'
seconds: 'sek.'
diff --git a/src/main/resources/messages/messages_tr.yml b/src/main/resources/messages/messages_tr.yml
index 2997ddd5b..f8ed0b780 100644
--- a/src/main/resources/messages/messages_tr.yml
+++ b/src/main/resources/messages/messages_tr.yml
@@ -96,6 +96,15 @@ usage_captcha: '&3Giris yapmak icin guvenlik kodunu komut yazarak girin "/captch
wrong_captcha: '&cYanlis guvenlik kodu, kullanim sekli "/captcha THE_CAPTCHA" sohbete yazin!'
valid_captcha: '&2Guvenlik kodu dogrulandi!'
+# Verification code
+# TODO verification_code_required: '&3This command is sensitive and requires an email verification! Check your inbox and follow the email''s instructions.'
+# TODO usage_verification_code: '&cUsage: /verification '
+# TODO incorrect_verification_code: '&cIncorrect code, please type "/verification " into the chat, using the code you received by email'
+# TODO verification_code_verified: '&2Your identity has been verified! You can now execute all commands within the current session!'
+# TODO verification_code_already_verified: '&2You can already execute every sensitive command within the current session!'
+# TODO verification_code_expired: '&3Your code has expired! Execute an other sensitive command to get a new code!'
+# TODO verification_code_email_needed: '&3To verify your identity you need to link an email address with your account!!'
+
# Zaman birimleri
second: 'saniye'
seconds: 'saniye'
diff --git a/src/main/resources/messages/messages_uk.yml b/src/main/resources/messages/messages_uk.yml
index fdd80bb47..45e0565d8 100644
--- a/src/main/resources/messages/messages_uk.yml
+++ b/src/main/resources/messages/messages_uk.yml
@@ -95,6 +95,15 @@ usage_captcha: '&3Для продовження доведеться ввест
wrong_captcha: '&cНевірно введена капча! Спробуйте ще раз — "/captcha THE_CAPTCHA"'
valid_captcha: '&2Капчу прийнято.'
+# Verification code
+# TODO verification_code_required: '&3This command is sensitive and requires an email verification! Check your inbox and follow the email''s instructions.'
+# TODO usage_verification_code: '&cUsage: /verification '
+# TODO incorrect_verification_code: '&cIncorrect code, please type "/verification " into the chat, using the code you received by email'
+# TODO verification_code_verified: '&2Your identity has been verified! You can now execute all commands within the current session!'
+# TODO verification_code_already_verified: '&2You can already execute every sensitive command within the current session!'
+# TODO verification_code_expired: '&3Your code has expired! Execute an other sensitive command to get a new code!'
+# TODO verification_code_email_needed: '&3To verify your identity you need to link an email address with your account!!'
+
# Time units
# TODO second: 'second'
# TODO seconds: 'seconds'
diff --git a/src/main/resources/messages/messages_vn.yml b/src/main/resources/messages/messages_vn.yml
index ff16c030d..e5df437fe 100644
--- a/src/main/resources/messages/messages_vn.yml
+++ b/src/main/resources/messages/messages_vn.yml
@@ -96,6 +96,15 @@ usage_captcha: '&eĐể đăng nhập vui lòng hãy nhập mã Captcha, gõ l
wrong_captcha: '&cSai mã captcha, Vui lòng gõ lệnh "/captcha THE_CAPTCHA"!'
valid_captcha: '&2Mã captcha đã được xác nhận!'
+# Verification code
+# TODO verification_code_required: '&3This command is sensitive and requires an email verification! Check your inbox and follow the email''s instructions.'
+# TODO usage_verification_code: '&cUsage: /verification '
+# TODO incorrect_verification_code: '&cIncorrect code, please type "/verification " into the chat, using the code you received by email'
+# TODO verification_code_verified: '&2Your identity has been verified! You can now execute all commands within the current session!'
+# TODO verification_code_already_verified: '&2You can already execute every sensitive command within the current session!'
+# TODO verification_code_expired: '&3Your code has expired! Execute an other sensitive command to get a new code!'
+# TODO verification_code_email_needed: '&3To verify your identity you need to link an email address with your account!!'
+
# Time units
second: 'giây'
seconds: 'giây'
diff --git a/src/main/resources/messages/messages_zhcn.yml b/src/main/resources/messages/messages_zhcn.yml
index 01a2571c6..c769e438e 100644
--- a/src/main/resources/messages/messages_zhcn.yml
+++ b/src/main/resources/messages/messages_zhcn.yml
@@ -97,6 +97,15 @@ usage_captcha: '&8[&6玩家系统&8] &c正确用法:/captcha '
wrong_captcha: '&8[&6玩家系统&8] &c错误的验证码,请输入:“/captcha THE_CAPTCHA”'
valid_captcha: '&8[&6玩家系统&8] &c你的验证码是有效的!'
+# Verification code
+# TODO verification_code_required: '&3This command is sensitive and requires an email verification! Check your inbox and follow the email''s instructions.'
+# TODO usage_verification_code: '&cUsage: /verification '
+# TODO incorrect_verification_code: '&cIncorrect code, please type "/verification " into the chat, using the code you received by email'
+# TODO verification_code_verified: '&2Your identity has been verified! You can now execute all commands within the current session!'
+# TODO verification_code_already_verified: '&2You can already execute every sensitive command within the current session!'
+# TODO verification_code_expired: '&3Your code has expired! Execute an other sensitive command to get a new code!'
+# TODO verification_code_email_needed: '&3To verify your identity you need to link an email address with your account!!'
+
# 时间单位
second: '秒'
seconds: '秒'
diff --git a/src/main/resources/messages/messages_zhhk.yml b/src/main/resources/messages/messages_zhhk.yml
index 0e27f3a71..71d48e7e0 100644
--- a/src/main/resources/messages/messages_zhhk.yml
+++ b/src/main/resources/messages/messages_zhhk.yml
@@ -99,6 +99,15 @@ usage_captcha: '&8[&6用戶系統&8] &f用法:《 /captcha 》'
wrong_captcha: '&8[&6用戶系統&8] &c你所輸入的驗證碼無效,請使用 《 /captcha THE_CAPTCHA 》 再次輸入。'
valid_captcha: '&8[&6用戶系統&8] &c你所輸入的驗證碼無效 !'
+# Verification code
+# TODO verification_code_required: '&3This command is sensitive and requires an email verification! Check your inbox and follow the email''s instructions.'
+# TODO usage_verification_code: '&cUsage: /verification '
+# TODO incorrect_verification_code: '&cIncorrect code, please type "/verification " into the chat, using the code you received by email'
+# TODO verification_code_verified: '&2Your identity has been verified! You can now execute all commands within the current session!'
+# TODO verification_code_already_verified: '&2You can already execute every sensitive command within the current session!'
+# TODO verification_code_expired: '&3Your code has expired! Execute an other sensitive command to get a new code!'
+# TODO verification_code_email_needed: '&3To verify your identity you need to link an email address with your account!!'
+
# Time units
second: '秒'
seconds: '秒'
diff --git a/src/main/resources/messages/messages_zhmc.yml b/src/main/resources/messages/messages_zhmc.yml
index c4d8897eb..56ae46463 100644
--- a/src/main/resources/messages/messages_zhmc.yml
+++ b/src/main/resources/messages/messages_zhmc.yml
@@ -96,6 +96,15 @@ usage_captcha: '&3T要登錄您必須使用captcha驗證碼,請使用命令: "/c
wrong_captcha: '&c驗證碼錯誤!請按T在聊天中輸入 "/captcha THE_CAPTCHA"'
valid_captcha: '&2驗證碼正確!'
+# Verification code
+# TODO verification_code_required: '&3This command is sensitive and requires an email verification! Check your inbox and follow the email''s instructions.'
+# TODO usage_verification_code: '&cUsage: /verification '
+# TODO incorrect_verification_code: '&cIncorrect code, please type "/verification " into the chat, using the code you received by email'
+# TODO verification_code_verified: '&2Your identity has been verified! You can now execute all commands within the current session!'
+# TODO verification_code_already_verified: '&2You can already execute every sensitive command within the current session!'
+# TODO verification_code_expired: '&3Your code has expired! Execute an other sensitive command to get a new code!'
+# TODO verification_code_email_needed: '&3To verify your identity you need to link an email address with your account!!'
+
# Time units
# TODO second: 'second'
# TODO seconds: 'seconds'
diff --git a/src/main/resources/messages/messages_zhtw.yml b/src/main/resources/messages/messages_zhtw.yml
index 747357678..3df7d1b28 100644
--- a/src/main/resources/messages/messages_zhtw.yml
+++ b/src/main/resources/messages/messages_zhtw.yml
@@ -100,6 +100,15 @@ usage_captcha: '&b【AuthMe】&6請用 &c"/captcha " &6來輸入你
wrong_captcha: '&b【AuthMe】&6錯誤的驗證碼,請使用 《 /captcha THE_CAPTCHA 》 再試一次吧。'
valid_captcha: '&b【AuthMe】&6驗證碼無效!'
+# Verification code
+# TODO verification_code_required: '&3This command is sensitive and requires an email verification! Check your inbox and follow the email''s instructions.'
+# TODO usage_verification_code: '&cUsage: /verification '
+# TODO incorrect_verification_code: '&cIncorrect code, please type "/verification " into the chat, using the code you received by email'
+# TODO verification_code_verified: '&2Your identity has been verified! You can now execute all commands within the current session!'
+# TODO verification_code_already_verified: '&2You can already execute every sensitive command within the current session!'
+# TODO verification_code_expired: '&3Your code has expired! Execute an other sensitive command to get a new code!'
+# TODO verification_code_email_needed: '&3To verify your identity you need to link an email address with your account!!'
+
# Time units
# TODO second: 'second'
# TODO seconds: 'seconds'
diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml
index 9f24120b9..9014476f6 100644
--- a/src/main/resources/plugin.yml
+++ b/src/main/resources/plugin.yml
@@ -47,8 +47,11 @@ commands:
- changepass
- cp
captcha:
- description: Captcha Command
+ description: Captcha command
usage: /captcha
+ verification:
+ description: Verification command
+ usage: /verification
permissions:
authme.admin.*:
description: Gives access to all admin commands
@@ -224,6 +227,7 @@ permissions:
authme.player.login: true
authme.player.logout: true
authme.player.register: true
+ authme.player.security.verificationcode: true
authme.player.seeownaccounts: true
authme.player.unregister: true
authme.player.canbeforced:
@@ -263,6 +267,9 @@ permissions:
authme.player.register:
description: Command permission to register.
default: true
+ authme.player.security.verificationcode:
+ description: Permission to use the email verification codes feature.
+ default: true
authme.player.seeownaccounts:
description: Permission to use to see own other accounts.
default: true
diff --git a/src/main/resources/verification_code_email.html b/src/main/resources/verification_code_email.html
new file mode 100644
index 000000000..c12ae946c
--- /dev/null
+++ b/src/main/resources/verification_code_email.html
@@ -0,0 +1,20 @@
+
+ Dear ,
+
+
+
+ This is your temporary verification code for the server :
+
+
+
+
+
+
+ This code will be valid for the next mins!
+ Use the command
+ /verification
+ to complete the verification process.
+
+
+ See you on !
+
diff --git a/src/test/java/fr/xephi/authme/command/CommandInitializerTest.java b/src/test/java/fr/xephi/authme/command/CommandInitializerTest.java
index 8fb2dcad9..2b8215baa 100644
--- a/src/test/java/fr/xephi/authme/command/CommandInitializerTest.java
+++ b/src/test/java/fr/xephi/authme/command/CommandInitializerTest.java
@@ -44,7 +44,7 @@ public class CommandInitializerTest {
// It obviously doesn't make sense to test much of the concrete data
// that is being initialized; we just want to guarantee with this test
// that data is indeed being initialized and we take a few "probes"
- assertThat(commands, hasSize(8));
+ assertThat(commands, hasSize(9));
assertThat(commandsIncludeLabel(commands, "authme"), equalTo(true));
assertThat(commandsIncludeLabel(commands, "register"), equalTo(true));
assertThat(commandsIncludeLabel(commands, "help"), equalTo(false));
diff --git a/src/test/java/fr/xephi/authme/command/executable/changepassword/ChangePasswordCommandTest.java b/src/test/java/fr/xephi/authme/command/executable/changepassword/ChangePasswordCommandTest.java
index cee384041..4c5488cb8 100644
--- a/src/test/java/fr/xephi/authme/command/executable/changepassword/ChangePasswordCommandTest.java
+++ b/src/test/java/fr/xephi/authme/command/executable/changepassword/ChangePasswordCommandTest.java
@@ -1,5 +1,6 @@
package fr.xephi.authme.command.executable.changepassword;
+import fr.xephi.authme.data.VerificationCodeManager;
import fr.xephi.authme.data.auth.PlayerCache;
import fr.xephi.authme.message.MessageKey;
import fr.xephi.authme.process.Management;
@@ -40,11 +41,14 @@ public class ChangePasswordCommandTest {
private ChangePasswordCommand command;
@Mock
- private CommonService commandService;
+ private CommonService commonService;
@Mock
private PlayerCache playerCache;
+ @Mock
+ private VerificationCodeManager codeManager;
+
@Mock
private ValidationService validationService;
@@ -72,23 +76,24 @@ public class ChangePasswordCommandTest {
command.executeCommand(sender, Arrays.asList("pass", "pass"));
// then
- verify(commandService).send(sender, MessageKey.NOT_LOGGED_IN);
+ verify(commonService).send(sender, MessageKey.NOT_LOGGED_IN);
}
@Test
public void shouldRejectInvalidPassword() {
// given
- CommandSender sender = initPlayerWithName("abc12", true);
+ Player sender = initPlayerWithName("abc12", true);
String password = "newPW";
- given(validationService.validatePassword(password, "abc12"))
- .willReturn(new ValidationResult(MessageKey.INVALID_PASSWORD_LENGTH));
+ given(validationService.validatePassword(password, "abc12")).willReturn(new ValidationResult(MessageKey.INVALID_PASSWORD_LENGTH));
+ given(codeManager.isVerificationRequired(sender)).willReturn(false);
// when
command.executeCommand(sender, Arrays.asList("tester", password));
// then
verify(validationService).validatePassword(password, "abc12");
- verify(commandService).send(sender, MessageKey.INVALID_PASSWORD_LENGTH, new String[0]);
+ verify(commonService).send(sender, MessageKey.INVALID_PASSWORD_LENGTH, new String[0]);
+ verify(codeManager).isVerificationRequired(sender);
}
@Test
@@ -98,14 +103,16 @@ public class ChangePasswordCommandTest {
String newPass = "abc123";
Player player = initPlayerWithName("parker", true);
given(validationService.validatePassword("abc123", "parker")).willReturn(new ValidationResult());
+ given(codeManager.isVerificationRequired(player)).willReturn(false);
// when
command.executeCommand(player, Arrays.asList(oldPass, newPass));
// then
verify(validationService).validatePassword(newPass, "parker");
- verify(commandService, never()).send(eq(player), any(MessageKey.class));
+ verify(commonService, never()).send(eq(player), any(MessageKey.class));
verify(management).performPasswordChange(player, oldPass, newPass);
+ verify(codeManager).isVerificationRequired(player);
}
@Test
diff --git a/src/test/java/fr/xephi/authme/command/executable/email/ChangeEmailCommandTest.java b/src/test/java/fr/xephi/authme/command/executable/email/ChangeEmailCommandTest.java
index b4cb80a96..c990c81ef 100644
--- a/src/test/java/fr/xephi/authme/command/executable/email/ChangeEmailCommandTest.java
+++ b/src/test/java/fr/xephi/authme/command/executable/email/ChangeEmailCommandTest.java
@@ -1,7 +1,9 @@
package fr.xephi.authme.command.executable.email;
+import fr.xephi.authme.data.VerificationCodeManager;
import fr.xephi.authme.message.MessageKey;
import fr.xephi.authme.process.Management;
+import fr.xephi.authme.service.CommonService;
import org.bukkit.command.BlockCommandSender;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@@ -16,9 +18,11 @@ import java.util.Collections;
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;
+import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
+import static org.mockito.Mockito.when;
/**
* Test for {@link ChangeEmailCommand}.
@@ -32,6 +36,12 @@ public class ChangeEmailCommandTest {
@Mock
private Management management;
+ @Mock
+ private CommonService commonService;
+
+ @Mock
+ private VerificationCodeManager codeManager;
+
@Test
public void shouldRejectNonPlayerSender() {
@@ -45,16 +55,34 @@ public class ChangeEmailCommandTest {
verifyZeroInteractions(management);
}
+ @Test
+ public void shouldStopIfVerificationIsRequired() {
+ // given
+ String name = "Testeroni";
+ Player player = initPlayerWithName(name);
+ given(codeManager.isVerificationRequired(player)).willReturn(true);
+
+ // when
+ command.executeCommand(player, Arrays.asList("mail@example.org", "otherMail@example.com"));
+
+ // then
+ verify(codeManager).codeExistOrGenerateNew(name);
+ verify(commonService).send(player, MessageKey.VERIFICATION_CODE_REQUIRED);
+ verifyZeroInteractions(management);
+ }
+
@Test
public void shouldForwardData() {
// given
- Player sender = mock(Player.class);
+ Player sender = initPlayerWithName("AmATest");
+ given(codeManager.isVerificationRequired(sender)).willReturn(false);
// when
command.executeCommand(sender, Arrays.asList("new.mail@example.org", "old_mail@example.org"));
// then
verify(management).performChangeEmail(sender, "new.mail@example.org", "old_mail@example.org");
+ verify(codeManager).isVerificationRequired(sender);
}
@Test
@@ -62,4 +90,10 @@ public class ChangeEmailCommandTest {
// given / when / then
assertThat(command.getArgumentsMismatchMessage(), equalTo(MessageKey.USAGE_CHANGE_EMAIL));
}
+
+ private Player initPlayerWithName(String name) {
+ Player player = mock(Player.class);
+ when(player.getName()).thenReturn(name);
+ return player;
+ }
}
diff --git a/src/test/java/fr/xephi/authme/command/executable/unregister/UnregisterCommandTest.java b/src/test/java/fr/xephi/authme/command/executable/unregister/UnregisterCommandTest.java
index 2adc66d51..5ee573a2b 100644
--- a/src/test/java/fr/xephi/authme/command/executable/unregister/UnregisterCommandTest.java
+++ b/src/test/java/fr/xephi/authme/command/executable/unregister/UnregisterCommandTest.java
@@ -1,5 +1,6 @@
package fr.xephi.authme.command.executable.unregister;
+import fr.xephi.authme.data.VerificationCodeManager;
import fr.xephi.authme.data.auth.PlayerCache;
import fr.xephi.authme.message.MessageKey;
import fr.xephi.authme.process.Management;
@@ -17,11 +18,11 @@ import java.util.Collections;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;
-import static org.mockito.hamcrest.MockitoHamcrest.argThat;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
+import static org.mockito.hamcrest.MockitoHamcrest.argThat;
/**
* Test for {@link UnregisterCommand}.
@@ -36,11 +37,14 @@ public class UnregisterCommandTest {
private Management management;
@Mock
- private CommonService commandService;
+ private CommonService commonService;
@Mock
private PlayerCache playerCache;
+ @Mock
+ private VerificationCodeManager codeManager;
+
@Test
public void shouldCatchUnauthenticatedUser() {
// given
@@ -55,7 +59,26 @@ public class UnregisterCommandTest {
// then
verify(playerCache).isAuthenticated(name);
- verify(commandService).send(player, MessageKey.NOT_LOGGED_IN);
+ verify(commonService).send(player, MessageKey.NOT_LOGGED_IN);
+ verifyZeroInteractions(management);
+ }
+
+ @Test
+ public void shouldStopForMissingVerificationCode() {
+ // given
+ String name = "asldjf";
+ Player player = mock(Player.class);
+ given(player.getName()).willReturn(name);
+ given(playerCache.isAuthenticated(name)).willReturn(true);
+ given(codeManager.isVerificationRequired(player)).willReturn(true);
+
+ // when
+ command.executeCommand(player, Collections.singletonList("blergh"));
+
+ // then
+ verify(playerCache).isAuthenticated(name);
+ verify(codeManager).codeExistOrGenerateNew(name);
+ verify(commonService).send(player, MessageKey.VERIFICATION_CODE_REQUIRED);
verifyZeroInteractions(management);
}
@@ -67,6 +90,7 @@ public class UnregisterCommandTest {
Player player = mock(Player.class);
given(player.getName()).willReturn(name);
given(playerCache.isAuthenticated(name)).willReturn(true);
+ given(codeManager.isVerificationRequired(player)).willReturn(false);
// when
command.executeCommand(player, Collections.singletonList(password));
@@ -74,6 +98,7 @@ public class UnregisterCommandTest {
// then
verify(playerCache).isAuthenticated(name);
verify(management).performUnregister(player, password);
+ verify(codeManager).isVerificationRequired(player);
}
@Test
diff --git a/src/test/java/fr/xephi/authme/command/executable/verification/VerificationCommandTest.java b/src/test/java/fr/xephi/authme/command/executable/verification/VerificationCommandTest.java
new file mode 100644
index 000000000..53ede2d89
--- /dev/null
+++ b/src/test/java/fr/xephi/authme/command/executable/verification/VerificationCommandTest.java
@@ -0,0 +1,161 @@
+package fr.xephi.authme.command.executable.verification;
+
+import fr.xephi.authme.data.VerificationCodeManager;
+import fr.xephi.authme.message.MessageKey;
+import fr.xephi.authme.service.CommonService;
+import org.bukkit.entity.Player;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.junit.MockitoJUnitRunner;
+
+import java.util.Collections;
+
+import static org.hamcrest.Matchers.equalTo;
+import static org.junit.Assert.assertThat;
+import static org.mockito.BDDMockito.given;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+
+/**
+ * Test for {@link VerificationCommand}.
+ */
+@RunWith(MockitoJUnitRunner.class)
+public class VerificationCommandTest {
+
+ @InjectMocks
+ private VerificationCommand command;
+
+ @Mock
+ private CommonService commonService;
+
+ @Mock
+ private VerificationCodeManager codeManager;
+
+ @Test
+ public void shouldDetectIfMailHasASetup() {
+ // given
+ String name = "Alligator";
+ Player player = mockPlayerWithName(name);
+ given(codeManager.canSendMail()).willReturn(false);
+
+ // when
+ command.executeCommand(player, Collections.singletonList("code"));
+
+ // then
+ verify(commonService).send(player, MessageKey.INCOMPLETE_EMAIL_SETTINGS);
+ }
+
+ @Test
+ public void shouldRequireAndAcceptCode() {
+ // given
+ String name = "Duck";
+ String code = "123932";
+ Player player = mockPlayerWithName(name);
+ given(codeManager.canSendMail()).willReturn(true);
+ given(codeManager.isVerificationRequired(player)).willReturn(true);
+ given(codeManager.isCodeRequired(name)).willReturn(true);
+ given(codeManager.checkCode(name, code)).willReturn(true);
+
+ // when
+ command.executeCommand(player, Collections.singletonList(code));
+
+ // then
+ verify(codeManager).isVerificationRequired(player);
+ verify(codeManager).isCodeRequired(name);
+ verify(codeManager).checkCode(name, code);
+ verify(commonService).send(player, MessageKey.VERIFICATION_CODE_VERIFIED);
+ }
+
+ @Test
+ public void shouldRejectCode() {
+ // given
+ String name = "Spider";
+ String code = "98345222"; // more than 6 digits
+ Player player = mockPlayerWithName(name);
+ given(codeManager.canSendMail()).willReturn(true);
+ given(codeManager.isVerificationRequired(player)).willReturn(true);
+ given(codeManager.isCodeRequired(name)).willReturn(true);
+ given(codeManager.checkCode(name, code)).willReturn(false);
+
+ // when
+ command.executeCommand(player, Collections.singletonList(code));
+
+ // then
+ verify(codeManager).isVerificationRequired(player);
+ verify(codeManager).isCodeRequired(name);
+ verify(codeManager).checkCode(name, code);
+ verify(commonService).send(player, MessageKey.INCORRECT_VERIFICATION_CODE);
+ }
+
+ @Test
+ public void shouldRejectVerificationDueToExpiration() {
+ // given
+ String name = "Dog";
+ String code = "131552";
+ Player player = mockPlayerWithName(name);
+ given(codeManager.canSendMail()).willReturn(true);
+ given(codeManager.isVerificationRequired(player)).willReturn(true);
+ given(codeManager.isCodeRequired(name)).willReturn(false);
+
+ // when
+ command.executeCommand(player, Collections.singletonList(code));
+
+ // then
+ verify(codeManager).isVerificationRequired(player);
+ verify(codeManager).isCodeRequired(name);
+ verify(commonService).send(player, MessageKey.VERIFICATION_CODE_EXPIRED);
+ }
+
+ @Test
+ public void shouldRejectVerificationDueToVerifiedIdentity() {
+ // given
+ String name = "Cow";
+ String code = "973583";
+ Player player = mockPlayerWithName(name);
+ given(codeManager.canSendMail()).willReturn(true);
+ given(codeManager.isVerificationRequired(player)).willReturn(false);
+ given(codeManager.hasEmail(name)).willReturn(true);
+
+ // when
+ command.executeCommand(player, Collections.singletonList(code));
+
+ // then
+ verify(codeManager).isVerificationRequired(player);
+ verify(codeManager).hasEmail(name);
+ verify(commonService).send(player, MessageKey.VERIFICATION_CODE_ALREADY_VERIFIED);
+ }
+
+ @Test
+ public void shouldRejectVerificationDueToUndefinedEmail() {
+ // given
+ String name = "Frog";
+ String code = "774543";
+ Player player = mockPlayerWithName(name);
+ given(codeManager.canSendMail()).willReturn(true);
+ given(codeManager.isVerificationRequired(player)).willReturn(false);
+ given(codeManager.hasEmail(name)).willReturn(false);
+
+ // when
+ command.executeCommand(player, Collections.singletonList(code));
+
+ // then
+ verify(codeManager).isVerificationRequired(player);
+ verify(codeManager).hasEmail(name);
+ verify(commonService).send(player, MessageKey.VERIFICATION_CODE_EMAIL_NEEDED);
+ verify(commonService).send(player, MessageKey.ADD_EMAIL_MESSAGE);
+ }
+
+ @Test
+ public void shouldDefineArgumentMismatchMessage() {
+ // given / when / then
+ assertThat(command.getArgumentsMismatchMessage(), equalTo(MessageKey.USAGE_VERIFICATION_CODE));
+ }
+
+ private static Player mockPlayerWithName(String name) {
+ Player player = mock(Player.class);
+ given(player.getName()).willReturn(name);
+ return player;
+ }
+}
diff --git a/src/test/java/fr/xephi/authme/data/VerificationCodeManagerTest.java b/src/test/java/fr/xephi/authme/data/VerificationCodeManagerTest.java
new file mode 100644
index 000000000..b99d6a373
--- /dev/null
+++ b/src/test/java/fr/xephi/authme/data/VerificationCodeManagerTest.java
@@ -0,0 +1,171 @@
+package fr.xephi.authme.data;
+
+import fr.xephi.authme.datasource.DataSource;
+import fr.xephi.authme.datasource.DataSourceResult;
+import fr.xephi.authme.mail.EmailService;
+import fr.xephi.authme.permission.PermissionsManager;
+import fr.xephi.authme.permission.PlayerPermission;
+import fr.xephi.authme.settings.Settings;
+import fr.xephi.authme.settings.properties.SecuritySettings;
+import org.bukkit.entity.Player;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.junit.MockitoJUnitRunner;
+
+import static org.hamcrest.Matchers.equalTo;
+import static org.junit.Assert.assertThat;
+import static org.mockito.BDDMockito.given;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.only;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.verifyZeroInteractions;
+
+/**
+ * Test for {@link VerificationCodeManager}.
+ */
+@RunWith(MockitoJUnitRunner.class)
+public class VerificationCodeManagerTest {
+
+ @Mock
+ private Settings settings;
+
+ @Mock
+ private DataSource dataSource;
+
+ @Mock
+ private EmailService emailService;
+
+ @Mock
+ private PermissionsManager permissionsManager;
+
+ @Before
+ public void setUpBasicBehavior() {
+ given(emailService.hasAllInformation()).willReturn(true);
+ given(settings.getProperty(SecuritySettings.VERIFICATION_CODE_EXPIRATION_MINUTES)).willReturn(1);
+ }
+
+ @Test
+ public void shouldRequireVerification() {
+ // given
+ String name1 = "ILoveTests";
+ Player player1 = mockPlayerWithName(name1);
+ given(dataSource.getEmail(name1)).willReturn(DataSourceResult.of("ilovetests@test.com"));
+ given(permissionsManager.hasPermission(player1, PlayerPermission.VERIFICATION_CODE)).willReturn(true);
+ String name2 = "StillLovingTests";
+ Player player2 = mockPlayerWithName(name2);
+
+ VerificationCodeManager codeManager = createCodeManager();
+ codeManager.verify(name2);
+
+ // when
+ boolean test1 = codeManager.isVerificationRequired(player1);
+ boolean test2 = codeManager.isVerificationRequired(player2);
+
+ // then
+ assertThat(test1, equalTo(true));
+ assertThat(test2, equalTo(false));
+ verify(dataSource, only()).getEmail(name1);
+ verify(permissionsManager, only()).hasPermission(player1, PlayerPermission.VERIFICATION_CODE);
+ }
+
+ @Test
+ public void shouldNotRequireVerificationIfEmailSettingsAreIncomplete() {
+ // given
+ given(emailService.hasAllInformation()).willReturn(false);
+ VerificationCodeManager codeManager = createCodeManager();
+ Player player = mock(Player.class);
+
+ // when
+ boolean result = codeManager.isVerificationRequired(player);
+
+ // then
+ assertThat(result, equalTo(false));
+ verifyZeroInteractions(permissionsManager, dataSource);
+ }
+
+ @Test
+ public void shouldNotRequireVerificationForMissingPermission() {
+ // given
+ Player player = mockPlayerWithName("ILoveTests");
+ given(permissionsManager.hasPermission(player, PlayerPermission.VERIFICATION_CODE)).willReturn(false);
+ VerificationCodeManager codeManager = createCodeManager();
+
+ // when
+ boolean result = codeManager.isVerificationRequired(player);
+
+ // then
+ assertThat(result, equalTo(false));
+ verify(permissionsManager).hasPermission(player, PlayerPermission.VERIFICATION_CODE);
+ verifyZeroInteractions(dataSource);
+ }
+
+ @Test
+ public void shouldGenerateCode() {
+ // given
+ String player = "ILoveTests";
+ String email = "ilovetests@test.com";
+ given(dataSource.getEmail(player)).willReturn(DataSourceResult.of(email));
+ VerificationCodeManager codeManager1 = createCodeManager();
+ VerificationCodeManager codeManager2 = createCodeManager();
+ codeManager2.codeExistOrGenerateNew(player);
+
+ // when
+ boolean test1 = codeManager1.hasCode(player);
+ boolean test2 = codeManager2.hasCode(player);
+
+ // then
+ assertThat(test1, equalTo(false));
+ assertThat(test2, equalTo(true));
+ }
+
+ @Test
+ public void shouldRequireCode() {
+ // given
+ String player = "ILoveTests";
+ String email = "ilovetests@test.com";
+ given(dataSource.getEmail(player)).willReturn(DataSourceResult.of(email));
+ VerificationCodeManager codeManager1 = createCodeManager();
+ VerificationCodeManager codeManager2 = createCodeManager();
+ codeManager2.codeExistOrGenerateNew(player);
+
+ // when
+ boolean test1 = codeManager1.isCodeRequired(player);
+ boolean test2 = codeManager2.isCodeRequired(player);
+
+ // then
+ assertThat(test1, equalTo(false));
+ assertThat(test2, equalTo(true));
+ }
+
+ @Test
+ public void shouldVerifyCode() {
+ // given
+ String player = "ILoveTests";
+ String code = "193458";
+ String email = "ilovetests@test.com";
+ given(dataSource.getEmail(player)).willReturn(DataSourceResult.of(email));
+ VerificationCodeManager codeManager1 = createCodeManager();
+ VerificationCodeManager codeManager2 = createCodeManager();
+ codeManager1.codeExistOrGenerateNew(player);
+
+ // when
+ boolean test1 = codeManager1.checkCode(player, code);
+ boolean test2 = codeManager2.checkCode(player, code);
+
+ // then
+ assertThat(test1, equalTo(false));
+ assertThat(test2, equalTo(false));
+ }
+
+ private VerificationCodeManager createCodeManager() {
+ return new VerificationCodeManager(settings, dataSource, emailService, permissionsManager);
+ }
+
+ private static Player mockPlayerWithName(String name) {
+ Player player = mock(Player.class);
+ given(player.getName()).willReturn(name);
+ return player;
+ }
+}
diff --git a/src/test/java/fr/xephi/authme/settings/SettingsTest.java b/src/test/java/fr/xephi/authme/settings/SettingsTest.java
index f7d2604c2..9482c09a3 100644
--- a/src/test/java/fr/xephi/authme/settings/SettingsTest.java
+++ b/src/test/java/fr/xephi/authme/settings/SettingsTest.java
@@ -77,6 +77,24 @@ public class SettingsTest {
assertThat(result, equalTo(emailMessage));
}
+ @Test
+ public void shouldLoadVerificationMessage() throws IOException {
+ // given
+ String emailMessage = "Please verify your identity with .";
+ File emailFile = new File(testPluginFolder, "verification_code_email.html");
+ createFile(emailFile);
+ Files.write(emailFile.toPath(), emailMessage.getBytes());
+
+ PropertyResource resource = mock(PropertyResource.class);
+ Settings settings = new Settings(testPluginFolder, resource, null, CONFIG_DATA);
+
+ // when
+ String result = settings.getVerificationEmailMessage();
+
+ // then
+ assertThat(result, equalTo(emailMessage));
+ }
+
private static void createFile(File file) {
try {
file.getParentFile().mkdirs();
diff --git a/src/test/java/fr/xephi/authme/util/RandomStringUtilsTest.java b/src/test/java/fr/xephi/authme/util/RandomStringUtilsTest.java
index 556a604c3..1af9851a6 100644
--- a/src/test/java/fr/xephi/authme/util/RandomStringUtilsTest.java
+++ b/src/test/java/fr/xephi/authme/util/RandomStringUtilsTest.java
@@ -61,6 +61,22 @@ public class RandomStringUtilsTest {
}
}
+ @Test
+ public void shouldGenerateRandomNumberString() {
+ // given
+ int[] lengths = {0, 1, 18, 147, 1833};
+ Pattern badChars = Pattern.compile(".*[^0-9].*");
+
+ // when / then
+ for (int length : lengths) {
+ String result = RandomStringUtils.generateNum(length);
+ assertThat("Result '" + result + "' should have length " + length,
+ result.length(), equalTo(length));
+ assertThat("Result '" + result + "' should only have characters 0-9",
+ badChars.matcher(result).matches(), equalTo(false));
+ }
+ }
+
@Test(expected = IllegalArgumentException.class)
public void shouldThrowForInvalidLength() {
// given/when