-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into fix-page-body-limited
- Loading branch information
Showing
8 changed files
with
191 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<?php | ||
global $account_logged, $twig, $config; | ||
/** | ||
* Resend Verify Account Email | ||
* | ||
* @package MyAAC | ||
* @author OpenTibiaBR | ||
* @copyright 2024 MyAAC | ||
* @link https://github.com/opentibiabr/myaac | ||
*/ | ||
defined('MYAAC') or die('Direct access not allowed!'); | ||
|
||
if (!$config['mail_enabled']) | ||
echo "You can't resend email to verify your account"; | ||
else { | ||
$accName = $account_logged->getName(); | ||
$accEmail = $account_logged->getEMail(); | ||
|
||
if ($account_logged->getCustomField('email_verified') == '1') { | ||
echo "You account is already verified!"; | ||
return; | ||
} | ||
|
||
if (isset($_POST['confirmresend']) && $_POST['confirmresend'] == '1') { | ||
$hash = md5(generateRandomString(16, true, true) . $accEmail); | ||
$account_logged->setCustomField('email_hash', $hash); | ||
|
||
$verify_url = getLink('account/confirm_email/' . $hash); | ||
$body_html = $twig->render('mail.account.verify.html.twig', array( | ||
'account' => $accName, | ||
'verify_url' => generateLink($verify_url, $verify_url, true) | ||
)); | ||
|
||
if (_mail($accEmail, configLua('serverName') . ' - Verify Account', $body_html)) { | ||
$message = "<br />Your request was sent on email address <b>{$accEmail}</b>"; | ||
$show_form = false; | ||
} else { | ||
$message = "<br /><p class='error'>An error occurred while sending email ( <b>{$accEmail}</b> )! Try again later. For Admin: More info can be found in system/logs/mailer-error.log</p>"; | ||
} | ||
|
||
$twig->display('success.html.twig', array( | ||
'title' => 'Verify Email Sent', | ||
'description' => "<ul>{$message}</ul>" | ||
)); | ||
} | ||
|
||
//show errors if not empty | ||
if (!empty($errors)) { | ||
$twig->display('error_box.html.twig', array('errors' => $errors)); | ||
} | ||
|
||
if ($show_form) { | ||
$twig->display('account.resend_verify_email.html.twig', array( | ||
'name' => $accName, | ||
'email' => $accEmail, | ||
)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 16 additions & 1 deletion
17
system/templates/account.generate_new_recovery_key.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
Check your information and confirm to send verify e-mail. | ||
<br/><br/> | ||
<form action="{{ getLink('account/resend/verify') }}" method="post"> | ||
<input type="hidden" name="confirmresend" value="1"> | ||
<div class="TableContainer"> | ||
<table class="Table1" cellpadding="0" cellspacing="0"> | ||
<div class="CaptionContainer"> | ||
<div class="CaptionInnerContainer"> | ||
<span class="CaptionEdgeLeftTop" | ||
style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span> | ||
<span class="CaptionEdgeRightTop" | ||
style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span> | ||
<span class="CaptionBorderTop" | ||
style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);"></span> | ||
<span class="CaptionVerticalLeft" | ||
style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"></span> | ||
<div class="Text">Confirm Send Verify Email</div> | ||
<span class="CaptionVerticalRight" | ||
style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"></span> | ||
<span class="CaptionBorderBottom" | ||
style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);"></span> | ||
<span class="CaptionEdgeLeftBottom" | ||
style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span> | ||
<span class="CaptionEdgeRightBottom" | ||
style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span> | ||
</div> | ||
</div> | ||
<tr> | ||
<td> | ||
<div class="InnerTableContainer"> | ||
<table style="width:100%;"> | ||
<tr> | ||
<td class="LabelV" style="width: 50px"><span>Account name:</span></td> | ||
<td>{{ name }}</td> | ||
</tr> | ||
<tr> | ||
<td class="LabelV"><span>E-mail:</span></td> | ||
<td>{{ email }}</td> | ||
</tr> | ||
</table> | ||
</div> | ||
</td> | ||
</tr> | ||
</table> | ||
</div> | ||
<br/> | ||
<table style="width:100%"> | ||
<tr align="center"> | ||
<td> | ||
<table border="0" cellspacing="0" cellpadding="0"> | ||
<tr> | ||
<td style="border:0px;"> | ||
{{ include('buttons.submit.html.twig') }} | ||
</td> | ||
</tr> | ||
</form> | ||
</table> | ||
</td> | ||
<td> | ||
<table border="0" cellspacing="0" cellpadding="0"> | ||
<form action="{{ getLink('account/manage') }}" method="post"> | ||
<tr> | ||
<td style="border:0px;"> | ||
{{ include('buttons.back.html.twig') }} | ||
</td> | ||
</tr> | ||
</form> | ||
</table> | ||
</td> | ||
</tr> | ||
</table> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters