68 Commits

Author SHA1 Message Date
Paul Holden
d99e0ab7a2 MDL-62853 privacy: sanitize subcontext paths. 2020-04-21 14:38:22 +01:00
Andrew Nicols
fe0944987e MDL-66011 test: remove magic @covers lines 2019-10-04 09:40:34 +08:00
Eloy Lafuente (stronk7)
594717128d MDL-62459 database: remove unused table role_sortorder 2019-04-22 01:37:14 +02:00
Andrew Nicols
bc01342057 MDL-65130 privacy: Add @covers annotation to tests 2019-03-21 10:29:07 +08:00
Andrew Nicols
09d02b3914 MDL-65130 privacy: Fix memory hungry test 2019-03-21 09:52:24 +08:00
Andrew Nicols
306ce452ab MDL-63366 core_privacy: Add coverage whitelisting 2019-03-01 10:30:31 +08:00
Andrew Nicols
9f12dd7a2f MDL-63921 privacy: Add unit test to prove userlist compliance 2018-11-13 11:41:02 +08:00
Andrew Nicols
5efa9f4653 MDL-62601 core_privacy: Ensure providers can handle deleted users 2018-10-31 13:45:00 +08:00
Andrew Nicols
8ba35e317c MDL-63495 privacy: Add support for removal of multiple users in a context
This issue is a part of the MDL-62560 Epic.
2018-10-17 13:12:18 +08:00
Adrian Greeve
e90a0a7415 MDL-62491 core_privacy: Add html files to the user data export.
This adds html to the data export that allows for easier navigation
and reading of data.
2018-10-08 09:00:08 +08:00
Eloy Lafuente (stronk7)
c9840c0144 MDL-62619 privacy: Prevent action when boolean queries are involved
Before the patch, queries like:

SELECT 1 FROM dual UNION SELECT 2 FROM dual

were failing badly, with everything but the first numeric element
being ignored by the optimization.

So, being conservative, now we reduce the query being analysed,
ignoring any subquery, inline view (anything within parenthesis
in general) and, in the remaining query, if a boolean query (UNION,
MINUS, INTERSECT...) is found, we don't apply any optimization.
2018-08-09 16:05:55 +02:00
David Mudrák
cea03cbd43 MDL-62619 privacy: Fix some bits of performance improvements
* We need to use is_numeric() in this case as is_int() would never
  return true.
* Extend the supported cases, add support for SQL consisting just of
  numerical value or selectinga numerical constant.
* Do not rely on any particulat letter case in provided SQL.
* Add unit tests for the new method. Even when it is a protected one, it
  is an essential unit to be tested on its own.
