Add functionality to create new LDAP users.

Change-Id: If979b1a85556636064c1826dc78fd886331e54c3
Work around pyldap not supporting unicode.

Explicitly convert to plain strings before creating users.

Change-Id: Ic0c775d7bfe625f526f8c66cf3c78182c3012f0e
Make it possible to change the college a user is in.

While the general case is that we don't need this, and it's not
directly exposed at the moment, this is needed for user creation.

Change-Id: Ic7fbaf3e3401ab2dae00cb1f20ccba2aefc68f13
Add functionality to make a user either a student or a teacher.

This is needed for user account creation.

Change-Id: I356e99f8123ac480cd41c0b68196d126af5f9d0e
More useful exception details.

Include the specific user/college the error is about.

Change-Id: I04df6fb05ecf70a08a227fad2ab489cdd5ae4993
Add support for checking if details are already used.

Specifically, checks for a user's full name, and email address.
These will form the basis of duplicate checking.

Change-Id: Ibc7eddc4a4cd6e8c8600d5310de39ff6f0640dc8
Rasise the right exception when blocking user creation.

Previously, instead of a useful exception, an UnboundLocalError was
thrown due to the variable being used in constructing the desired
exception not existing. This commit fixes this, and modifies the tests
to check the values from the exceptions.

Change-Id: I653059bc1ccb70340066daf72efc1c1f37d85dd4
Make can_register_users a property.

Previously this was ambiguous (some implementations had a method,
others had a property), and appears to have mostly been working by
chance rather than anything more subtantial. Add tests which both
assert that this property returns the right values and provide sample
usage. Change the only internal usage to use it as a property.

Change-Id: Iab9d194e388aeb13ce1170a6ce5e303d6844d9de