From: Sam White Date: Sun, 25 Feb 2024 13:24:51 +0000 (-0700) Subject: Attempt to reduce duplicated sign-ups. X-Git-Url: https://git.dalvak.com/public/?a=commitdiff_plain;h=26709a1c788de8b187b813e21a64b2a712d0c10d;p=ycra.git Attempt to reduce duplicated sign-ups. --- 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);