From 26709a1c788de8b187b813e21a64b2a712d0c10d Mon Sep 17 00:00:00 2001 From: Sam White Date: Sun, 25 Feb 2024 06:24:51 -0700 Subject: [PATCH] Attempt to reduce duplicated sign-ups. --- public_html/join.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/public_html/join.php b/public_html/join.php index e398e27..1c7cd29 100644 --- a/public_html/join.php +++ b/public_html/join.php @@ -11,9 +11,13 @@ function validate_member_data(&$errors, $data) { if (empty($errors)) { validate_email_address($errors, $data['email_address']); - //TODO: will want to turn this back on in the future. - /*if (record_exists('members', simple_where('email_address', $data['email_address']))) - $errors[] = 'Email address has already been used.';*/ + # We explicitly allow the same email address to be associated with multiple + # members (e.g. if using a parent's email address), but we require a unique + # first name to try and prevent duplicate sign-ups. + if (record_exists('members', + simple_where('email_address', $data['email_address']) + .' AND '.simple_where('first_name', $data['first_name']))) + $errors[] = 'A member already exists with these details.'; } return empty($errors); -- 2.25.1