mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-17 03:03:26 +02:00
[WIP] Refactor account/lost
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
<?php
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
||||
$code = isset($_REQUEST['code']) ? trim($_REQUEST['code']) : '';
|
||||
$character = isset($_REQUEST['character']) ? stripslashes(trim($_REQUEST['character'])) : '';
|
||||
|
||||
if(empty($code) || empty($character))
|
||||
$twig->display('account.lost.check-code.html.twig', [
|
||||
$twig->display('account/lost/check-code.html.twig', [
|
||||
'code' => $code,
|
||||
'characters' => $character,
|
||||
]);
|
||||
@@ -18,22 +20,10 @@ else
|
||||
|
||||
if($account->isLoaded()) {
|
||||
if($account->getCustomField('email_code') == $code) {
|
||||
echo '
|
||||
Please enter new password to your account and repeat to make sure you remember password.<BR>
|
||||
<FORM ACTION="' . getLink('account/lost') . '?action=setnewpassword" METHOD=post>
|
||||
<INPUT TYPE=hidden NAME="character" VALUE="'.$character.'">
|
||||
<INPUT TYPE=hidden NAME="code" VALUE="'.$code.'">
|
||||
<TABLE CELLSPACING=1 CELLPADDING=4 BORDER=0 WIDTH=100%>
|
||||
<TR><TD BGCOLOR="'.$config['vdarkborder'].'" class="white"><B>Passwords</B></TD></TR>
|
||||
<TR><TD BGCOLOR="'.$config['darkborder'].'">
|
||||
New password: <INPUT TYPE=password ID="passor" NAME="passor" VALUE="" SIZE="40"><BR />
|
||||
Repeat new password: <INPUT TYPE=password ID="passor2" NAME="passor2" VALUE="" SIZE="40"><BR />
|
||||
</TD></TR>
|
||||
</TABLE>
|
||||
<BR>
|
||||
<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%><TR><TD><div style="text-align:center">
|
||||
' . $twig->render('buttons.submit.html.twig') . '</div>
|
||||
</TD></TR></FORM></TABLE></TABLE>';
|
||||
$twig->display('account/lost/check-code.finish.html.twig', [
|
||||
'character' => $character,
|
||||
'code' => $code,
|
||||
]);
|
||||
}
|
||||
else {
|
||||
$error = 'Wrong code to change password.';
|
||||
@@ -51,7 +41,7 @@ if(!empty($error)) {
|
||||
|
||||
echo '<br/>';
|
||||
|
||||
$twig->display('account.lost.check-code.html.twig', [
|
||||
$twig->display('account/lost/check-code.html.twig', [
|
||||
|
||||
]);
|
||||
}
|
||||
|
Reference in New Issue
Block a user