From d0572f216a9281d0b2d43e635dfde5985445c905 Mon Sep 17 00:00:00 2001 From: JediKev <kevin@enhancesoft.com> Date: Fri, 3 Nov 2017 12:30:32 -0500 Subject: [PATCH] issue: User Registration Form This addresses issue 4043 where the User registration form does not validate whether or not the required fields have data. This adds checks for data in the Email field and Name field. If there is no data it will not let you create an account. --- account.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/account.php b/account.php index 947a4c36f..18231ab48 100644 --- a/account.php +++ b/account.php @@ -77,6 +77,10 @@ elseif ($_POST) { '</strong></a>')); $errors['err'] = __('Unable to register account. See messages below'); } + elseif (!$addr) + $errors['email'] = sprintf(__('%s is a required field'), $user_form->getField('email')->getLocal('label')); + elseif (!$user_form->getField('name')->getClean()) + $errors['name'] = sprintf(__('%s is a required field'), $user_form->getField('name')->getLocal('label')); // Users created from ClientCreateRequest elseif (isset($_POST['backend']) && !($user = User::fromVars($user_form->getClean()))) $errors['err'] = __('Unable to create local account. See messages below'); -- GitLab