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);