Commit Graph

6 Commits

Author SHA1 Message Date
David Mudrák 8df850ad6f MDL-46946 user: Make missing required custom fields trigger profile edit
If there is a required custom field that the user can fill by editing
their profile, and that field is missing, the user should be considered
as not fully set up. Instead, we want to redirect them to edit their
profile first.

There are some exceptions when we want to fall back to the previous
behaviour and check just the name and email fields. These exceptional
cases include checking remote user data in incoming MNet request (no
user id, no custom fields supported) and calls to require_login() with
redirecting disabled (typically ajax filepicker requests on profile
editing page itself).

Additional plugins that call the function user_not_fully_set_up()
themselves, should perform the strict check in most/typical cases. So
the strict mode is enabled by default even if it changes the behaviour
slightly. In improbable case of additional plugins relying on the
previous behaviour of the function, they can use the $strict parameter
and keep performing the lax check. However, I am sure the correct fix in
that case will likely be to stop abusing this function.

Note that custom fields are not currently transferred during the MNet
roaming. So having custom fields configured as required on MNet service
provider site (where users can't edit their profiles) is expected to
display an error (as the site is considered as misconfigured).
2016-09-21 17:46:30 +02:00
Frederic Massart da1296dd07 MDL-53954 user: Prevent locked profile fields from being edited 2016-05-06 09:27:26 +08:00
Juan Leyva a0b161bf23 MDL-49499 user: Unit tests for profile_view() 2015-04-02 16:57:43 +02:00
Tim Hunt 01e7c3bf4e MDL-47667 profile unit tests: don't assume none by default.
E.g. if an add-on creates a user profile field on install, the test was
failing.
2014-10-14 12:09:51 +01:00
Marina Glancy 65ae0a1bde MDL-45469 profile: make sure profile fields can be initialised without arguments 2014-05-21 11:40:43 +08:00
Marina Glancy 497974f3e8 MDL-45469 Move profile tests to the location recognised by phpunit 2014-05-20 11:58:35 +08:00