From 6f475158128d0c887dbb225cc04ae9a8e7e13abe Mon Sep 17 00:00:00 2001 From: ByPaps <79675866+ByPaps@users.noreply.github.com> Date: Sun, 30 May 2021 11:18:19 -0500 Subject: [PATCH 1/5] Update LoginSecurity.php Change to Spanish --- src/LoginSecurity/Ibenrm01/LoginSecurity.php | 28 ++++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/LoginSecurity/Ibenrm01/LoginSecurity.php b/src/LoginSecurity/Ibenrm01/LoginSecurity.php index 7eb0965..6cf1682 100644 --- a/src/LoginSecurity/Ibenrm01/LoginSecurity.php +++ b/src/LoginSecurity/Ibenrm01/LoginSecurity.php @@ -31,12 +31,12 @@ class LoginSecurity extends PluginBase implements Listener { - const MSG_LOGIN = "§l§eLOGIN §7// §r"; - const MSG_REGISTER = "§l§eREGISTER §7// §r"; - const MSG_CHANGE_PASSWORD = "§l§eCHANGE PASSWORD §7// §r"; - const MSG_REMOVE_PASSWORD = "§l§eREMOVE PASSWORD §7// §r"; - const MSG_MY_PASSWORD = "§l§ePASSWORD §7// §r"; - const MSG_FORGOT_PASSWORD = "§l§eFORGOT PASSWORD §7// §r"; + const MSG_LOGIN = "§l§eBIENVENIDO §7// §r"; + const MSG_REGISTER = "§l§eREGISTRADO §7// §r"; + const MSG_CHANGE_PASSWORD = "§l§eCAMBIAR TU CONTRASEÑA §7// §r"; + const MSG_REMOVE_PASSWORD = "§l§eQUITASTE TU CONSTRASEÑA §7// §r"; + const MSG_MY_PASSWORD = "§l§eCONTRASEÑA §7// §r"; + const MSG_FORGOT_PASSWORD = "§l§eOLVIDASTE TU CONTRASEÑA §7// §r"; public $timer_change_password = []; public $timer_remove_password = []; @@ -280,14 +280,14 @@ public function onForgot(Player $player){ } } }); - $form->setTitle("§l§eFORGOT PASSWORD"); - $form->addLabel("§bPLEASE ENTER A QUESTION AND ANSWER FOR CREATE FORGOT PASSWORD"); - $form->addInput("", "Enter a first question"); - $form->addInput("", "Enter a answer first question"); - $form->addInput("", "Enter a second question"); - $form->addInput("", "Enter a answer second question"); - $form->addInput("", "Enter a last question"); - $form->addInput("", "Enter a answer last question"); + $form->setTitle("§l§eBYPAPS LOGIN"); + $form->addLabel("§bPORFAVOR COLOCA ALGUNAS PREGUNTAS Y RESPUESTAS POR SI OLVIDAS TU CONTRASEÑA"); + $form->addInput("", "Coloca Tu Primera Pregunta"); + $form->addInput("", "Respueta"); + $form->addInput("", "Coloca Tu Segunda Pregunta"); + $form->addInput("", "Respuesta"); + $form->addInput("", "Coloca Tu Ultima Pregunta"); + $form->addInput("", "Respuesta"); $form->sendToPlayer($player); } else { $vls_first = explode(":", $dt->getNested("forgot-password.first-question")); From 75c18c4761981d3569bda7cab111dc788f9fd548 Mon Sep 17 00:00:00 2001 From: ByPaps <79675866+ByPaps@users.noreply.github.com> Date: Sun, 30 May 2021 12:05:23 -0500 Subject: [PATCH 2/5] Recover fix --- src/LoginSecurity/Ibenrm01/LoginSecurity.php | 22 ++++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/LoginSecurity/Ibenrm01/LoginSecurity.php b/src/LoginSecurity/Ibenrm01/LoginSecurity.php index 6cf1682..a1f0ef2 100644 --- a/src/LoginSecurity/Ibenrm01/LoginSecurity.php +++ b/src/LoginSecurity/Ibenrm01/LoginSecurity.php @@ -129,7 +129,7 @@ public function cancelCommand(PlayerCommandPreprocessEvent $event){ } elseif($data->exists("forgot-password")){ if($cmd[0] != "/forgotpass"){ $event->setCancelled(true); - $player->sendMessage(self::MSG_RECOVERY_PASSWORD.$this->getConfig()->get("please-forgot.password")); + $player->sendMessage(self::MSG_FORGOT_PASSWORD.$this->getConfig()->get("please-forgot.password")); } } } @@ -296,7 +296,7 @@ public function onForgot(Player $player){ $api = $this->getServer()->getPluginManager()->getPlugin("FormAPI"); $form = $api->createCustomForm(function (Player $player, array $data = null) use ($dt, $vls_first, $vls_second, $vls_last) { if($data === null){ - $player->sendMessage(self::MSG_FORGOT_PASSWORD."§aThanks for open recover password menu"); + $player->sendMessage(self::MSG_FORGOT_PASSWORD."§aGracias Por Utilizar El Menu De Recuperacion De Contraseñas"); return; } else { if($data[1] != null && $data[3] != null && $data[5] != null){ @@ -319,14 +319,14 @@ public function onForgot(Player $player){ } } }); - $form->setTitle("§l§eFORGOT PASSWORD"); + $form->setTitle("§l§eBYPAPS OLVIDAR CONTRASEÑA"); $form->addLabel($vls_first[0]); - $form->addInput("", "Enter a first answer"); + $form->addInput("", "Coloca La Primera Respuesta"); $form->addLabel($vls_second[0]); - $form->addInput("", "Enter a second answer"); + $form->addInput("", "Coloca La Segunda Respuesta"); $form->addLabel($vls_last[0]); - $form->addInput("", "Enter a last answer"); - $form->addToggle("§dRemove Forgot Password", false); + $form->addInput("", "Coloca La Ultima Respuesta"); + $form->addToggle("§dQuitaste la Recuperacion de Contraseña", false); $form->sendToPlayer($player); } } @@ -348,10 +348,10 @@ public function onAcceptRm(Player $player){ $player->sendMessage(self::MSG_FORGOT_PASSWORD."§aSuccess Remove Forget Password, §bPlease /forgotpass for create new"); } }); - $form->setTitle("§l§eREMOVE FORGOT PASSWORD"); - $form->setContent("§bdo you really want to delete ?"); - $form->setButton1("§aACCEPT", 1); - $form->setButton2("§cCANCEL", 2); + $form->setTitle("§l§eQUITAR RECORDAR CONTRASEÑA"); + $form->setContent("§bEstas Seguro de Eliminarla?"); + $form->setButton1("§aACEPTAR", 1); + $form->setButton2("§cCANCELAR", 2); $form->sendToPlayer($player); } From 4d4e8114ff24447f51b3ce3be809d9092a6f6ad3 Mon Sep 17 00:00:00 2001 From: ByPaps <79675866+ByPaps@users.noreply.github.com> Date: Sun, 30 May 2021 12:08:29 -0500 Subject: [PATCH 3/5] Fix Lints --- src/LoginSecurity/Ibenrm01/LoginSecurity.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/LoginSecurity/Ibenrm01/LoginSecurity.php b/src/LoginSecurity/Ibenrm01/LoginSecurity.php index a1f0ef2..aae6fed 100644 --- a/src/LoginSecurity/Ibenrm01/LoginSecurity.php +++ b/src/LoginSecurity/Ibenrm01/LoginSecurity.php @@ -513,7 +513,6 @@ public function onCommand(CommandSender $player, Command $cmd, string $label, ar $player->sendMessage(self::MSG_FORGOT_PASSWORD."§cPlease Use This Command In-Game"); return true; } - break; } return true; } From 0865d9b2dbfad351ca0dc1a1b05c201e3cbf5ab5 Mon Sep 17 00:00:00 2001 From: ByPaps <79675866+ByPaps@users.noreply.github.com> Date: Sun, 30 May 2021 12:14:08 -0500 Subject: [PATCH 4/5] Fix Lints --- src/LoginSecurity/Ibenrm01/LoginSecurity.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/LoginSecurity/Ibenrm01/LoginSecurity.php b/src/LoginSecurity/Ibenrm01/LoginSecurity.php index aae6fed..682b438 100644 --- a/src/LoginSecurity/Ibenrm01/LoginSecurity.php +++ b/src/LoginSecurity/Ibenrm01/LoginSecurity.php @@ -415,7 +415,6 @@ public function onCommand(CommandSender $player, Command $cmd, string $label, ar $player->sendMessage(self::MSG_LOGIN."§cPlease Use This Command in game"); return true; } - break; case "register": if($player instanceof Player){ if(isset($args[0]) && isset($args[1])){ @@ -439,7 +438,6 @@ public function onCommand(CommandSender $player, Command $cmd, string $label, ar $player->sendMessage(self::MSG_REGISTER."§cUse This Command in-game"); return true; } - break; case "changepass": if($player instanceof Player){ if(isset($args[0]) && isset($args[1])){ @@ -463,7 +461,6 @@ public function onCommand(CommandSender $player, Command $cmd, string $label, ar $player->sendMessage(self::MSG_CHANGE_PASSWORD."§cPlease use this command in-game"); return true; } - break; case "rmpass": if($player->isOp()){ if(isset($args[0])){ @@ -495,7 +492,6 @@ public function onCommand(CommandSender $player, Command $cmd, string $label, ar $player->sendMessage(self::MSG_REMOVE_PASSWORD."§cYou don't have permission"); return true; } - break; case "mypass": if($player instanceof Player){ $this->onMypass($player); @@ -504,7 +500,6 @@ public function onCommand(CommandSender $player, Command $cmd, string $label, ar $player->sendMessage(self::MSG_MY_PASSWORD."§cPlease Use This Command in-game"); return true; } - break; case "forgotpass": if($player instanceof Player){ $this->onForgot($player); From 69e8fe01ba23defd89139afad703ac866b613a52 Mon Sep 17 00:00:00 2001 From: ByPaps <79675866+ByPaps@users.noreply.github.com> Date: Sun, 30 May 2021 12:18:42 -0500 Subject: [PATCH 5/5] Fix Lints --- src/LoginSecurity/Ibenrm01/LoginSecurity.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/LoginSecurity/Ibenrm01/LoginSecurity.php b/src/LoginSecurity/Ibenrm01/LoginSecurity.php index 682b438..131ed98 100644 --- a/src/LoginSecurity/Ibenrm01/LoginSecurity.php +++ b/src/LoginSecurity/Ibenrm01/LoginSecurity.php @@ -337,7 +337,7 @@ public function onForgot(Player $player){ public function onAcceptRm(Player $player){ $dt = new Config($this->getDataFolder()."/players/".$player->getName().".yml", Config::YAML); $api = $this->getServer()->getPluginManager()->getPlugin("FormAPI"); - $form = $api->createModalForm(function (Player $player, $data) use ($dt) { + $form = $api->createCustomForm(function (Player $player, $data) use ($dt) { if($data === null){ $player->sendMessage(self::MSG_FORGOT_PASSWORD."§aThanks for open Forgot Password UI"); return;