From b2eab7ebd4788483a31b241159dec25ffdb0d184 Mon Sep 17 00:00:00 2001 From: Thomas David Baker Date: Wed, 14 Feb 2024 13:03:13 -0800 Subject: [PATCH] Improve forgot password screen (step 1) --- gatherling/forgot.php | 81 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 69 insertions(+), 12 deletions(-) diff --git a/gatherling/forgot.php b/gatherling/forgot.php index ab6a20570..f82906372 100644 --- a/gatherling/forgot.php +++ b/gatherling/forgot.php @@ -1,17 +1,74 @@ emailPrivacy ? "your registered email" : $player->emailAddress; + if (sendLoginLink($player)) { + echo '

A link has been sent to ' . htmlentities($email) . '

'; + } else { + echo '

Unable to send a link to ' . htmlentities($email) . '

'; + printForgotForm(); + } + } else { + echo '

Unable to find a player with that email or username

'; + printForgotForm(); + } +} else { + printForgotForm(); +} + +printPageFooter(); +print_footer(); + +function printPageHeader() { + ?> +
+
+
Login to Gatherling
+
+

Resetting your Gatherling password

+ +
+
+
+ +

Enter your email or username and we'll send you a link to get back into your account.

+
+ + + +
+
+

If you aren't able to reset your password this way please message a Gatherling Administrator + on the Discord

+ -
-
-
Login to Gatherling
-

Resetting your Gatherling password

- - Message a Gatherling Administrator over MTGO or Discord
-
-
- - +function sendLoginLink($player) { + return mail($player->emailAddress, 'Gatherling Login Link', "Click the following link to log in to Gatherling:\n\n"); +}