Also, ensure that remove_dir() only processes directories,
because sometimes it was being called by shutdown managers
with files, leading to PHP warnings.
Co-authored-by: Eloy Lafuente (stronk7) <stronk7@moodle.org>
Co-authored-by: Jun Pataleta <jun@moodle.com>
The remove_course_contents function did not delete data from
course_module_completion table in most cases, resulting in large
quantities of orphaned data.
Changes:
- The client can now be instantiated with the new mode enabled.
- A user refresh token will be stored if returned as part of the
authorization_code grant but only if the user is authenticated and only
if the mode is enabled.
- If the mode permits it, attempt to exchange a stored refresh token for
a new access token during login checks, allowing access to continue
across sessions without the need to re-grant consent every time.
- Purge all refresh tokens for a given user, issuer and scope on client
log out. This makes sure logout persists across logins.
When we want to delete all of the activities in a course we should
mark them as having a deletion in progress, as this makes them
unavailable to users immediately.
This should make it much less likely that a request to get a context
that does not exist should be made when a user accesses a page.
When deleting a course (especially one containing a large amount of
data) the course mod info cache could contain entries for deleted
activities for a signifcant amount of time making it possible that
users could see errors in Moodle.
Implemented with moodle_read_slave_trait
Functionality is triggered by supplying config dboption['readonly'].
See config-dist.php for more info on supported dboptions.
pgsql and mysqli drivers are using this feature. Also added support for
connection timeout for these two drivers.
When searching for the user by a case-insensitive field (email address
is the only one supported now), the performance may be very poor as the
DB cannot use the index due to the LOWER() operation and the full
sequential scan of all the user records is performed. On some DBs such
as MySQL, this can be significantly improved by pre-filtering the users
with accent-insensitive search.
So we first perform accent-insensitive search for potential candidates
in a subselect, which can use the index. Only then we perform the
additional accent-sensitive search on this limited set or records.
Component names should always support numbers (but the first character).
This patch will add PARAM_COMPONENT the expected regular expression
to validate the expected format.
If your server is behind multiple reverse proxies that append to the
X-Forwarded-For header then you will need to specify a comma separated
list of ip addresses or subnets of the reverse proxies to be ignored
in order to find the users correct IP address.