From ce5a8f72403d99ac7be46aa0f60f69ba9b49368e Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Wed, 3 Jul 2013 14:25:14 +0200 Subject: [PATCH] Fix PHP Warnings on Password Reset page * Added HTML5 required to username field * Added empty string check to resetPassword method Fixes #348 --- public/include/classes/user.class.php | 4 ++++ public/templates/mmcFE/password/default.tpl | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/public/include/classes/user.class.php b/public/include/classes/user.class.php index 04640043..6f8394dc 100644 --- a/public/include/classes/user.class.php +++ b/public/include/classes/user.class.php @@ -517,6 +517,10 @@ class User { public function resetPassword($username, $smarty) { $this->debug->append("STA " . __METHOD__, 4); // Fetch the users mail address + if (empty($username)) { + $this->serErrorMessage("Username must not be empty"); + return false; + } if (!$email = $this->getUserEmail($username)) { $this->setErrorMessage("Unable to find a mail address for user $username"); return false; diff --git a/public/templates/mmcFE/password/default.tpl b/public/templates/mmcFE/password/default.tpl index 35b4a0eb..c82ccd31 100644 --- a/public/templates/mmcFE/password/default.tpl +++ b/public/templates/mmcFE/password/default.tpl @@ -3,6 +3,6 @@

If you have an email set for your account, enter your username to get your password reset

-

+

{include file="global/block_footer.tpl"}