2105 Commits

Author SHA1 Message Date
Jake Dallimore
c7bd047d24 Merge branch 'MDL-63710-master' of https://github.com/ilya-catalyst/moodle 2018-12-06 11:34:09 +08:00
Ilya Tregubov
f408e1f888 MDL-63710 repository: Delete orphaned file records. 2018-12-06 12:39:31 +11:00
Tim Hunt
ab1272a0da MDL-46783 accesslib: add tests for MDL-63772 and MDL-63818
MDL-46783, MDL-63772 and MDL-63818 were originally coded on the
assumption that MDL-46783 would get integrated first. However it wasn't.
Therefore, it was not easy to add unit tests for MDL-63772 and MDL-63818
at the time, but it is now, so here they are.
2018-12-05 16:44:57 +00:00
Tim Hunt
939218c2b6 MDL-46783 permissions: let some moodle/ caps be overriden in all mods
The capabilities changed ('contextlevel' => CONTEXT_COURSE changed to
'contextlevel' => CONTEXT_MODULE) are:

* moodle/site:accessallgroups
* moodle/site:viewfullnames
* moodle/site:trustcontent
* moodle/site:viewuseridentity

This list came from reviewing the _get_extra_capabilities functions in
all core activities. They were all somewhat inconsistent, but I think it
makes sense that these capabilities are consistently overridable in all
activities. E.g. moodle/site:accessallgroups affects conditional
availability even if there is no other user of groups, and
moodle/site:viewuseridentity and moodle/site:viewfullnames affect the
logs report, if nothing else.

As a result of this, several _get_extra_capabilities functions are no
longer needed, and all the rest have been simplified.
2018-12-05 16:44:25 +00:00
Jun Pataleta
2102625e09
MDL-64079 oauth2: Test access token expiration 2018-11-21 10:07:14 +01:00
Damyon Wiese
02c4de86ea Merge branch 'MDL-63283-master-2' of https://github.com/snake/moodle 2018-11-15 10:43:03 +08:00
Jake Dallimore
267b4f03e7 MDL-63283 core_message: skip processors in non-individual conversations
Disable the processor for messages being sent to conversation types
other than individual.
2018-11-15 10:37:33 +08:00
Andrew Nicols
46b9a5c49c MDL-53566 core: Make context freeze test compat with clean 2018-11-15 07:39:23 +08:00
Damyon Wiese
89ffc1ee0e Merge branch 'MDL-53566-master' of git://github.com/andrewnicols/moodle 2018-11-14 15:04:01 +08:00
Andrew Nicols
9d76566ffc MDL-53566 core: Rename locking to freezing in UI 2018-11-14 12:37:56 +08:00
Eloy Lafuente (stronk7)
d27e49448f Merge branch 'MDL-53566-master' of git://github.com/andrewnicols/moodle 2018-11-13 23:55:38 +01: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
0333213585 MDL-53566 core: Add behat test for context loking 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
Jake Dallimore
52f9cf205e MDL-63724 core_message: add send_message_to_conversation() to api 2018-11-12 10:09:27 +08:00
Jake Dallimore
b30f4d6d58 MDL-63724 core_message: buffering support for conv messages in manager
We need to be able to delay calling all member processors with localised
event data if a DB transaction is taking place. This code treats a
conversation message as a single item of work to be buffered, and stores
all localised eventdata, and processorlists for later reference. When
processing the buffer, we pass off all localised eventdata items to
their respective member's processors, before firing a single event.
2018-11-12 10:09:27 +08:00
Jake Dallimore
0eddf920be MDL-63724 core_message: add conversation support to message_send()
Added a test confirming that processors are called for each member
and that a single event is fired.
2018-11-12 10:09:27 +08:00
Damyon Wiese
6dfe428363 MDL-63183 auth: Login protection
CSRF protection for the login form. The authenticate_user_login function was
extended to validate the token (in \core\session\manager) but by default it
does not perform the extra validation. Existing uses of this function from
auth plugins and features like "change password" will continue to work without
changes. New config value $CFG->disablelogintoken can bypass this check.
2018-11-07 00:14:48 +01:00
Andrew Nicols
08a3564f93 Merge branch 'MDL-63738' of https://github.com/timhunt/moodle 2018-11-02 08:43:53 +08:00
Tobias Reischmann
3e3e120d3a MDL-58943 oauth2: Added nextcloud to standard issuers
* New button allows to create standard issuer for nextcloud
* Since the endpoints url has to be https and nextcloud relys on the
baseurl to create the endpoints, the baseurl of issuers has now to be
https as well (or empty).
* Google's baseurl was changed to https (there was no reason not to),
whereas Facebook and Microsoft baseurls remain empty.
* In case of the creation of a nextcloud issuer, the baseurl is
required.
* Nextcloud requires the baseurl, therefore a parameter is added to
create_standard_issuer($type, $baseurl = false). That parameter not
required (or used) for anything but Nextcloud.
2018-10-31 10:42:58 +08:00
Tim Hunt
616442a2fa MDL-63738 question bank: a link to download a single question 2018-10-29 10:38:24 +00:00
Damyon Wiese
a3d57af872 MDL-62139 output: Revert template changes
Revert accessibility changes for menus in standard themes.
2018-10-23 10:14:19 +02:00
David Monllao
7e5f0fa66a Merge branch 'MDL-62144-master' of git://github.com/damyon/moodle 2018-10-22 16:33:17 +02:00
Damyon Wiese
191a1c7c23 MDL-62139 output: Accessible action menus
Add label on the "gear" menu and default keyboard and focus controls.
2018-10-22 10:35:21 +08:00
Jake Dallimore
3a1ece149f MDL-63658 core: new method get_component_names() added to core 2018-10-18 08:22:07 +08:00
Jake Dallimore
4fca5dabb2 MDL-63658 core_favourites: introduce the favourites subsystem to core 2018-10-17 10:16:18 +08:00
Eloy Lafuente (stronk7)
19456c3956 Merge branch 'MDL-62891-master-callable_name' of git://github.com/mudrd8mz/moodle 2018-10-10 23:29:40 +02:00
Eloy Lafuente (stronk7)
23a7374b02 Merge branch 'MDL-63225-master' of git://github.com/jleyva/moodle 2018-10-10 23:24:27 +02:00
Damyon Wiese
1bf3a76a59 MDL-61378 forum: Standardize HTML output for posts
Improve the format of the HTML representing a forum post.