2018-07-27 10:14:43 +02:00
Adrian Greeve
666aae9deb MDL-62574 core_privacy: Unit tests to check the context base.
This now tests the possibility of a context being deleted.
2018-06-12 11:24:38 +08:00
Marina Glancy
004fd4259e MDL-62147 privacy: unittest ensures that all tables covered 2018-05-16 13:57:19 +08:00
Andrew Nicols
22c0a30888 MDL-62134 core_privacy: Allow for a failure handler 2018-05-16 11:52:46 +08:00
David Monllao
014335fb2b Merge branch 'MDL-62370-master' of git://github.com/andrewnicols/moodle 2018-05-14 16:00:32 +02:00
Andrew Nicols
502344a904 MDL-62370 core_privacy: Directory-less subsystems are compliant 2018-05-14 19:59:43 +08:00
Eloy Lafuente (stronk7)
28ec28e026 Merge branch 'MDL-62251-master' of git://github.com/rezaies/moodle 2018-05-13 20:10:44 +02:00
Andrew Nicols
7b4fa14f36 MDL-61858 core_privacy: Add test to ensure component implementations 2018-05-11 19:37:48 +08:00
Jun Pataleta
0697a52218 Merge branch 'MDL-62394-master' of git://github.com/andrewnicols/moodle 2018-05-11 14:23:41 +08:00
Andrew Nicols
20f3b33b24 MDL-62394 privacy: Make JSON export pretty 2018-05-11 14:12:10 +08:00
Shamim Rezaie
44efefcbeb MDL-62251 Privacy: Fix get_path() and get_full_path() bug in Windows 2018-05-10 23:30:23 +10:00
Andrew Nicols
06ede94f07 Merge branch 'wip-MDL-62351-master' of git://github.com/marinaglancy/moodle 2018-05-10 09:17:28 +08:00
Marina Glancy
468c8d39c3 MDL-62351 privacy: check that subsystem/plugintype exist 2018-05-09 17:37:31 +08:00
Marina Glancy
8dd8486355 MDL-61976 privacy: add subcontext argument to has_any_data 2018-05-08 12:03:41 +08:00
Andrew Nicols
630a72f19f Merge branch 'MDL-62285-master' of git://github.com/ryanwyllie/moodle 2018-05-08 11:08:03 +08:00
Jake Dallimore
209f6e1eda Merge branch 'MDL-61407-master' of git://github.com/andrewnicols/moodle 2018-05-04 11:50:26 +08:00
Andrew Nicols
50f5a097a2 MDL-61407 privacy: Reset the writer after writer tests
The writer was not reset after these tests which had the potential to
affect the next test after these were run.
2018-05-03 16:14:38 +08:00
Sara Arjona
7a3707797d MDL-62240 privacy: Avoid error when path is higher than allowed
A new method shorten_filenames has been added to moodlelib.
2018-05-03 09:16:13 +02:00
Ryan Wyllie
3041fe6faa MDL-62285 privacy: use context id when generating context path
moodle_content_writer::get_context_path() now includes the context
id in the path to ensure that it will always generate unique paths
even when the context names are not unique.
2018-05-02 12:08:58 +08:00
Jun Pataleta
1891ed7bb0 Merge branch 'MDL-62060-master' of git://github.com/rezaies/moodle 2018-05-01 10:44:59 +08:00
Shamim Rezaie
c5d720ab51 MDL-62060 core_privacy: Make sure the exported json is human readable 2018-05-01 12:35:00 +10:00
Andrew Nicols
9b7527defc MDL-62248 core_privacy: Add getter for user context prefs 2018-04-30 20:35:56 +08:00
Andrew Nicols
81fa241788 MDL-62248 core_privacy: Unit test for get_user_preferences 2018-04-30 16:00:24 +08:00
David Mudrák
15ce5b7e9b MDL-62241 privacy: Include the unit tests from the 3.3 branch
The tests do not actually do anything, they just make sure that the
method signature is correct on the given PHP version. They are mostly
relevant and useful on 3.3.
2018-04-27 15:25:38 +02:00
Andrew Nicols
7d05f5813d Merge branch 'MDL-62140_master' of git://github.com/markn86/moodle 2018-04-24 11:16:07 +08:00
Mark Nelson
6d82a42353 MDL-62140 core_privacy: only reset tests when necessary 2018-04-24 10:54:21 +08:00
Andrew Nicols
3bdcd4d8c3 MDL-62140 core_privacy: Improve unit test 2018-04-24 10:18:31 +08:00
Andrew Nicols
f829edb719 Merge branch 'MDL-62140_master' of git://github.com/markn86/moodle 2018-04-24 10:04:52 +08:00
Mark Nelson
aa725516d3 MDL-62140 core_privacy: add helper functions to add system/user context 2018-04-23 20:06:02 +08:00
Andrew Nicols
be056e1b28 Merge branch 'wip-MDL-61759-master' of https://github.com/marinaglancy/moodle 2018-04-23 18:31:04 +08:00
Jun Pataleta
c8619b28a3 Merge branch 'MDL-62049_master' of git://github.com/markn86/moodle 2018-04-23 13:54:38 +08:00
Mark Nelson
63d170647c MDL-62049 core_privacy: use correct lang string for date 2018-04-23 13:03:23 +08:00
Marina Glancy
a74c511e7f MDL-61759 admin: non-existing site policy handler means no policy 2018-04-23 10:25:00 +08:00
Andrew Nicols
0683abccfc Merge branch 'MDL-61759-master-nonexistinghandler' of git://github.com/mudrd8mz/moodle 2018-04-22 21:04:56 +08:00
Jun Pataleta
d816a900cb Merge branch 'MDL-62048_master' of git://github.com/markn86/moodle 2018-04-20 11:53:37 +08:00
Andrew Nicols
37909713bb Merge branch 'MDL-62003-master-privacyfiles' of git://github.com/mudrd8mz/moodle 2018-04-20 10:26:01 +08:00
Mark Nelson
f611c727f3 MDL-62048 core_privacy: extend test to ensure table exists 2018-04-19 13:00:15 +08:00
David Mudrák
3ecbf154db MDL-62003 privacy: Consistently export files into _files folder
There were two major issues with the previous implementation:

* The exported folder name was localised so it was "Files" or "Soubory"
  etc depending on the current language. Yet URLs referring to the files
  in that folder were always rewritten with hard-coded English "files".
* Files from all fileareas and itemids were all exported to a single
  target directory. So if there were two files with the same name being
  exported from multiple areas (such as submission_content and
  submission_attachment in the workshop module), one would overwrite
  another.

The patch addresses these issues as follows:

* To unify the folder name and also to minimise the risk of conflict
  with a subcontext folder, we now always export stored files under
  "_files" folder.
* Under that folder, there is a subdirectory with the area name and then
  eventually another subdirectory with non-zero itemid. And there
  finally the stored_file is exported to under its own file path.
2018-04-18 17:10:12 +02:00
Andrew Nicols
ae6072b892 MDL-61974 privacy: Rewrite the content writer storage 2018-04-16 11:12:07 +08:00