-
Improvement
-
Resolution: Deferred
-
Minor
-
None
-
3.4
-
MOODLE_34_STABLE
-
MDL-61591_forward_to_wantsurl -
When a user profile is not fully set up on first login and Moodle requests the profile completion, after saving the changes the client is not forward to the initial value of "$SESSION->wantsurl" but to his or hers profile.
Example: a user tries to open a course URL from another system (an e-mail, for instance); Moodle shows the authentication form and the user uses an external authentication provider which does not provide all the required profile fields for moodle; moodle requests the missing data from the user and, when the user saves the form, is forward to the user profile instead of the initial course URL.
Fixing this should be relatively easy. Here's my suggestion:
diff --git a/user/edit.php b/user/edit.php
|
index f837016..29d0ff5 100644
|
--- a/user/edit.php
|
+++ b/user/edit.php
|
@@ -185,6 +185,8 @@ if ($usernew = $userform->get_data()) { |
} else { |
$returnurl = new moodle_url('/user/profile.php', array('id' => $user->id)); |
}
|
+ } else if(!empty($SESSION->wantsurl)){ |
+ $returnurl = $SESSION->wantsurl; |
} else { |
$returnurl = new moodle_url('/user/preferences.php', array('userid' => $user->id)); |
}
|
By adding those two lines the user should be forward to the initial requested URL.
- has a non-specific relationship to
-
MDL-80422 Honour user specific start page authenticating by OAuth2
-
- Open
-
-
MDL-67051 Have ability to stack wantsurls pushed by different plugins and with different priorities
-
- Open
-
- is duplicated by
-
MDL-80343 Users get stuck in the preferences.php file when accessing via LTI, where some profile data must be filled in before accessing - no access to external tool (course)
-
- Closed
-