1. Use <article> tag to mark it correctly.
2. Use <time> tag to include the real datetime information.
3. Use <address> tag to specify who and when the post came from.
4. Use heading level tags to mark the subject of each post.
5. Properly nest reply posts within their parent <article>
6. Use a header tab for each article to split the metadata from the content.
7. Use CSS to separate links, not text content.

Because posts are now nested properly, the heading for each one refers to it's own article
and we don't need to generate arbitrary heading level tags depending on how deep the post
is nested.
2018-10-09 09:34:57 +08:00
David Mudrák
905d02f458 MDL-62891 core: Introduce new get_callable_name() function 2018-10-05 09:10:16 +02:00
Juan Leyva
27190655b0 MDL-63225 webservice: Return proper debuginfo on WS exceptions
In order to make developers easy, we should give some clues about the type of the data generating exceptions.
2018-10-02 13:14:33 +02:00
David Monllao
85d4b77cd3 Merge branch 'MDL-61967-master' of git://github.com/sarjona/moodle 2018-09-25 11:08:53 +02:00
Sara Arjona
5290d0604b MDL-61967 core_user: Allow filtering by No groups on participants page
A new optional parameter $context has been added to the
core_group::groups_get_members_join() function.
Besides, some core_group methods now accept -1 (USERSWITHOUTHGROUP) for
the groupid field.
2018-09-24 18:33:45 +02:00
Jonathan Champ
1113e34675 MDL-54035 accesslib: Add context->get_parent_context_paths()
Returns full context paths for parent contexts. Useful for exact
matches, such as when checking dirtycontexts.
2018-09-21 09:17:43 -04:00
Jonathan Champ
b2f349a433 MDL-54035 accesslib: separate role definition cache clear
Thanks to MDL-49398, we can separate the combined user session and role
definition cache clearing function into two separate functions. At the
same time, we want to identify and remove mark_dirty() calls that were
added for role definition changes but were incorrectly left behind.

