-
Improvement
-
Resolution: Won't Do
-
Minor
-
None
-
4.4.4
-
None
-
MOODLE_404_STABLE
Initial situation:
It is possible to redirect course URLs using file-level specifications: /course/externservercourse.php
This redirection only affects direct access to the course at its main level. Calls to sub-levels or individual functions are not redirected.
This can be used, for example, to call up the participant list of a course that is defined as a redirect: Manual url-call /user/index.php?id=XYZ
Problem:
By calling up the participant list directly, you can enter participants in a course even though the course itself is to be redirected to another course.
For example, you can enter people in a link course and a target course. The user would then be shown two courses in the dashboard, both of which have the same destination.
my current solution:
- Adjustments in /course/externservercourse.php
- I have added another function to the file that can be used to overwrite an ID for enrollments.
- Adjustments in /enrol/index.php (line 45 - 58)
- The new function in /course/externservercourse.php is called to find the ID of the target course of the forwarding and to overwrite the ID of the currently called course.
Problem with the current solution:
Each redirect must be stored twice in the file (/course/externservercourse.php).
1: the redirect link; 2: the redirect ID
Possible adjustments to the current solution:
Only the forwarding link is used and the required ID for an ID change of the enrollment is extracted from it.
possible better solution
The implemented main code redirect can a) replace a single ID, redirecting all calls related to a course and b) take over the full URL redirect, as is currently the case.