Refactoring of all user editing views
There is too much ad-hoc code in profile edition form, admin user change form, manager user edit form and registration form.
They should all use a same base user form, with adaptations done using a variation on the modelform_factory() function. It should be possible to set the list of fields to show, their labels and which one are required.
Username and email can be set to be globally unique or only for users registered online.
Refactor all model forms on the User model (fixes #6950)
All forms have been rebased on a BaseUserForm using modelform_factory.
New settings are introduces:
Beware that attributes settings using the Attribute model supersede the
settings; i.e. if an attribute has the ask_on_registration flag, it will always
be shown, A2_REGISTRATION_FIELDS will just change its order; required field are
also always shown.