From 2d1a299fe0874d331a325be721850a289353fe49 Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Sat, 11 Mar 2023 13:44:36 +0100 Subject: [PATCH] Replace login and password reset templates --- templates/ForgotPasswordForm.php | 24 +++++++++------ templates/LogInForm.php | 52 ++++++++++++++++++++------------ templates/PasswordResetForm.php | 36 ++++++++++++---------- 3 files changed, 67 insertions(+), 45 deletions(-) diff --git a/templates/ForgotPasswordForm.php b/templates/ForgotPasswordForm.php index 7a50660b..447ebeb6 100644 --- a/templates/ForgotPasswordForm.php +++ b/templates/ForgotPasswordForm.php @@ -11,19 +11,25 @@ class ForgotPasswordForm extends SubTemplate protected function html_content() { echo ' -
-

Password reset procedure

'; +

Password reset procedure

'; foreach ($this->_subtemplates as $template) $template->html_main(); echo ' -

Please fill in the email address you used to sign up in the form below. You will be sent a reset link to your email address.

-
-
- - -
-
'; +

Please fill in the email address you used to sign up in the form below. We will send a reset link to your email address.

+
+
+ +
+ +
+
+
+
+ +
+
+
'; } } diff --git a/templates/LogInForm.php b/templates/LogInForm.php index c2b8835b..0c28e706 100644 --- a/templates/LogInForm.php +++ b/templates/LogInForm.php @@ -11,45 +11,57 @@ class LogInForm extends SubTemplate private $redirect_url = ''; private $emailaddress = ''; + protected $_class = 'content-box container w-50'; + public function setRedirectUrl($url) { - $_SESSION['login_url'] = $url; $this->redirect_url = $url; } public function setEmail($addr) { - $this->emailaddress = htmlentities($addr); + $this->emailaddress = htmlspecialchars($addr); } protected function html_content() { - echo ' -
-

Log in

'; + if (!empty($this->_title)) + echo ' +

Log in to your account

'; - foreach ($this->_subtemplates as $template) - $template->html_main(); + if (!empty($this->_subtemplates)) + { + foreach ($this->_subtemplates as $template) + $template->html_main(); + } echo ' -
-
-
- -
-
-
'; + +
+ +
+ +
+
+
+ +
+ +
+
'; // Throw in a redirect url if asked for. if (!empty($this->redirect_url)) echo ' - '; + '; echo ' - Forgotten your password? -
- -
-
'; +
+
+ + Forgotten your password? +
+
+ '; } } diff --git a/templates/PasswordResetForm.php b/templates/PasswordResetForm.php index 4bc9c5e8..2393bd52 100644 --- a/templates/PasswordResetForm.php +++ b/templates/PasswordResetForm.php @@ -20,27 +20,31 @@ class PasswordResetForm extends SubTemplate protected function html_content() { echo ' -
-

Password reset procedure

'; +

Password reset procedure

'; foreach ($this->_subtemplates as $template) $template->html_main(); echo ' -

You have successfully confirmed your identify. Please use the form below to set a new password.

-
-

- - -

- -

- - -

- +

You have successfully confirmed your identify. Please use the form below to set a new password.

+ +
+ +
+ +
+
+
+ +
+ +
+
+
+
- -
'; +
+
+ '; } }