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.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 790138-lowercase.patch | 794 bytes | smk-ka |
| #1 | 790138_validation.patch | 459 bytes | rjbrown99 |
| screen-capture.png | 32.73 KB | rjbrown99 |
Comments
Comment #1
rjbrown99 commentedOK, 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
Comment #2
YK85 commentedTested and works great. Thanks!
Comment #3
YK85 commentedCan others also test? Or can this please be committed?
Great module!
Comment #4
smk-ka commentedThanks! Committed a slightly modified patch using drupal_strtolower().