dimagi/commcare-hq — pull request #3766 by NoahCarnahan (2014-07-01 19:33:00+00:00)
Title: Fix case mismatch error in domain invitations

If the email address in a domain invitation has different capitalization than the user's email address in the database, then that user sees an error message when he or she accepts the invitation (but he or she is still added to the domain). This change lower cases both addresses before comparing them for equality.

@dimagi/team-commcare-hq
According to this [SO answer](http://stackoverflow.com/a/9808332), it is up to each email host to decide if they want the part of the email address before the '@' to be case sensitive or not. Although apparently no widely used email providers treat it as case sensitive. So, there is a small security risk here. (It also looks like CommcareHQ login ignores case).