MDL-58071 user: Return usernotfullysetup exception in WS

If there is an empty required custom user profile field, Web Services
should return the usernotfullysetup exception instead ignoring it.
The mobile app already handles this exception for core fields
redirecting the user to web in order to fill the missing field.
This commit is contained in:
Juan Leyva
2017-02-24 20:11:27 +01:00
parent 7a3b115d37
commit eeae783ca3
+3 -3
View File
@@ -2663,10 +2663,10 @@ function require_login($courseorid = null, $autologinguest = true, $cm = null, $
}
// Check that the user account is properly set up. If we can't redirect to
// edit their profile, perform just the lax check. It will allow them to
// use filepicker on the profile edit page.
// edit their profile and this is not a WS request, perform just the lax check.
// It will allow them to use filepicker on the profile edit page.
if ($preventredirect) {
if ($preventredirect && !WS_SERVER) {
$usernotfullysetup = user_not_fully_set_up($USER, false);
} else {
$usernotfullysetup = user_not_fully_set_up($USER, true);