935 Commits

Author SHA1 Message Date
Sara Arjona
54d446ce43
MDL-77708 docs: Update references from docs.moodle.org/dev 2023-09-26 10:57:33 +02:00
Andrew Nicols
73a55b6268
Merge branch 'MDL-78297-401' of https://github.com/MartinGauk/moodle into MOODLE_401_STABLE 2023-06-12 10:19:43 +08:00
Sara Arjona
4fffa81e41 Merge branch 'MDL-77946-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-06-08 06:56:56 +02:00
Martin Gauk
190db6962e MDL-78297 core: Less cache lookups in deprecated capabilities feature
Avoid use of $cache->has.
2023-06-07 12:04:36 +02:00
Paul Holden
683840999d
MDL-77946 access: fix category sort order of capability contexts. 2023-05-11 08:33:32 +01:00
Rajneel Totaram
f6c5fa3bfc MDL-77930 accesslib: php81 deprecation warnings on missing plugins 2023-05-09 17:37:00 +12:00
Laurent David
ed08a4ee52 MDL-76940 core_courseformat: Index refreshing when role switch
* Hidden sections and content should not visible to students when switching role
2023-03-08 11:51:51 +01:00
Tim Hunt
db861ee6d3 MDL-77018 qbank_statistics: only load stats for contexts that exist
Also, pre-load the contexts for efficiency.
2023-01-27 20:51:51 +00:00
Andrew Nicols
de4de9cec5 MDL-76362 core: Test coursealias before using 2023-01-23 09:16:07 +08:00
Marina Glancy
2dd7290ccb MDL-76362 various: Avoid passing nulls to functions that don't allow nulls
PHP 8.1 is more strict on the parameter type. Functions such as trim(), strlen(), str_replace(), etc
show notice when null is passed as an argument
2023-01-23 09:16:06 +08:00
Shamim Rezaie
9708ad500b Merge branch 'MDL-55580_master' of https://github.com/marxjohnson/moodle 2022-10-17 19:19:36 +11:00
Laurent David
bcc18e2439 MDL-55580 core: Process for deprecating a capability
* Add a $deprecatedcapabilities variable to deal with deprecated
capabilities

Change-Id: I14f44d331e8a1c4bd9abe9566c78d911c0205583
Co-authored-by: Mark Johnson <mark.johnson@catalyst-eu.net>
2022-10-11 08:48:17 +01:00
Marina Glancy
41b93bd7e5 MDL-73424 general: Internal methods must have same type as parent
Otherwise the error is thrown in PHP8.1
2022-10-10 16:46:13 +02:00
Sujith Haridasan
73d604369d MDL-71062 core: Step 1 deprecation of print_error function 2022-07-13 08:20:54 +05:30
Andrew Nicols
00efa6aecf MDL-74271 context: Improve performance of block context creation 2022-04-06 23:40:15 +08:00
Peter Spicer
edde68e078
MDL-67428 navigation: Apply navigation text filters at system context
On some larger sites, processing the navigation with format_string will
habitually load all the contexts for navigation which can take 400+ DB
queries. Explicitly tying all those format_string calls to the system
context reduces this overhead to a single DB query that probably has
already been run on the page previously.

Co-authored-by: Peter Burnett <peterburnett@catalyst-au.net>
2022-03-04 14:36:25 +10:00
cescobedo
3c6ad8ac09 MDL-72616 blocks: Remove block_quiz_results 2021-10-27 06:23:04 +02:00
Amaia Anabitarte
1d4edcb57b MDL-72099 core_contenbank: Add context navigation 2021-10-14 13:04:13 +02:00
Brendan Heywood
7b938088b5 MDL-71014 core: Cache immutable bootstrap config locally 2021-09-02 13:22:28 +10:00
Luca Bösch
0fb0743025 MDL-71284 assign: prevent double escaping assignment name. 2021-05-27 20:31:42 +02:00
Luca Bösch
7dd58aac64 MDL-60331 questions: prevent double escaping question categories. 2021-04-28 17:30:46 +02:00
sam marshall
5e72715e4f MDL-71099 Lib: Move new user_fields class from core to core_user
This class would belong more appropriately within the 'user' API
(core_user) instead of within the 'core' API, since it is
directly related to user data.

Since the class has only just been added to Moodle, now is a good
time to move it.
2021-03-25 13:47:23 +00:00
sam marshall
558cc1b85e MDL-45242 Lib: Replace calls to deprecated functions
In all cases changes have been kept to a minimum while not making
the code completely horrible. For example, there are many instances
where it would probably be better to rewrite a query entirely, but
I have not done that (in order to reduce the risk of changes).
2021-03-10 10:57:10 +00:00
Paul Holden
43adc7a333 MDL-70614 user: consistent roles spacing in course profile. 2021-02-01 07:55:04 +00:00
Paul Holden
20905a1481 MDL-70159 tool_capability: order capabilities by their name. 2021-01-14 07:32:56 +00:00
Andrew Nicols
81bb3a65b1 MDL-68974 admin: Prevent login as outside of the desired context 2020-09-08 08:54:26 +02:00
Paul Holden
a9165e69b4 MDL-63387 access: add parameter to define how role names are returned. 2020-09-01 12:05:15 +01:00
Mike Churchward
9e8e75a05a MDL-68866 accesslib: Fixing parameter documentation. 2020-05-28 22:01:22 -04:00
Matt Porritt
01436f7539 MDL-64843 Backup: Course copy user interface
This patch adds better core support for copying courses.
There is now a simplified and dedicated UI for copying
courses. This can be accessed from the course context
menu or course management screens.

