learningequality/ka-lite — pull request #156 by bcipolli (2013-06-24 00:54:35+00:00)
Title: Case-free usernames (and associated tests for central and distributed servers)

This branch depends on issue #138 (browser-based test framework) and addresses issues #99 and #155.

Email addresses are case-free. We use email addresses for usernames on the central server, but they are case-sensitive.

The following solution is applied to both the central and distributed servers, where case-sensitive usernames can be confusing:
* Allow users to register with any case in their login (for display purposes)
* When logging in, only if ONE user exists with the given username, AND the case is not what matches in the DB, then we coerce the submitted username to match the case of the one in the DB.
* When registering, if any user has the same username (not considering case), then the registration fails.

This should keep things backwards compatible, if any systems exist where two usernames have the same text, but different case.

A large part of this checkin is to extend the test framework to make testing of all important scenarios here possible.