Hello. I'm writing with what may be an issue. Here are the conditions.

1. A user with an e-mail address is an existing member of the site. Let's say they are foo@bar.com.

2. A different user on the site doesn't know this, so they fill out the invite form to invite FOO@bar.com to the site. Notice that they use capital letters FOO.

3. The validation routine notices that they are a member and sends an error alert, but the invitation is still sent.

See attached screenshot for details. I haven't fully tracked down why this happens, but it seems like invite_form_validate is not removing that address from the failed validation before continuing on to send the message. Perhaps a strtolower is needed somewhere in the matching code.

Comments

rjbrown99’s picture

Status: Active » Needs review
StatusFileSize
new459 bytes

OK, how's this. I just added a strtolower to the function that grabs the e-mails. This now works for me and validates correctly. Patch is against 6.x-2.0-alpha1.

EDIT: I read more about why this might be hapening. In the SQL SELECT query that filters out the registered users (just below the line I patched), it does a search of the mail field in the users table. This is a varchar field, so according to the MySQL docs the query is case insensitive. So it matches and returns the error. But the PHP stuff is all comparing on case sensitive fields so that doesn't match.

http://dev.mysql.com/doc/refman/5.0/en/case-sensitivity.html

YK85’s picture

Status: Needs review » Reviewed & tested by the community

Tested and works great. Thanks!

YK85’s picture

Can others also test? Or can this please be committed?

Great module!

smk-ka’s picture

Status: Reviewed & tested by the community » Fixed
StatusFileSize
new794 bytes

Thanks! Committed a slightly modified patch using drupal_strtolower().

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.