All backups are done asynchronously and there can be multiple
copies of a course in flight at once.
2020-05-15 06:02:02 +00:00
Tim Hunt
1ed243c2fe MDL-68402 accesslib: fix coding style of loops 2020-05-06 09:18:02 +01:00
Tim Hunt
1736c59925 MDL-68402 accesslib: Modernise coding style in the functions changed 2020-05-06 09:18:02 +01:00
Tim Hunt
0d3bdb94bc MDL-68402 accesslib: fix get_with_capability_join logic
In fact, rather than fix the old logic, I noticed that the correct
logic was already implemented in get_users_by_capability. So, I
refactored to extract the working version into a function, which it
turns out can have exactly the same API as get_with_capability_join,
which was convenient.
2020-05-06 09:18:02 +01:00
Tim Hunt
45c4d4aa8c MDL-46123 accesslib: improve get_component_string 2019-12-03 23:11:11 +01:00
sam marshall
7ba2a20166 MDL-66326 Global search: Delete from index when courses are deleted
Adds new API support within search engines for optional methods to
delete data for courses and contexts, and implements this for the
two core search plugins (simpledb and solr).

The new API is automatically called when courses or contexts are
deleted. When a whole course is deleted, it only sends the course
delete rather than sending 1,000 separate context deletions as
each activity/block is deleted.
2019-08-23 11:51:50 +01:00
Neill Magill
e3ec42093a MDL-65443 core: Log when a context is locked or unlocked 2019-08-20 08:52:35 +01:00
Simey Lameze
a98bafa163 MDL-66034 core_role: implement capability unassigned event 2019-08-05 13:09:18 +08:00
Simey Lameze
7b0afca816 MDL-66034 core_role: implement capability assigned event 2019-08-05 13:09:18 +08:00
Andrew Nicols
29c442c558 MDL-65646 core: Move component storage to json 2019-06-13 12:26:00 +08:00
Marina Glancy
beff3806d6 MDL-10965 courses: capability to browse course list 2019-04-10 12:35:28 +02:00
Paul Holden
9ded266b4e MDL-43130 access: fix user counting when retrieving assignable roles.
Previously users assigned the same role in a context via multiple
components would be counted multiple times.
2019-03-08 12:32:24 +00:00
Andrew Nicols
fe41810304 MDL-64410 access: Check for context locking in cap functions 2019-03-06 12:36:05 +01:00
Andrew Nicols
c40f6adbe0 MDL-64971 access: Ensure that the capability exists when fetching 2019-03-06 10:16:06 +08:00
Tim Hunt
a44065edaa MDL-61441 accesslib: get_users_by_capability groups perf improvement 2019-01-11 11:26:41 +00:00
Andrew Nicols
889b585b29 MDL-63686 core: recordset => records when fetching contexts 2019-01-09 19:08:08 +08:00
Andrew Nicols
ccbdced987 MDL-63686 core: Preload parent contexts 2019-01-08 14:11:00 +08:00
Andrew Nicols
bb41db9ce0 MDL-53566 core: Allow admins more control over locking
This change allows sites to configure locking such that it does not
apply to administrators at all.
2018-11-13 21:17:40 +08:00
Andrew Nicols
56db1a2d7c MDL-53566 core: Remove unused ancestorlocked field
This was originalyl intended as a performance improvement, but the
parent is already stored, and once calculated the value of locked is
already returned.
2018-11-13 21:17:40 +08:00
Andrew Nicols
0616f045c3 MDL-53566 core: Add support for context locking
This chagne adds support for a new feature known as Context Locking.
This allows a context to be locked, thereby removing all write
capabilities for all users (including admin) for that context, and all
child contexts.
2018-11-13 21:17:40 +08:00
Andrew Nicols
74a938c353 MDL-63818 core: Add all relevant module context caps
This change ensures that all capabilities at module context level are
shown within a module, only filtering out those which belong to another
module or the subplugins of another module.

This has the effect that module-level capabilities are included
providing they relate to
- the module being queried
- any subplugin of that module
- any capability at module level which does not belong to another module
  or its subplugin
- any other explicitly included capability

This allows permissions to be defined on a capability at a context
level.
2018-11-01 20:51:18 +08:00
David Monllao
e8ce6ca306 MDL-54035 accesslib: Check if the user can switch role before switching 2018-09-26 13:03:08 +02:00