Commit Graph

2397 Commits

Author SHA1 Message Date
Sara Arjona 6e42f0380a Merge branch 'MDL-70163-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-02-03 12:25:35 +01:00
Paul Holden 1fc46d1583 MDL-70163 core: fix attachment validation when localrequestdir absent.
Switch the order of operations performed when collating list of paths
from which a user can include attachments.

First collect all normalised/absolute paths then filter empty entries,
which fixes an issue where $CFG->localrequestdir could be defined but
not exist. This would lead to an empty string being passed to strpos
which triggered a PHP warning.

Co-authored-by: Peter Burnett <peterburnett@catalyst-au.net>
2021-01-25 19:53:41 +00:00
Tim Hunt 0dedf60a9a MDL-46256 count_words: fix handling of paragraphs 2021-01-21 09:54:01 +00:00
Tim Hunt 063dce507a MDL-46256 count_letters: an unit tests and fix HTML editity handling 2021-01-21 09:54:01 +00:00
Kristian Ringer 43f48b8828 MDL-64865 auth: Log changing auth config in get_enabled_auth_plugins 2020-12-22 13:39:21 +08:00
Peter Burnett 08c6aad9a7 MDL-70160 cache: plugin_functions checks for function_exists() 2020-11-23 15:22:27 +08:00
Brendan Heywood b6f59eb325 MDL-47456 core: Remove redundant DB call during bootstrap 2020-11-19 08:54:13 +08:00
Jun Pataleta 022a019637 Merge branch 'MDL-70130-310' of git://github.com/andrewnicols/moodle into MOODLE_310_STABLE 2020-11-06 11:27:54 +08:00
Andrew Nicols 50f5563c1f MDL-70130 core: Compare realpaths for file attachment checks
Rather than using the provided path, the `realpath` must be used to
ensure that the use of symlinks in paths is normalised.
2020-11-06 11:00:30 +08:00
Andrew Nicols 1c0b8f8c50 MDL-70130 core: Simplify attachment handling in email_to_suer 2020-11-06 11:00:29 +08:00
Marina Glancy c879cb24df MDL-70130 core: allow to attach files from localrequestdir to emails
Co-authored-by: Paul Holden <paulh@moodle.com>
2020-11-06 11:00:29 +08:00
Mihail Geshoski fd2427746f MDL-67837 backup: Verify caps before unenrolling users on course restore 2020-11-03 12:34:28 +01:00
Brendan Heywood 256f8a261c MDL-69975 core: Fix paths longer than 260 chars on windows
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>
2020-11-01 11:09:39 +01:00
Víctor Déniz 2dd9b53fd6 Merge branch 'MDL-69513-dkim-settings-MOODLE_310_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_310_STABLE 2020-10-21 11:56:54 +01:00
sam marshall 178d5a0e23 MDL-69687 Course: remove_course_contents orphaned completion data
The remove_course_contents function did not delete data from
course_module_completion table in most cases, resulting in large
quantities of orphaned data.
2020-10-19 10:24:44 +01:00
Brendan Heywood 4db3403481 MDL-69513 email: Add support for email DKIM signatures 2020-10-19 16:20:42 +11:00
sam marshall 3576eb4835 MDL-69687 Course: Improve removal of completion data on MySQL 2020-10-16 18:22:51 +01:00
Jake Dallimore 8b09853319 MDL-59510 core_oauth2: add autorefresh mode to oauth2\client
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.
2020-10-05 09:17:14 +08:00
Brendan Heywood acb848cdce MDL-69600 core: Expose divertallemails config in UI 2020-09-29 20:30:09 +10:00
Brendan Heywood c36d5093e3 MDL-69718 core: Added support for TB and PT to display_size 2020-09-21 12:55:44 +10:00
Farhan Karmali d179137f1b MDL-67419 admin: New admin setting for lang during user creation 2020-09-02 08:54:47 +08:00
sam marshall 30990ac512 MDL-38350 Lib: Rename directory before removing it, to reduce races 2020-08-20 16:57:06 +01:00
Brendan Heywood 0f89884980 MDL-69265 email: Add admin setting for email headers 2020-08-12 20:51:10 +10:00
Charles Fulton 2c93ca61d0 MDL-69074 admin: ensure consistent default for getremoteaddrconf 2020-06-16 16:34:21 -04:00
Michael Hawkins e1e5766940 MDL-68745 lib: Improved docblock descriptions for alpha PARAM types 2020-06-05 17:50:54 +08:00
Adrian Greeve b2978c1787 Merge branch 'MDL-68757' of https://github.com/timhunt/moodle 2020-05-26 10:33:03 +08:00
Neill Magill b26efcd861 MDL-64427 course: Mark activities during course contents deletion
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.
2020-05-20 08:27:53 +01:00
Neill Magill d92acd5dcc MDL-64427 course: Do not allow dirty cm_info during course delete
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.
2020-05-20 08:27:53 +01:00
Andrew Nicols ab6ca1d5c9 Merge branch 'srdjan-slave-conn' of https://github.com/srdjan-catalyst/moodle 2020-05-19 12:29:20 +08:00
Srdjan 46cfde3d95 MDL-19711 dml: Enable use of readonly slave database handles
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.
2020-05-19 11:50:42 +10:00
Tim Hunt 4a45b7112c MDL-68757 questions: don't do output in low-level functions 2020-05-18 20:54:27 +01:00
Amaia Anabitarte f2a9bb6edb MDL-68526 core_contentbank: Delete content when a course is deleted
Or when a course category is moved/deleted
2020-05-18 16:05:04 +02:00
Eloy Lafuente (stronk7) 301cd3e9c0 Merge branch 'MDL-68415' of https://github.com/paulholden/moodle 2020-05-07 18:38:43 +02:00
Paul Holden f4488eca79 MDL-68415 core: test attachments in email_to_user from allowed paths. 2020-05-06 23:23:17 +01:00
fujiwara c4f51bfd31 MDL-68415 email: Fix attachment in email_to_user() 2020-05-04 21:43:57 +09:00
Bas Brands 555ec89ad3 MDL-68329 cache: Improve cache performance footer info 2020-05-01 01:13:37 +02:00
Jun Pataleta 9be6c16a37 Merge branch 'MDL-66732' of https://github.com/paulholden/moodle 2020-04-30 17:16:16 +08:00
Brendan Heywood 9f4bb48e40 MDL-68329 cache: Improve cache performance footer info 2020-04-28 10:08:28 +10:00
Eloy Lafuente (stronk7) 58e73daa59 Merge branch 'MDL-68280' of https://github.com/paulholden/moodle 2020-04-16 00:10:35 +02:00
Paul Holden 16f05b5c22 MDL-66732 core: config option to force whether site considered public. 2020-04-15 22:08:49 +01:00
Paul Holden ab106ad70f MDL-66732 core: improve detection of non-public sites. 2020-04-15 21:54:29 +01:00
Paul Holden 343380d9c8 MDL-67499 user: truncate long username/email during user deletion. 2020-04-06 11:48:27 +01:00
Paul Holden b6ea0ef7ee MDL-68280 user: fix PHP notice for unknown user invalid login token. 2020-04-06 11:46:06 +01:00
Luca Bösch dfe22c29c2 MDL-67672 user: Display name in user menu as elsewhere. 2020-04-01 09:03:03 +02:00
David Mudrák 2d60593892 MDL-68183 auth: Fix the performance of get_complete_user_data search
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.
2020-03-17 14:52:32 +01:00
Eloy Lafuente (stronk7) 41f191b341 Merge branch 'MDL-68125-regression' of https://github.com/brendanheywood/moodle 2020-03-12 01:19:23 +01:00
Brendan Heywood 17b04bdb25 MDL-68125 core: Fixed $CFG->reverseproxyignore install regression 2020-03-12 09:36:17 +11:00
Sara Arjona 32a05b5625 MDL-67063 core: fix error for supporting numbers in component
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.
2020-03-06 20:21:31 +01:00
Brendan Heywood c2366b85b3 MDL-67861 core: Added $CFG->reverseproxyignore IP subnet list
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.
2020-03-05 01:28:05 +01:00
Brendan Heywood 516c8aa506 MDL-67861 libraries: Refactor is_ip_in_subnet_list in ip_utils 2020-03-05 01:28:04 +01:00