[WIP] Refactor

This commit is contained in:
slawkens
2025-10-31 09:42:52 +01:00
parent 456b68a88b
commit 6500c29799
9 changed files with 27 additions and 22 deletions

View File

@@ -7,8 +7,8 @@ require __DIR__ . '/../base.php';
$title = 'Lost Account';
$email = $_REQUEST['email'];
$nick = stripslashes($_REQUEST['nick']);
$email = $_POST['email'] ?? '';
$nick = $_POST['nick'] ?? '';
$player = new OTS_Player();
$account = new OTS_Account();

View File

@@ -5,10 +5,10 @@ csrfProtect();
$title = 'Lost Account';
$newPassword = $_REQUEST['password'];
$passwordRepeat = $_REQUEST['password_repeat'];
$code = $_REQUEST['code'];
$character = stripslashes($_REQUEST['character']);
$newPassword = $_POST['password'] ?? '';
$passwordRepeat = $_POST['password_repeat'] ?? '';
$code = $_POST['code'] ?? '';
$character = $_POST['character'] ?? '';
if(empty($code) || empty($character) || empty($newPassword) || empty($passwordRepeat)) {
$errors[] = 'Please enter code from e-mail and name of one character from account. Then press Submit.';

View File

@@ -7,6 +7,8 @@ csrfProtect();
$title = 'Lost Account';
$nick = $_POST['nick'] ?? '';
if($account->isLoaded()) {
if($account->getCustomField('email_next') < time()) {
$twig->display('account/lost/email.html.twig', [