Change highlights:
 - Remove unnecessary mark_dirty() calls performed after
   assign_capability(), unassign_capability(), delete_role(),
   deleted contexts, brand new contexts
 - Move role definition cache clear from the user-centric
   accesslib_clear_all_caches() to the newly created,
   role-dedicated accesslib_reset_role_cache()
2018-09-21 09:17:42 -04:00
David Monllao
72621d23ae Merge branch 'MDL-62347-master' of git://github.com/bmbrands/moodle 2018-09-04 14:05:41 +02:00
David Mudrák
39d2c68856 MDL-61742 messaging: Do not send messages from inactive providers
Before this patch, we only checked that the given provider has been
configured in the user or system preferences. However, if the provider's
component is disabled, it does not even appear in these preferences.
Additionally, there was no check that the message / notification
provider is among providers allowed to be consumed by the recipient.

The patch checks that the message origin is among providers returned by
the message_get_providers_for_user() so disabled plugins can't act as
sources of messages and users can't receive messages from providers they
do not have capability for. This mitigates the risk of abusing a plugin
as a source of spam, for example.

Unit test is fixed and extended. When the $CFG->messaging is disabled,
no messages between users should be sent (I can't understand why the
unit test was written in an opposite way). Added assertions for the
raised debugging message.
2018-08-31 12:15:30 +02:00
Andrew Nicols
e36019c2f3 Merge branch 'wip-MDL-62742-master' of git://github.com/marinaglancy/moodle 2018-08-29 08:31:08 +08:00
Marina Glancy
442f12f81a MDL-62742 core: rename coursecat->core_course_category
Also rename course_in_list -> core_course_list_element
Deprecate class coursecat_sortable_records
2018-08-28 11:36:23 +02:00
John Beedell
d0a60444a1 MDL-63165 Question: xml import of question categories 2018-08-24 15:20:18 +01:00
Jake Dallimore
805ce3de79 Merge branch 'MDL-36255-master' of https://github.com/lucaboesch/moodle 2018-08-21 16:04:17 +08:00
Víctor Déniz Falcón
02fda279ed MDL-57281 behat: deprecated step definition I navigate to node in
Definition step deprecated and affected tests modified.
2018-08-20 12:53:26 +01:00
Luca Bösch
8ad225b431 MDL-36255 grades: allow multilang filters in grades 2018-08-20 08:29:36 +02:00
Andrew Nicols
883f655552 MDL-36754 output: Support token pluginfiles in group pic 2018-08-14 07:06:09 +08:00
Andrew Nicols
8af75f08e8 MDL-36754 tests: Move moodle_url tests to own file 2018-08-14 07:06:09 +08:00
Andrew Nicols
91f1f28233 MDL-36754 core_files: Support tokens when rewriting text
Support use of a token for access to pluginfile.php when rewriting text
content.

This is primarily intended for notifications where the user is unlikely
to be logged into Moodle when receiving the notification.
2018-08-14 06:57:32 +08:00
Bas Brands
4f9d62835a MDL-62347 course: pagination phpunit updates 2018-08-13 13:45:33 +02:00
Jun Pataleta
2454ddb6ef Merge branch 'MDL-45170-master' of git://github.com/junpataleta/moodle 2018-08-08 16:27:55 +08:00
Jun Pataleta
c353ad20c3 MDL-45170 core: Integration review fixes
* Pass $forcehttps parameter to call extract_draft_file_urls_from_text()
 call in \core_weblib_testcase::test_extract_draft_file_urls_from_text()
* Style fixes
2018-08-08 16:17:32 +08:00
Charles Fulton
7d7d3b1731 MDL-45170 files: check other draftfile areas when processing 2018-08-08 16:15:23 +08:00