Compare commits

...

921 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7) 45f418c1fb Moodle release 3.2.9 2018-05-16 18:42:08 +02:00
Marina Glancy 9dd3dd7e9d MDL-62469 qtype_calculated: check remaining placeholders, see MDL-62275 2018-05-16 17:53:11 +02:00
David Monllao 52b4e37154 weekly release 3.2.8+ 2018-05-15 09:42:25 +02:00
David Monllao 9fd798836c Merge branch 'install_32_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_32_STABLE 2018-05-15 09:42:24 +02:00
AMOS bot d28d918208 Automatically generated installer lang files 2018-05-15 00:06:53 +00:00
AMOS bot 3ad8987871 Automatically generated installer lang files 2018-05-13 00:07:11 +00:00
Eloy Lafuente (stronk7) 2d7b7fb7ea MDL-62275 qtype_calculatedmulti: Fix typo 2018-05-11 21:18:14 +02:00
Tim Hunt dea378602d MDL-62275 qtype_calc*: improve validation of formulae
Many thanks to Marina Glancy for helping with this.
2018-05-11 01:39:29 +02:00
Marina Glancy d9847116cd MDL-62206 blocks: do not add fixed form elements as hidden 2018-05-10 12:09:17 +08:00
Adam Olley aae1b008bc MDL-62210 mod_assign: limit file lookup to the target assign 2018-05-10 11:22:28 +08:00
Brendan Cox 765b3213b7 MDL-62210 mod_assign: improved validation in portfolio caller class 2018-05-10 11:22:28 +08:00
Jun Pataleta d071380855 MDL-62232 mod_forum: PHPUnit 5.5 needs expectException() 2018-05-10 09:20:37 +08:00
Brendan Cox 1aca561589 MDL-62232 mod_forum: Additional tests for portfolio file export 2018-05-10 09:20:37 +08:00
Adam Olley ee846a8fd8 MDL-62232 mod_forum: Limit portfolio to files belonging to the post 2018-05-10 09:20:36 +08:00
Marina Glancy 1489a61cd5 MDL-62233 portfolio: check caller parent class 2018-05-10 09:20:36 +08:00
Marina Glancy 2dacc7e5fc MDL-61996 core: when loggedin always check user is complete 2018-05-09 12:11:09 +08:00
Jun Pataleta 0f4e6cbb08 weekly release 3.2.8+ 2018-05-09 12:01:04 +08:00
Jun Pataleta 14b8c6390f Merge branch 'install_32_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_32_STABLE 2018-05-09 12:01:03 +08:00
Jake Dallimore 25f79d544b Merge branch 'MDL-62280-32' of git://github.com/andrewnicols/moodle into MOODLE_32_STABLE 2018-05-03 10:54:22 +08:00
AMOS bot af30198303 Automatically generated installer lang files 2018-05-03 00:06:55 +00:00
Andrew Nicols 9e3700abc3 MDL-62280 xhprof: Support tideways_xhprof 2018-05-01 11:03:31 +08:00
AMOS bot b629616925 Automatically generated installer lang files 2018-05-01 00:07:31 +00:00
AMOS bot fc28bbd4fc Automatically generated installer lang files 2018-04-30 00:06:54 +00:00
AMOS bot 6232869e55 Automatically generated installer lang files 2018-04-16 00:07:41 +00:00
AMOS bot d9be1070f9 Automatically generated installer lang files 2018-04-11 00:07:45 +00:00
AMOS bot 8713db6af3 Automatically generated installer lang files 2018-03-31 00:07:36 +00:00
Jun Pataleta cbbdd37166 weekly release 3.2.8+ 2018-03-29 12:55:51 +08:00
Jun Pataleta cb8924f569 Merge branch 'install_32_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_32_STABLE 2018-03-29 12:55:50 +08:00
Jake Dallimore 9ab0ffdead Merge branch 'MDL-61770-32' of git://github.com/andrewnicols/moodle into MOODLE_32_STABLE 2018-03-28 13:34:43 +08:00
Andrew Nicols 4a9bc8b05f MDL-61770 iplookup: Check types rather than values 2018-03-28 10:58:45 +08:00
AMOS bot 7cb51bd02b Automatically generated installer lang files 2018-03-25 00:06:47 +00:00
AMOS bot a65d9ff995 Automatically generated installer lang files 2018-03-21 00:06:34 +00:00
AMOS bot 337b87f159 Automatically generated installer lang files 2018-03-20 00:06:34 +00:00
AMOS bot 8994a96333 Automatically generated installer lang files 2018-03-20 00:06:33 +00:00
Eloy Lafuente (stronk7) 2a591e36a9 Moodle release 3.2.8 2018-03-17 01:18:24 +01:00
Eloy Lafuente (stronk7) 73aca3b00c Merge branch 'install_32_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_32_STABLE 2018-03-17 01:18:21 +01:00
Eloy Lafuente (stronk7) a9cffb2445 Merge branch 'MDL-61600-32' of git://github.com/dpalou/moodle into MOODLE_32_STABLE 2018-03-14 14:43:59 +01:00
Dani Palou b3fe61f9ea MDL-61600 recaptcha: Create a script to display recaptcha 2018-03-14 10:36:37 +01:00
David Mudrák b117c4e23f MDL-61392 enrol_paypal: Improve IPN input parameters checking 2018-03-14 09:12:48 +08:00
David Mudrák c19d2c324b MDL-61392 enrol_paypal: Improve the IPN notifications handling
* Notify administrators once incoming IPN request is verified by PayPal.
* Fix the HTTP status as expected by the IPN protocol.
2018-03-14 09:12:48 +08:00
Eloy Lafuente (stronk7) 9538e66f1b Merge branch 'MDL-48501-mdl32' of git://github.com/jswebster/moodle into MOODLE_32_STABLE 2018-03-12 23:51:19 +01:00
Jeff Webster 0fc009e6a6 MDL-48501 auth/email: update external class to use reCAPTCHA v2 2018-03-07 17:54:03 -05:00
Jeff Webster 6504585b75 MDL-48501 mod_feedback: update feedback to use reCAPTCHA v2 2018-03-07 17:54:03 -05:00
Jeff Webster 1f7125f372 MDL-48501 login: update signup_form to use reCAPTCHA v2 2018-03-07 17:54:02 -05:00
Jeff Webster 35842437e6 MDL-48501 form/recaptcha: update to use reCAPTCHA v2 2018-03-07 16:58:21 -05:00
Jeff Webster 4a09cd7dad MDL-48501 recaptchalib_v2: add new lib to support reCAPTCHA v2 2018-03-07 16:58:21 -05:00
AMOS bot cab14fc8b2 Automatically generated installer lang files 2018-03-07 00:06:50 +00:00
Jeff Webster ff2962fdcf MDL-48501 lang: update reCAPTCHA language strings 2018-03-04 01:25:21 -05:00
AMOS bot 0f6d6d90ac Automatically generated installer lang files 2018-02-19 00:06:46 +00:00
AMOS bot 9334d08ba7 Automatically generated installer lang files 2018-02-17 00:06:49 +00:00
David Monllao 41a39d24e1 weekly release 3.2.7+ 2018-02-08 17:40:24 +01:00
Andrew Nicols b85d42a3d7 Merge branch 'MDL-61269_32' of git://github.com/stronk7/moodle into MOODLE_32_STABLE 2018-02-05 17:54:50 +08:00
Eloy Lafuente (stronk7) 372f8da557 MDL-61269 composer: better license GPL-3.0-or-later
Source: https://spdx.org/licenses/
2018-02-04 19:40:43 +01:00
David Monllao b4b1dab0a9 weekly release 3.2.7+ 2018-02-01 14:26:50 +01:00
David Monllao 0e24f8be19 Merge branch 'install_32_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_32_STABLE 2018-02-01 14:26:49 +01:00
AMOS bot 06ffbbf1de Automatically generated installer lang files 2018-02-01 00:07:09 +00:00
David Mudrák 749bdfe00d MDL-61242 repository_equella: Fix missing class repository
The call to the class 'repository' introduced in the commit d05c2ac7cc
didn't fully work and threw: "Exception - Class 'repository' not found".
This fixes the missing library inclusion.
2018-01-31 23:41:37 +01:00
AMOS bot 6beb85435b Automatically generated installer lang files 2018-01-31 00:06:55 +00:00
AMOS bot 3d8ce1728e Automatically generated installer lang files 2018-01-30 00:06:55 +00:00
Eloy Lafuente (stronk7) 2e6ffa6a73 Merge branch 'wip-MDL-61242-32' of git://github.com/abgreeve/moodle into MOODLE_32_STABLE 2018-01-29 16:36:27 +08:00
Andrew Nicols c7ae3e37e6 weekly release 3.2.7+ 2018-01-29 11:01:19 +08:00
Andrew Nicols 1f82f1fa65 Merge branch 'install_32_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_32_STABLE 2018-01-29 11:01:17 +08:00
Eloy Lafuente (stronk7) 14c2f54c3d MDL-61269 behat-extension: bump to fix some caps & defaults 2018-01-25 00:39:06 +01:00
Adrian Greeve db1fd7f53f MDL-61242 repository_equella: Add source key when sending the source.
A thank you to Nelson Cheng for find this issue and suggesting a patch.
2018-01-20 11:02:57 +08:00
AMOS bot e797ad651e Automatically generated installer lang files 2018-01-19 00:07:22 +00:00
AMOS bot f67cd86431 Automatically generated installer lang files 2018-01-17 00:06:48 +00:00
Jun Pataleta 4b3926de7a Merge branch 'MDL-61221-32' of git://github.com/andrewnicols/moodle into MOODLE_32_STABLE 2018-01-16 23:01:56 +08:00
Andrew Nicols 83740af0c6 MDL-61221 badges: Ignore site availabilty for behat
Behat sites should not be available publically, and the check against
the backpack API for site availablity can time out in some situations.

We should be testing as though the site _is_ available, as this is the
standard expectation.
2018-01-16 13:26:15 +08:00
Eloy Lafuente (stronk7) c254733047 Merge branch 'MDL-61204-32' of git://github.com/andrewnicols/moodle into MOODLE_32_STABLE 2018-01-16 02:17:22 +01:00
Andrew Nicols 3e9a86affe MDL-61204 user: Fix random failure in behat
We need to get into the habit of not using usernames like 'student1'
and 'student10' as our matches are non-strict, and the tests become
dependent upon DB sort order.

This change adds a character after the varying value to act as a
delimter for all of these tests.
2018-01-16 08:32:44 +08:00
AMOS bot a6726e4977 Automatically generated installer lang files 2018-01-16 00:07:01 +00:00
Eloy Lafuente (stronk7) 36c7af0e7e Moodle release 3.2.7 2018-01-12 20:35:36 +01:00
Eloy Lafuente (stronk7) 4ef5597d7d Merge branch 'install_32_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_32_STABLE 2018-01-12 20:35:34 +01:00
Cameron Ball e490115306 MDL-61143 core_files: Don't append dot when checking domain names or IP addresses.
Previously we appended a dot at the end of IP addresses and domain names in the
cURL security helper, but it causes issues with Google OAuth so this patch removes it.
2018-01-10 15:24:17 +08:00
Adrian Greeve 5124deed08 MDL-61131 repositories: Added a key to verify incoming urls. 2018-01-09 11:34:58 +01:00
Cameron Ball 7f0420d619 MDL-61143 core_files: Update unit tests for curl_security_helper
Previously some of the unit tests were passing "by accident" becuase
we had the security helper letting through domains where the DNS lookup
failed. That behaviour has changed and now such domains are blocked.

Additionally tests for domains with multiple A records and weird Unicode
stuff have been added.

This patch also mocks the DNS resolution in the test, rather than actually
resolving the domain.
2018-01-09 12:23:06 +08:00
Cameron Ball 811fae41ac MDL-61143 core_files: Block hosts that cannot be determined to be an IP address of domain name
Freaky deaky Unicode/octal/hex domains can be resolved by cURL but are technically not valid.

This patch causes anything that Moodle does not consider to be a valid domain or IP to be blocked
by the cURL security helper.
2018-01-09 12:23:06 +08:00
Cameron Ball a7c779c738 MDL-61143 core_files: Check all A records when testing blocked IPs 2018-01-09 12:23:06 +08:00
Juan Leyva f850097c93 MDL-60908 mod_quiz: Return question state only when configured
The question state should be returned following the quiz review options
settings.
2018-01-08 22:05:33 +08:00
Simey Lameze 65254822e7 MDL-60235 core_calendar: clean event name field 2018-01-08 22:05:33 +08:00
David Monllao 4a0dfea83f Merge branch 'MDL-61169-32' of git://github.com/andrewnicols/moodle into MOODLE_32_STABLE 2018-01-08 14:59:19 +01:00
Andrew Nicols bce737d1a5 MDL-61169 iplookup: Change to github.com IP 2018-01-08 17:16:32 +08:00
AMOS bot 3c9ddce77e Automatically generated installer lang files 2018-01-04 00:07:24 +00:00
AMOS bot 641f227228 Automatically generated installer lang files 2018-01-03 00:06:45 +00:00
AMOS bot 47751e701b Automatically generated installer lang files 2017-12-18 00:06:39 +00:00
AMOS bot 71e7fb3a20 Automatically generated installer lang files 2017-12-14 00:06:31 +00:00
AMOS bot 471566fde2 Automatically generated installer lang files 2017-12-08 00:10:14 +00:00
Jun Pataleta 21f89c034c weekly release 3.2.6+ 2017-12-08 09:10:00 +13:00
Andrew Nicols 3a3f575f4d Merge branch 'MDL-59159_32' of git://github.com/stronk7/moodle into MOODLE_32_STABLE 2017-12-06 10:05:49 +08:00
Eloy Lafuente (stronk7) e2b71acd1f MDL-59159 environment: 3.1 (LTS) required 2017-12-04 02:05:10 +01:00
Eloy Lafuente (stronk7) 0551e106ba MDL-59159 environment: 3.5 base information
This is a direct copy of the 3.4 branch to
have changes under control easier in next commits.
2017-12-04 02:05:09 +01:00
David Monllao 40c64cf9ff weekly release 3.2.6+ 2017-11-23 13:35:13 +01:00
Neill Magill 3df77c0829 MDL-60436 blocks: Unit test for dashboard block positioning 2017-11-17 14:37:01 +00:00
Neill Magill f01bcdcbe3 MDL-60436 blocks: Improve performance of block loading 2017-11-13 09:11:40 +00:00
Eloy Lafuente (stronk7) c0523b9857 Moodle release 3.2.6 2017-11-11 19:29:31 +01:00
AMOS bot becebd955f Automatically generated installer lang files 2017-11-11 00:05:56 +00:00
David Monllao 0c7a83a632 weekly release 3.2.5+ 2017-11-10 15:15:20 +01:00
David Monllao 92d19efe4c Merge branch 'install_32_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_32_STABLE 2017-11-10 15:15:19 +01:00
Jun Pataleta 13c21e81b8 Merge branch 'MDL-60771-32' of git://github.com/lameze/moodle into MOODLE_32_STABLE 2017-11-10 18:03:08 +13:00
Damyon Wiese 7121cdfc3e Merge branch 'MDL-60749-32' of git://github.com/sarjona/moodle into MOODLE_32_STABLE 2017-11-10 12:06:56 +08:00
Simey Lameze 1d24a0fe2f MDL-60771 mod_scorm: typecast score to integer 2017-11-10 12:02:59 +08:00
Andrew Nicols dab49d9fcd Merge branch 'MDL-52838-32' of git://github.com/damyon/moodle into MOODLE_32_STABLE 2017-11-10 11:50:19 +08:00
Damyon Wiese eecc7ff372 MDL-52838 workshop: Each criterion > 0 levels
Add validation to the edit assessment form so each criterion in a rubric requires at least one level.
2017-11-10 10:22:35 +08:00
Sara Arjona adfc2dd7a6 MDL-60749 scorm: Remove   from files when downloading 2017-11-09 10:56:51 +01:00
Sara Arjona 80ad2ce7ce MDL-60550 user: Add more restrictions in keyword searches
Original patch provided by Tim Schroeder.
2017-11-09 15:50:27 +08:00
David Monllao fda021dcc6 Merge branch 'MDL-60615-32' of git://github.com/damyon/moodle into MOODLE_32_STABLE 2017-11-09 08:49:11 +01:00
Damyon Wiese 7b47a1e464 Merge branch 'MDL-60752-32' of git://github.com/andrewnicols/moodle into MOODLE_32_STABLE 2017-11-09 15:11:02 +08:00
Damyon Wiese 49212a0e82 MDL-60615 imscc: string to array fix
Sloppy typing in the imscc converter is causing errors on php7.1

Variable is initialised as a string and then used as an array.
2017-11-09 15:06:48 +08:00
Andrew Nicols 9875c6c899 MDL-60752 lti: Compare text in types_config properly 2017-11-09 14:27:16 +08:00
AMOS bot 83939aeed6 Automatically generated installer lang files 2017-11-09 00:05:20 +00:00
David Monllao b5a794e133 Merge branch 'MDL-60720-m32' of https://github.com/sammarshallou/moodle into MOODLE_32_STABLE 2017-11-08 17:32:48 +01:00
David Monllao ab05a777b8 Merge branch 'MDL-58699-32' of git://github.com/damyon/moodle into MOODLE_32_STABLE 2017-11-08 15:56:50 +01:00
David Monllao 4126e44fa3 MDL-60733 oauth: Remove outdated comment 2017-11-08 12:05:10 +01:00
David Monllao 768e1558be Merge branch 'MDL-60733-32' of git://github.com/damyon/moodle into MOODLE_32_STABLE 2017-11-08 12:05:03 +01:00
David Monllao f42720e3f9 weekly release 3.2.5+ 2017-11-08 09:47:23 +01:00
David Monllao 60fbdc0e23 Merge branch 'install_32_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_32_STABLE 2017-11-08 09:47:21 +01:00
Damyon Wiese 306a3eba3f MDL-60733 core: B/C for google_oauth
The google_oauth class extends oauth2client which was modified to send "Accept" headers.

The "Accept" headers break picasa and could break any other plugin that was using google_oauth.
2017-11-08 15:25:37 +08:00
Jun Pataleta 3d75433495 Merge branch 'MDL-60717-32-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_32_STABLE 2017-11-08 14:43:54 +13:00
AMOS bot f55ffd1d37 Automatically generated installer lang files 2017-11-08 00:05:21 +00:00
Helen Foster 2ab4e9e320 MDL-60717 lang: Merge English strings from the en_fix language pack
Significant string changes:

- needbcmath,auth_ldap - 'grace logins' changed to 'expired password
  checking'
2017-11-07 21:59:23 +01:00
sam marshall 016d93e1df MDL-60720 core_search: Indexing halts on failed get_document
The recordsets used for search indexing sometimes return results
which are invalid (e.g. cannot be found in database). When this
happens, the result in the iterator for the recordset will be
false. Due to a bug, the iterator used to stop when it encountered
a false value, which prevented indexing from getting past the
problematic record.

In addition, the iterator that skips future data resulted in the
current() function of its parent indicator being called twice per
entry, which meant that search indexing called get_document()
twice as many times.
2017-11-07 16:47:58 +00:00
Jake Dallimore a15fae38cb Merge branch 'MDL-57772-32' of git://github.com/damyon/moodle into MOODLE_32_STABLE 2017-11-07 15:02:12 +08:00
Damyon Wiese c1d666c078 MDL-58699 mod_quiz: Require javascript for popup
If any of the access rules require the attempt to open in a new window, assume we
require javascript to attempt the quiz. This makes it harder to bypass the javascript
pseudo security restrictions.
2017-11-07 12:50:26 +08:00
Damyon Wiese ccca9cf794 MDL-57772 chat: BEEP is back baby! 2017-11-07 11:25:21 +08:00
sam marshall 9f9350068b MDL-60671 core_search: Cron output should use mtrace
The mtrace function is preferable for plain text logging/progress
output because it can be redirected if necessary. By convention it
is normally used in cron and can be used in CLI tasks if required.

This change makes the text_progress_trace class use mtrace instead
of echo and then flush. (Default behaviour of mtrace is to do
exactly that, but it can be redirected too.)

Before this change, if anybody is relying on mtrace behaviour to
redirect logs of cron output, this will fail for some parts of the
search cron output (and some other places like auth plugins).
2017-11-07 11:08:13 +08:00
David Monllao 3c665aed99 Merge branch 'MDL-60424-32' of git://github.com/jleyva/moodle into MOODLE_32_STABLE 2017-11-06 21:12:39 +01:00
Damyon Wiese da0bb6a820 Merge branch 'MDL-59858-32' of git://github.com/junpataleta/moodle into MOODLE_32_STABLE 2017-11-06 11:15:14 +08:00
Damyon Wiese 36043eacd3 Merge branch 'MDL-60437_32-multilang-html-block-titles' of https://github.com/lucaboesch/moodle into MOODLE_32_STABLE 2017-11-06 10:12:17 +08:00
Jun Pataleta 9434133480 MDL-59858 amd: Focus on the element that actually triggers the modal 2017-11-06 13:23:23 +13:00
AMOS bot 2e6b69cbca Automatically generated installer lang files 2017-11-05 00:06:23 +00:00
Luca Bösch a0ec6413d5 MDL-60437 blocks: HTML block title multilang 2017-11-03 16:37:13 +01:00
David Monllao 1d1086e3e5 weekly release 3.2.5+ 2017-11-03 10:25:12 +01:00
Juan Leyva 311076f3a2 MDL-60424 webservice: Allow CORS requests in webservice/upload.php
This will allow to upload files via Web Services using AJAX from
different domains, browser plugins, web apps, etc…
2017-11-03 09:42:00 +01:00
Jake Dallimore 107ea0f3c7 Merge branch 'MDL-58047-32-fix1' of http://github.com/damyon/moodle into MOODLE_32_STABLE 2017-11-03 16:11:19 +08:00
Damyon Wiese bd2c01bb9e MDL-58047 assign: submission sorting
Only exclude new submission records from the sorting, draft and reopened submission are valid.
2017-11-03 15:56:36 +08:00
David Monllao 0e7e457214 Merge branch 'MDL-58047-32-sortbysubmission' of https://github.com/roperto/moodle into MOODLE_32_STABLE 2017-11-02 16:58:05 +01:00
David Monllao 1e802bb449 Merge branch 'MDL-51945-32' of git://github.com/jleyva/moodle into MOODLE_32_STABLE 2017-11-02 16:55:51 +01:00
David Monllao 5bd85d7f4f Merge branch 'MDL-60634-32' of git://github.com/jleyva/moodle into MOODLE_32_STABLE 2017-11-02 13:26:12 +01:00
David Monllao ed76eb03f7 Merge branch 'MDL-60633-32' of git://github.com/andrewnicols/moodle into MOODLE_32_STABLE 2017-11-02 12:04:27 +01:00
David Monllao db1898291d Merge branch 'MDL-53501-32' of git://github.com/jleyva/moodle into MOODLE_32_STABLE 2017-11-02 08:30:57 +01:00
Jake Dallimore 2d56bc1c72 Merge branch 'MOODLE_32_STABLE_MDL-60007' of https://github.com/CengageEng/moodle into MOODLE_32_STABLE 2017-11-02 08:51:26 +08:00
Eloy Lafuente (stronk7) 2ba8535459 weekly release 3.2.5+ 2017-11-01 13:38:55 +01:00
Eloy Lafuente (stronk7) 88bbfa1dc2 Merge branch 'MDL-60503-32' of git://github.com/damyon/moodle into MOODLE_32_STABLE 2017-11-01 11:51:23 +01:00
Damyon Wiese c4c6e31630 MDL-60503 npm: Lock required node 8.9.x (LTS) 2017-11-01 14:54:03 +08:00
Daniel Thee Roperto f6db012818 MDL-58047 gradebook: fix sort by submission order. 2017-11-01 15:11:16 +11:00
Damyon Wiese d83e2ba4cd Merge branch 'MDL-52037-32-fix' of https://github.com/andrewnicols/moodle into MOODLE_32_STABLE 2017-11-01 11:15:44 +08:00
Andrew Nicols baab74b9d3 MDL-52037 theme: Correct question feedback width
This relates to the cloze question answer when hovered.
2017-11-01 11:13:52 +08:00
Vervoort, Claude 44b817cf60 MDL-60007 mod lti: allow delete without content-type 2017-10-31 09:58:54 -04:00
Juan Leyva 590706db1f MDL-60634 tool_mobile: Avoid CURL request to check HTTPS 2017-10-31 12:07:08 +01:00
David Monllao a7f16bb296 MDL-52037 theme: Update compiled css 2017-10-31 11:03:55 +01:00
Luca Bösch 042dd6335d MDL-52037 questions: „Whether correct“-feedback marks adaptive width 2017-10-31 10:44:00 +01:00
Jake Dallimore 0bd1bd92dc Merge branch 'MDL-60607_32' of git://github.com/timhunt/moodle into MOODLE_32_STABLE 2017-10-31 13:00:19 +08:00
Jun Pataleta c03a53e8d8 Merge branch 'MDL-57560-32' of git://github.com/damyon/moodle into MOODLE_32_STABLE 2017-10-31 15:41:40 +13:00
Andrew Nicols 267a719a17 Merge branch 'MDL-60139_32' of git://github.com/timhunt/moodle into MOODLE_32_STABLE 2017-10-31 09:16:10 +08:00
Andrew Nicols eaea57597c Merge branch 'MDL-60522-32' of https://github.com/Kathrin84/moodle into MOODLE_32_STABLE 2017-10-31 08:21:26 +08:00
Andrew Nicols 0dc5bfa27e MDL-60633 core: Add pendingjs checks for inplace editable 2017-10-31 07:05:06 +08:00
Tim Hunt b18cde3450 MDL-60607 quiz reports: catch separate groups & user has no group case 2017-10-30 17:58:25 +00:00
Tim Hunt a0b2649a16 MDL-60607 quiz reports: move duplicate code to superclass method 2017-10-30 17:58:23 +00:00
David Monllao 9a11ca8fd6 Merge branch 'MDL-60528-m32' of https://github.com/micaherne/moodle into MOODLE_32_STABLE 2017-10-30 17:59:48 +01:00
Juan Leyva 7ec9a6daa7 MDL-51945 core_user: Prevent duplicated emails in update_users WS 2017-10-30 17:42:34 +01:00
David Monllao ee461eee7f Merge branch 'MDL-52037_32-cloze-whether-correct-feedback-width' of https://github.com/lucaboesch/moodle into MOODLE_32_STABLE 2017-10-30 16:06:17 +01:00
Juan Leyva 55711a938a MDL-53501 webservice: Avoid values higher than PHP_INT_MAX
Integers coming from site settings needs casting to int to avoid
returning values higher than PHP_INT_MAX.
2017-10-30 16:04:39 +01:00
Michael Aherne c860ca5c91 MDL-60528 grading: Accurate class names in PHPDoc 2017-10-30 14:31:04 +00:00
Tim Hunt 828a24f784 MDL-60139 question manual grading: move code to reduce confusion
Move the variable definition closer to where it is used.
2017-10-30 12:58:26 +00:00
Tim Hunt 78e92b3fb1 MDL-60139 question manual grading: redisplay mark as typed if editing
When the teacher is upgrading a previously entered grade, we re-display
exactly what they typed before if possible, rather than displaying with
a set number of decimal places.
2017-10-30 12:58:24 +00:00
Tim Hunt 48dbf89252 MDL-60139 phpunit: Make assertTag verify attribute values with ===
I had a test that cared about the difference between value="5.0" and value="5".
2017-10-30 12:58:22 +00:00
David Monllao 83d284be42 Merge branch 'MDL-60377-32' of git://github.com/jleyva/moodle into MOODLE_32_STABLE 2017-10-30 11:42:55 +01:00
Luca Bösch 263528b0d8 MDL-52037 questions: „Whether correct“-feedback marks adaptive width 2017-10-30 10:41:16 +00:00
Kathrin Osswald 966c52eb3d MDL-60522 message: Removed additional tooltips
I removed the additional tooltips because I think that they are just used
in the notifications and messages context and duplicate the all over used
title tag that gives the same information when hovering. So the whole system
stays more consistently.
2017-10-30 08:04:08 +01:00
Damyon Wiese 438da5c13b MDL-57560 boost: File upload progress
Copy / adapt some styles from the bootstrap progress widget to match the DOM used for file upload progress.

Bootstrap changed this alot in the current beta so I opted to do a minimal change (affect the scss for boost only), rather
than adapt the HTML to something that will change again anyway when we upgrade to the release version of bootstrap 4.
2017-10-30 13:14:04 +08:00
Jake Dallimore bc299c8d4d Merge branch 'MDL-59606_32' of git://github.com/timhunt/moodle into MOODLE_32_STABLE 2017-10-30 11:24:03 +08:00
Andrew Nicols 29e276eeea Merge branch 'MDL-60605-32' of https://github.com/dvdcastro/moodle into MOODLE_32_STABLE 2017-10-30 10:51:54 +08:00
Andrew Nicols 4c28e8abe3 Merge branch 'MOODLE_32_STABLE_MDL-60360_enable_file_indexing_retroactively' of https://github.com/mattporritt/moodle into MOODLE_32_STABLE 2017-10-30 09:21:27 +08:00
Jun Pataleta 570b297303 Merge branch 'MDL-60572-32' of git://github.com/jleyva/moodle into MOODLE_32_STABLE 2017-10-30 10:26:05 +13:00
David Castro 261af24e61 MDL-60605 assignment: Added some styles to fix spacing in YUI file tree 2017-10-27 11:05:25 -05:00
Tim Hunt 20df9e8faa MDL-59606 quiz responses: fix edge cases in the report
This patch conbines valuable contributions from Kashmira Nagwekar and
Luca Bösch. Many thanks to them. However, the final form of the fix,
and hence the blame, falls to me -- Tim.

There were several issues here:

* The load_questions_usages_by_activity method in
  question/engine/datalib.php was incorrectly treating the case
  when no data was returned. (Looks like a historic copy-pase from
  other methods that fetch one item by unique id, which therefore
  must exist.)

* The report was not correctly handling the display when the 'Which
  tries' was set to 'with, and without, attempts'.

* It was possible to select the 'All tries' option when also saying
  'Users without attempts'. This combination makes not sense, so
  a disabledIf rule was added to the form.
2017-10-27 16:57:34 +01:00
David Monllao 14f2ce60a7 weekly release 3.2.5+ 2017-10-27 12:48:27 +02:00
Juan Leyva 00c2d21bab MDL-60572 admin: Fix forgottenpasswordurl for WS
We should expect URLs in that field.
The tool_mobile change is to not break the WS response if
forgottenpasswordurl does not contain a URL.
2017-10-27 10:48:54 +02:00
Matt Porritt ba3904e81b MDL-60360 Global Search: Enable file indexing message update.
If you have Global Search set up on a site without file
indexing enabled, then at a later date you enable file indexing
files associated with existing objects are not added.

The only way to have files for existing objects indexed is to
run a reindex of all content.

This patches updates the file indexing language string in the
solr search settings of Global Search to make this clear
to the site administrator.
2017-10-27 11:16:35 +11:00
Jun Pataleta 6e90b081c2 Merge branch 'MDL-60265-32' of git://github.com/jleyva/moodle into MOODLE_32_STABLE 2017-10-27 11:52:47 +13:00
David Monllao 1a4b29ae88 Merge branch 'wip-MDL-57055-32' of git://github.com/abgreeve/moodle into MOODLE_32_STABLE 2017-10-26 19:18:05 +02:00
Juan Leyva b627bcfd25 MDL-60265 tool_mobile: Return sitepolicy in tool_mobile_get_config WS 2017-10-26 11:05:51 +02:00
Damyon Wiese 8e378ca989 Merge branch 'MDL-60366_feedback_upgrade_32' of git://github.com/davosmith/moodle into MOODLE_32_STABLE 2017-10-26 15:41:02 +08:00
Andrew Nicols 41c8216718 Merge branch 'wip-MDL-60543-32' of git://github.com/marinaglancy/moodle into MOODLE_32_STABLE 2017-10-26 14:35:12 +08:00
Andrew Nicols ad80abc65c Merge branch 'MDL-60162_32' of git://github.com/timhunt/moodle into MOODLE_32_STABLE 2017-10-26 14:07:51 +08:00
Adrian Greeve 40be01a636 MDL-57055 mod_label: Add label administration for boost.
This patch adds the label adminstration settings to the
label edit page.
2017-10-26 13:58:57 +08:00
Andrew Nicols 5b497b1bde Merge branch 'MDL-60535_32-questionbank-button-styled' of https://github.com/lucaboesch/moodle into MOODLE_32_STABLE 2017-10-26 13:19:24 +08:00
Andrew Nicols fc6209584d Merge branch 'MOODLE_32_MDL-51892' of https://github.com/fwsl/moodle into MOODLE_32_STABLE 2017-10-26 11:31:06 +08:00
Jake Dallimore 3a3198767c Merge branch 'MDL-59686-32' of git://github.com/lameze/moodle into MOODLE_32_STABLE 2017-10-26 10:20:30 +08:00
Simey Lameze f94376bfc4 MDL-59686 form: fix autosave support for editor field 2017-10-26 09:05:00 +08:00
Jun Pataleta 086815b1d6 Merge branch 'MDL-60571_32-manualgrading-savegotonextpage-styled' of https://github.com/lucaboesch/moodle into MOODLE_32_STABLE 2017-10-26 10:04:01 +13:00
David Monllao 5a03d41860 Merge branch 'MDL-60538-32' of https://github.com/mihailges/moodle into MOODLE_32_STABLE 2017-10-25 15:09:50 +02:00
David Monllao 470a2e32fa weekly release 3.2.5+ 2017-10-25 11:13:48 +02:00
David Monllao 1a58e38ea2 Merge branch 'install_32_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_32_STABLE 2017-10-25 11:13:47 +02:00
Andrew Nicols 3e2732fbc7 Merge branch 'MDL-36580_32' of https://github.com/stronk7/moodle into MOODLE_32_STABLE 2017-10-25 12:19:14 +08:00
Andrew Nicols 494d18b16a Merge branch 'MDL-36580_32' of https://github.com/stronk7/moodle into MOODLE_32_STABLE 2017-10-25 12:19:14 +08:00
Mihail Geshoski 6b818f0534 MDL-60538 lesson: check if max attempts exceeded, use new lang string 2017-10-25 09:11:26 +08:00
Eloy Lafuente (stronk7) cf3ee0a406 MDL-36580 backup: Avoid PHP notice restoring old backups
Before this implementation, both resourcekey and password
were not being included in the backups, so old backups are
missing them. To keep upwards compatibility and avoid a PHP
Notice (undefined property), existence is checked via isset(),
that is the usual way all over the restore process.
2017-10-24 23:03:29 +02:00
Tim Hunt 4635a07e6a MDL-60162 quiz reports: refactor duplicated code into the base class
This is needed to fix the unit test in the last commit.
2017-10-24 18:14:41 +01:00
Tim Hunt 661e129873 MDL-60162 quiz reports: too many rows fetched on download
This happened if one user had multiple enrolments in a course, and was
quite inefficient.
2017-10-24 18:14:39 +01:00
AMOS bot 6644d7328e Automatically generated installer lang files 2017-10-25 00:06:15 +08:00
Luca Bösch d969814e09 MDL-60535 quiz: question bank button styled 2017-10-24 16:09:26 +01:00
Luca Bösch a00083a947 MDL-60571 quiz: Manual grading Save and go to next page button styled 2017-10-24 12:17:48 +01:00
Grzegorz Ziółek 858fd41248 MDL-51892 logging: Proper description of login errors. 2017-10-24 10:56:53 +02:00
Davo Smith c69f396769 MDL-60366 mod_feedback: fix deletion of valid anonymous duplicates 2017-10-24 09:38:06 +01:00
Andrew Nicols 8fa79442fd MDL-57477 session: Comment tidyup 2017-10-24 08:23:22 +08:00
Andrew Nicols 03488ecc9c Merge branch 'MDL-57477_32' of https://github.com/appalachianstate/moodle into MOODLE_32_STABLE 2017-10-24 08:13:37 +08:00
Fred Woolard c4bb09b742 MDL-57477 core: If memcached 3.x mimic 2.2.0 lock acquisition behavior 2017-10-23 13:49:01 -04:00
David Monllao 0b3e013f64 Merge branch 'MDL-60527_32-action-menu-links-missing-spaces-attributes' of https://github.com/lucaboesch/moodle into MOODLE_32_STABLE 2017-10-23 16:59:31 +02:00
Andrew Nicols fde74736a4 MDL-60489 javascript: Add missing promise fails 2017-10-23 20:32:01 +08:00
Andrew Nicols 17b978cd90 Merge branch 'MDL-60489-32' of git://github.com/ryanwyllie/moodle into MOODLE_32_STABLE 2017-10-23 20:30:50 +08:00
Eloy Lafuente (stronk7) 73728cb33e Merge branch 'm32_MDL-59100_MySQL8_INFORMATION_SCHEMAs_Need_Lowercasing' of https://github.com/scara/moodle into MOODLE_32_STABLE 2017-10-23 12:11:15 +02:00
Ryan Wyllie 9f021bd587 MDL-60489 javascript: add animations to modal setBody 2017-10-23 08:12:05 +00:00
Marina Glancy 43f269a3d8 MDL-60543 env: Moodle 3.2 and 3.3 do no support PHP7.2 2017-10-23 14:16:57 +08:00
Damyon Wiese 8caec2eb7a Merge branch 'MDL-52653-32' of http://github.com/damyon/moodle into MOODLE_32_STABLE 2017-10-23 13:20:02 +08:00
Damyon Wiese a1dee21ec1 MDL-52653 scorm: Comment for cms.completion_status 2017-10-23 13:12:56 +08:00
Christian Lawson-Perfect 56df23be4f MDL-52653 SCORM: fix scorm_check_mode on v1.3
SCORM 2004 uses the element 'cmi.completion_status' to store the
completion status of a SCO, not 'cmi.core.lesson_status'.

This amends scorm_check_mode so that the right element is looked up.

When scorm_version_check returns false, SCORM 1.2 is assumed.
2017-10-23 13:12:55 +08:00
Luca Bösch 1712134d00 MDL-60527 templates: missing spaces round attribute and aria-labelledby 2017-10-22 22:55:56 +01:00
Matteo Scaramuccia 71db3b4410 MDL-59100 dml: Lower the case of INFORMATION_SCHEMA.* fields. 2017-10-21 14:35:59 +02:00
Eloy Lafuente (stronk7) b8e10f239b weekly release 3.2.5+ 2017-10-20 23:54:56 +02:00
Andrew Nicols a3b0fce39c Merge branch 'MDL-60456-32' of git://github.com/damyon/moodle into MOODLE_32_STABLE 2017-10-20 10:29:24 +08:00
David Monllao 1b0d340042 Merge branch 'MDL-60123-32' of https://github.com/snake/moodle into MOODLE_32_STABLE 2017-10-20 02:22:43 +02:00
Eloy Lafuente (stronk7) 81b900a2f2 Merge branch 'MDL-60342-32' of https://github.com/patkira/moodle into MOODLE_32_STABLE 2017-10-19 23:25:13 +02:00
Eloy Lafuente (stronk7) 4c3d434cb4 Merge branch 'wip-MDL-60314-32' of git://github.com/marinaglancy/moodle into MOODLE_32_STABLE 2017-10-19 23:19:36 +02:00
Eloy Lafuente (stronk7) 8835fd01c5 Merge branch 'MDL-60449-32-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_32_STABLE 2017-10-19 22:21:37 +02:00
Helen Foster a57c2774e8 MDL-60449 lang: Merge English strings from the en_fix language pack
Significant string changes:

* errorretrievingkey in message_airnotifier - improved wording and
  removing reference to Moodle.org
* enddate_help and courseduration_desc in core - clearer wording
  explaining what the date actually does
* restore:viewautomatedfilearea in core_role - changing wording to match
  the behaviour
* dropzones_help in qtype_ddmarker - improved wording
* autologinkeygenerationlockout in tool_mobile - updated error message
* configallowemailaddresses in core_admin - clearer description
* subscriptionmode_helpin mod_forum - removing misleading sentence about
  subscription mode changes not affecting existing users
2017-10-19 18:16:51 +02:00
David Monllao 9a4fbd4574 Merge branch 'wip-MDL-58915-32' of git://github.com/marinaglancy/moodle into MOODLE_32_STABLE 2017-10-19 15:44:43 +02:00
David Monllao 4270255272 Merge branch 'MDL-60233-32' of git://github.com/jleyva/moodle into MOODLE_32_STABLE 2017-10-19 13:52:23 +02:00
Nadav Kavalerchik 778d746f6c MDL-60182 Glossary: Fix print icon label in RTL mode 2017-10-19 13:40:42 +02:00
David Monllao 4e41d6c56f Merge branch 'MDL-60469-32' of git://github.com/andrewnicols/moodle into MOODLE_32_STABLE 2017-10-19 10:56:01 +02:00
David Monllao 04b1f4254e Merge branch 'MDL-60247_32-multilang-html-glossary-block-titles' of https://github.com/lucaboesch/moodle into MOODLE_32_STABLE 2017-10-19 10:34:54 +02:00
Eloy Lafuente (stronk7) d58ae0c075 MDL-36580 backup: Apply the decrypt() method to lti "secrets" 2017-10-19 10:20:21 +02:00
Eloy Lafuente (stronk7) dab2233925 MDL-36580 backup: General support for decrypted contents in restore
- Uses site generated (on backup) key.
- Can be applied potentially everywhere in the restore process.
- Covered with unit tests.
- Authentication / integrity aware so can be used between any 2 servers
  (just requires matching key).
2017-10-19 10:20:21 +02:00
Eloy Lafuente (stronk7) 370f78715e MDL-36580 backup: Use the encrypted_final_element for lti "secrets" 2017-10-19 10:20:21 +02:00
Eloy Lafuente (stronk7) 6c436ac37e MDL-36580 backup: General support for encrypted contents in backups
- Built using standard backup custom fields.
- Can be applied potentially everywhere.
- Automatically addded 'encrypted' attribute.
- Defaults to site generated key.
- Enforces key robutness / provides authentication (hmac integrity)
- Covered with unit tests.
2017-10-19 10:20:18 +02:00
Andrew Nicols 6df049fa3c MDL-60469 behat: Replace I press with I click on 2017-10-19 11:59:44 +08:00
Damyon Wiese c7813fa674 MDL-60456 javascript: Rebuild npm-shrinkwrap
Build npm-shrinkwrap with the latest node version and only test the latest node version on travis.
2017-10-19 11:53:17 +08:00
Jun Pataleta 61a96642f0 Merge branch 'wip-MDL-60335-32' of git://github.com/marinaglancy/moodle into MOODLE_32_STABLE 2017-10-19 15:37:37 +13:00
Jun Pataleta 09b1711d94 Merge branch 'mdl59843-moodle32' of https://github.com/tlock/moodle into MOODLE_32_STABLE 2017-10-19 13:20:19 +13:00
Eloy Lafuente (stronk7) 0fe0954344 weekly release 3.2.5+ 2017-10-19 00:11:06 +02:00
Eloy Lafuente (stronk7) f6d4edd3aa Merge branch 'install_32_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_32_STABLE 2017-10-19 00:11:04 +02:00
Pat Kira 18f5851994 MDL-60342 test: Reset user agent after tests
- Add a test that proves this useragent is not being reset after a test
- Reset user agent
2017-10-18 13:59:17 +11:00
Marina Glancy b9fef33112 MDL-60335 admin: fix encoding of nonlatin site names in blocked hosts 2017-10-17 12:59:39 +08:00
Jake Dallimore 0730e8a380 Merge branch 'wip-MDL-60033-32' of git://github.com/marinaglancy/moodle into MOODLE_32_STABLE 2017-10-16 15:37:24 +08:00
Jake Dallimore cdd836011f MDL-60123 assign: Allow teachers to deselect pdf annotations in editpdf
Clicking a blank area of the canvas will now deselect any currently
selected annotation.
2017-10-16 08:45:33 +08:00
AMOS bot c9b29b832b Automatically generated installer lang files 2017-10-14 00:08:45 +08:00
Luca Bösch d93d2a0d86 MDL-60247 blocks: Multilang in Random glossary and in HTML block titles. 2017-10-13 13:52:50 +02:00
Jake Dallimore ef89f89988 weekly release 3.2.5+ 2017-10-13 14:33:13 +08:00
Jake Dallimore fe53da02a3 Merge branch 'install_32_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_32_STABLE 2017-10-13 14:33:12 +08:00
Marina Glancy 0233c84101 MDL-58915 search_solr: connection to solr can use blocked hosts 2017-10-13 12:18:15 +08:00
Jake Dallimore c3b3d04ca6 Merge branch 'MDL-60357-32-fix' of https://github.com/andrewnicols/moodle into MOODLE_32_STABLE 2017-10-13 11:40:46 +08:00
Andrew Nicols 59dd0cc761 MDL-60357 search: Ensure that the document is valid
We were previously testing tha the parent is valid, which it was, and
then fetching the current record, before fetching data from it.

However, the way in which the recordset walk works, the valid function
checks whether the _record_ itself is valid, whilst the current allows
for a callback to be applied.

In this instance, the data-entry was failing because the count of
indexfields was < 2. The recordset data itself was valid, but the view
was not, and as a result, the current() function returned false.

This false was not previously handled.

I've changed the logic so that we handle this case, and have removed a
double-negative in the process.
2017-10-13 09:46:43 +08:00
Jun Pataleta 7fa35eca49 Merge branch 'MDL-59854-32' of git://github.com/junpataleta/moodle into MOODLE_32_STABLE 2017-10-12 12:28:24 +08:00
Tobias Reischmann cf266bd3e2 MDL-59854 forum: Created unique db key for forum_subscriptions
Due to race conditions in the function subscribe_user
it was possible to create duplicate forum subscriptions.
This lead to error messages, when displaying the list of
all subscriptions.
This patch removes all existing duplicate entries and
creates a unique db key to prevent this from happening in
the future.
2017-10-12 12:19:21 +08:00
Eloy Lafuente (stronk7) 6b0bf399e2 Merge branch 'MDL-60357-m32' of https://github.com/sammarshallou/moodle into MOODLE_32_STABLE 2017-10-11 20:50:11 +02:00
Andrew Nicols fb00e2dc97 Merge branch 'MOODLE_32_STABLE_MDL-60276' of https://github.com/CengageEng/moodle into MOODLE_32_STABLE 2017-10-11 09:41:00 +08:00
Eloy Lafuente (stronk7) abfaf22dfb Merge branch 'MDL-60300-m32' of https://github.com/NeillM/moodle into MOODLE_32_STABLE 2017-10-11 01:40:13 +02:00
Eloy Lafuente (stronk7) 69865a1de3 Merge branch 'MDL-60346-m32' of https://github.com/sammarshallou/moodle into MOODLE_32_STABLE 2017-10-11 01:13:57 +02:00
Eloy Lafuente (stronk7) 66ccbfeb99 Merge branch 'MDL-60364-m32' of https://github.com/NeillM/moodle into MOODLE_32_STABLE 2017-10-11 01:00:48 +02:00
Juan Leyva 19bda8aa7e MDL-60377 webservice: Format correctly text returned by WS 2017-10-10 15:17:12 +02:00
AMOS bot e17f45f120 Automatically generated installer lang files 2017-10-10 00:12:25 +08:00
Andrew Nicols c63b1749ba Merge branch 'MDL-60317_32' of git://github.com/timhunt/moodle into MOODLE_32_STABLE 2017-10-09 14:10:44 +08:00
Marina Glancy 6f7bff5aa9 MDL-60314 navigation: fix overriding variable value 2017-10-09 10:19:18 +08:00
sam marshall 68049f376f MDL-60357 core_search: Future modified times cause serious problems 2017-10-06 14:16:54 +01:00
Neill Magill cf97659678 MDL-60300 Quiz: Offline update time not set correctly 2017-10-06 13:30:50 +01:00
Neill Magill 6a74606965 MDL-60364 Web service: E_ERROR in course_check_updates web service
The error stated that course_check_updates() is undefined, this function
is in the course lib.php file.
2017-10-06 13:30:31 +01:00
sam marshall 4d286aa730 MDL-60346 core_search: Solr connection ignores proxy settings 2017-10-06 11:41:28 +01:00
Jake Dallimore ff93f3915a weekly release 3.2.5+ 2017-10-06 14:34:34 +08:00
Jake Dallimore 95b73b0858 Merge branch 'install_32_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_32_STABLE 2017-10-06 14:34:33 +08:00
Jake Dallimore 3c051e549a Merge branch 'MDL-57228_32' of git://github.com/timhunt/moodle into MOODLE_32_STABLE 2017-10-04 13:45:45 +08:00
Eloy Lafuente (stronk7) e4b90ebdab Merge branch 'MDL-59882-32' of git://github.com/andrewnicols/moodle into MOODLE_32_STABLE 2017-10-03 20:52:14 +02:00
Eloy Lafuente (stronk7) 939b9ab977 Merge branch 'MDL-60198-32' of git://github.com/jleyva/moodle into MOODLE_32_STABLE 2017-10-03 20:16:09 +02:00
AMOS bot 2b3ebab6dd Automatically generated installer lang files 2017-10-04 00:10:47 +08:00
Andrew Nicols a5fc11023b Merge branch 'MDL-60210-32-upgradecheck' of git://github.com/mudrd8mz/moodle into MOODLE_32_STABLE 2017-10-03 10:34:05 +08:00
Tim Hunt 2923e19928 MDL-60317 quiz reports: fix regression caused by MDL-57511 2017-10-02 18:24:56 +01:00
Andrew Nicols c26afb9b76 Merge branch 'MDL-58790_32' of git://github.com/timhunt/moodle into MOODLE_32_STABLE 2017-10-02 15:40:41 +08:00
Andrew Nicols ac5e3e9c6b MDL-59882 behat: Update known uses of dialogue CSS 2017-10-02 12:50:41 +08:00
Andrew Nicols a9739a84dc MDL-59882 behat: Add newer modal type to selectors 2017-10-02 12:50:41 +08:00
Andrew Nicols 4b1402490a Merge branch 'MDL-60306-32' of git://github.com/junpataleta/moodle into MOODLE_32_STABLE 2017-10-02 10:17:44 +08:00
Jun Pataleta 3ee60271fa MDL-60306 calendar: Fix rrule_manager unit test
* The calculation of the expected date should depend on the comparison
with the start date's date and not it's exact timestamp.
2017-10-02 09:18:57 +08:00
ddelblanco 579b44ef14 MDL-60276 LTI Content Item: does not populate tool url when https 2017-09-28 09:51:58 -07:00
AMOS bot 76fd4da35d Automatically generated installer lang files 2017-09-29 00:06:26 +08:00
Jake Dallimore c2d1467a7d weekly release 3.2.5+ 2017-09-28 14:27:27 +08:00
Tim Lock 6eb39155d4 MDL-59843 mod_choice: Fix horizontal display mode
This re-implements the feature in the boost and bootstrap themes.
2017-09-28 12:29:05 +10:00
Eloy Lafuente (stronk7) b3b909e1b4 Merge branch 'MDL-60243-32' of https://github.com/snake/moodle into MOODLE_32_STABLE 2017-09-27 20:48:48 +02:00
Jake Dallimore 77917ed26b Merge branch 'MDL-59780-32' of git://github.com/ankitagarwal/moodle into MOODLE_32_STABLE 2017-09-27 13:44:16 +08:00
Ankit Agarwal 1da8d303ef MDL-59780 mathjax: Make sure mathjax url doesn't become empty 2017-09-27 09:16:11 +05:30
Jake Dallimore 6d01904503 MDL-60243 competencies: fix ordering bug in api_test unit test
list_user_competencies_to_review() orders by shortname, but the test
creates 2 user competencies with the same short name, resulting in
unpredictable results. This patch fixes that.
2017-09-27 09:28:36 +08:00
Eloy Lafuente (stronk7) fe6903b33f Merge branch 'MDL-59931_32_STABLE' of https://github.com/ctam/moodle into MOODLE_32_STABLE 2017-09-27 01:16:26 +02:00
Eloy Lafuente (stronk7) 1dbe5c038e Merge branch 'MDL-59220-32' of git://github.com/damyon/moodle into MOODLE_32_STABLE 2017-09-27 00:52:20 +02:00
Juan Leyva c457cf5d35 MDL-60198 webservice: Add missing MOODLE_INTERNAL checks 2017-09-26 23:04:51 +02:00
Eloy Lafuente (stronk7) 4495103f17 Merge branch 'MDL-59645-32-flickr' of git://github.com/mudrd8mz/moodle into MOODLE_32_STABLE 2017-09-26 19:35:39 +02:00
Tim Hunt ce7cb88198 MDL-58790 quiz editing: translate hard-coded new heading string 2017-09-26 11:18:28 +01:00
Juan Leyva 67ad699c28 MDL-60233 mod_assign: Avoid HTML in the item field of external warnings
The item field is defined as PARAM_TEXT (no HTML tags allowed except
for multilang).
Using the s that add quotes to HTML characters we avoid potential Web
Services invalid parameters errors.
2017-09-26 12:13:40 +02:00
Andrew Nicols d94ac2bfbc Merge branch 'MDL-60141-32' of git://github.com/jleyva/moodle into MOODLE_32_STABLE 2017-09-26 15:48:46 +08:00
Jake Dallimore 3a1a441a7b Merge branch 'MDL-60121-multi-enrol-backup-MOODLE_32_STABLE' of https://github.com/mpetrowi/moodle into MOODLE_32_STABLE 2017-09-26 15:25:42 +08:00
Juan Leyva 7b7f45307a MDL-60141 auth_email: Fix sitepolicy field type in get_signup_settings 2017-09-26 09:11:27 +02:00
Simey Lameze 5f3cb3de39 MDL-60052 theme_bootstrapbase: proper handling of large modals 2017-09-26 11:21:28 +08:00
Andrew Nicols 1284339766 Merge branch 'MDL-60052-32' of https://github.com/xow/moodle into MOODLE_32_STABLE 2017-09-26 09:31:38 +08:00
Andrew Nicols b1517ff214 Merge branch 'MOODLE_32_STABLE' of https://github.com/ConnorSheremeta/moodle into MOODLE_32_STABLE 2017-09-26 09:26:34 +08:00
Carson Tam e9f31bb710 MDL-59931 mod_quiz: Fixing incorrect pagination count. 2017-09-25 12:51:58 -07:00
Eloy Lafuente (stronk7) 0c95cbef53 Merge branch 'wip-MDL-60167-32' of git://github.com/marinaglancy/moodle into MOODLE_32_STABLE 2017-09-25 20:19:50 +02:00
Shamim Rezaie c4a970c345 MDL-57228 quiz editing: unit test for the move case 2017-09-25 12:55:27 +01:00
Tim Hunt 0525300ebc MDL-57228 quiz: fix editing when there are one-question sections
Fix based on a patch by Joost van der Borg <j.van.der.borg@ssr.nl>.
2017-09-25 12:55:26 +01:00
Marina Glancy 930ef87ff8 MDL-60167 upgrade: Fix duplicate site registrations 2017-09-24 18:53:23 +08:00
Dan Poltawski 469c46aa3a weekly release 3.2.5+ 2017-09-22 12:43:15 +01:00
Dan Poltawski facf5f3b6f Merge branch 'install_32_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_32_STABLE 2017-09-22 12:43:13 +01:00
David Mudrák f4ef37425a MDL-60210 admin: Check if the site needs upgrade on admin/search.php too
The page admin/search.php is the default administration page in Boost
based themes. It should behave the same as admin/index.php or
my/index.php and check if the site needs upgrade.
2017-09-22 13:24:18 +02:00
Jun Pataleta c27af3af45 Merge branch 'MDL-37810-32-fix' of https://github.com/snake/moodle into MOODLE_32_STABLE 2017-09-22 10:55:06 +08:00
Ryan Wyllie 9648379ea2 MDL-60052 javascript: fix large styling for modals 2017-09-22 10:03:45 +08:00
Damyon Wiese 074034db86 MDL-59220 setuplib: Redirect on https mismatch
When the wwwroot indicates https support and a page is accessed over http,
redirect to the wwwroot. This is a better experience than displaying an error.

Backport of MDL-58318.
2017-09-22 09:48:35 +08:00
AMOS bot 9c65fc25cb Automatically generated installer lang files 2017-09-22 00:08:32 +08:00
AMOS bot 74b092ca47 Automatically generated installer lang files 2017-09-22 00:08:31 +08:00
Jake Dallimore 9cd7403fe6 MDL-37810 roles: fix profile roles logic to include all roles
If the user has the role:assign capability then the list of profile roles
will include any role assigned in the context or above.
2017-09-21 22:27:42 +08:00
AMOS bot e667a98f86 Automatically generated installer lang files 2017-09-21 00:06:31 +08:00
Eloy Lafuente (stronk7) d016049dc9 Merge branch 'MDL-60132-32' of git://github.com/jleyva/moodle into MOODLE_32_STABLE 2017-09-19 22:38:56 +02:00
David Mudrák 82aab5855c MDL-59645 flickrlib: Show debug notice when using legacy authentication 2017-09-19 14:45:44 +02:00
David Mudrák 38bd68868d MDL-59645 portfolio_flickr: Make the Flickr portfolio export work again
The patch modifies the Flickr portfolio to make it use of the new oauth1
based client.
2017-09-19 14:45:44 +02:00
David Mudrák df61d236f5 MDL-59645 repository_flickr: Drop legacy auth tokens and nsids
The values stored in these user preferences were valid for the old
flickr auth mechanism and are not usable any more. The new oauth1 based
version needs to store both the token (in the flickr_access_token
preference) and the token secret (flickr_access_token_secret). The new
version does not need to store the user's nsid.

The cryptic names of these legacy settings are a result of how dealing
with user preferences was originally implemented.
2017-09-19 14:45:44 +02:00
David Mudrák 6c0671bbf0 MDL-59645 repository_flickr: Make the Flickr repository work again
The patch makes the Flickr repository use the new oauth1 based client.
Beside that, other improvements include:

* Does not attempt to guess the photo URL any more. Instead uses
  url_sq and url_o extras of the flickr.photos.search call.
* The photos.search does not return the information about the photo size
  so we set it to null (previously was returned as 'unknown' which made
  it be displayed as zero).
* Does not perform additional API request to obtain the manage URL, uses
  https://www.flickr.com/photos/organize instead.
2017-09-19 14:45:44 +02:00
David Mudrák a7c710c1b8 MDL-59645 oauth1: Implement a new simple Flickr API client
Flickr has switched over to OAuth 1.0 based authentication. This is a
simple client allowing Moodle to perform authenticated calls to the
Flickr API.
2017-09-19 14:45:44 +02:00
David Mudrák a247bf678e MDL-59645 oauth1: Improve reporting of token errors
Provide a more meaningful error message and debuginfo allowing to
diagnose what is going on. In case of flickr, this is typically thrown
when flickr API responses with their "bad, bad panda" HTML page instead
of the expected reply.
2017-09-19 14:45:44 +02:00
David Mudrák c51c6351b3 MDL-59645 oauth1: Pass oauth_callback only to obtain the request token
As per the oauth1 spec, the oauth_callback is supposed to be passed only
when obtaining the initial request token. The client used to append it
automatically to all requests which broke the request signature.
2017-09-19 14:45:44 +02:00
Matt Petro 5b9fc0b69b MDL-60121 enrol: Fix enrol plugin backup
Allow more than one enrol plugin to add backup structure.
2017-09-19 07:05:48 -04:00
Jun Pataleta a1a2903db4 Merge branch 'MDL-60048-32' of https://github.com/Kathrin84/moodle into MOODLE_32_STABLE 2017-09-19 17:21:02 +08:00
Dan Poltawski 821c414049 Merge branch 'MDL-60018-32' of git://github.com/jleyva/moodle into MOODLE_32_STABLE 2017-09-19 07:28:08 +01:00
Eloy Lafuente (stronk7) 2904e5e987 Merge branch 'MDL-60105_32' of git://github.com/dmonllao/moodle into MOODLE_32_STABLE 2017-09-19 01:56:54 +02:00
Eloy Lafuente (stronk7) 2337e280cf Merge branch 'MDL-52131-32' of git://github.com/andrewnicols/moodle into MOODLE_32_STABLE 2017-09-19 01:54:02 +02:00
Eloy Lafuente (stronk7) f5a1435789 Merge branch 'MDL-37810-32' of https://github.com/snake/moodle into MOODLE_32_STABLE 2017-09-19 01:49:20 +02:00
Eloy Lafuente (stronk7) 335f04772b Merge branch 'MDL-53244_32_STABLE' of git://github.com/Chocolate-lightning/moodle into MOODLE_32_STABLE 2017-09-19 01:43:52 +02:00
Jake Dallimore cb617fa262 MDL-37810 roles: added manager case to test_get_user_roles_in_course()
Managers can assign managers, and should be able to see that role on
the course profile page, as a link to the participants page.
2017-09-18 10:22:54 +08:00
Jun Pataleta d19291fbf3 Merge branch 'MDL-59994-32' of git://github.com/lameze/moodle into MOODLE_32_STABLE 2017-09-18 09:09:28 +08:00
Jake Dallimore 7fb6fdf6a7 MDL-37810 roles: get_user_roles_in_course returns all relevant roles
Fixed to return both those roles in the profileroles site policy and
any roles which the current user can assign in the respective context,
meaning a user can see a link to any role they can assign.
2017-09-18 09:01:50 +08:00
Jake Dallimore d4fd2325fe MDL-37810 roles: unit tests for get_profile_roles() 2017-09-18 09:01:50 +08:00
Jake Dallimore d549a9d973 MDL-37810 roles: fix get_profile_roles() so it returns assignable roles 2017-09-18 09:01:50 +08:00
Simey Lameze 437a07a572 MDL-59994 core_competency: improve unit test to cover deleted users 2017-09-18 08:34:33 +08:00
Simey Lameze c225ebf975 MDL-59994 core_competency: dont list competencies from deleted users 2017-09-18 08:34:33 +08:00
Dan Poltawski cc60733069 weekly release 3.2.5+ 2017-09-15 08:49:26 +01:00
Dan Poltawski 7e364756ae Merge branch 'install_32_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_32_STABLE 2017-09-15 08:49:25 +01:00
Kathrin Osswald 43d4117912 MDL-60048 theme_boost: Center logo within the navbar
My solution is to remove the padding that's added within scss/bootstrap/_navbar.scss (line 72)
for the case that a logo (has-logo) is uploaded and displayed within the navbar.
Removing this padding will center the image within the navbar.
2017-09-14 14:01:03 +02:00
Juan Leyva 3a960acf1e MDL-60132 tool_mobile: Handle correctly moodle_url instances
In Moodle there are some functions that can be overridden by themes.
Some themes are returning incorrect value types in those functions
2017-09-14 12:18:08 +02:00
Juan Segarra Montesinos 3e55e065fe MDL-52131 qbehaviour: respect manualcomment format
The format of a manual comment in a question is respected when
the preferred editor is "Plain text area".
2017-09-14 13:31:30 +08:00
Matt Clarkson 856fa58440 MDL-60105 mod_folder: Set timemodified on change
Changes to the folder contents were not resulting in the
timemodied of the folder activity being set. This prevented
global search from picking up the changes.
2017-09-13 13:53:46 +02:00
Matt Clarkson 0a64999259 MDL-60105 search: Fix fatal error
If an indexed file has been modified or deleted the search index
will still reference the old file. Remove the file from search
results until the change has been indexed.
2017-09-13 13:53:46 +02:00
AMOS bot 9f861ddcbb Automatically generated installer lang files 2017-09-13 00:06:59 +08:00
Dan Poltawski dff980ab44 Merge branch 'MDL-60039_32' of git://github.com/dmonllao/moodle into MOODLE_32_STABLE 2017-09-12 11:24:21 +01:00
David Monllao 8aab2713e9 MDL-60039 search: Force messaging search areas to be reindexed 2017-09-12 12:04:47 +02:00
David Monllao f7d3978d8d MDL-60039 messaging: global search index using timeread 2017-09-12 12:01:01 +02:00
Dan Poltawski cc15eb08e7 Merge branch 'MDL-59929_32' of git://github.com/timhunt/moodle into MOODLE_32_STABLE 2017-09-12 10:56:03 +01:00
Eloy Lafuente (stronk7) 75788c63c5 Merge branch 'MDL-60086-32' of https://github.com/snake/moodle into MOODLE_32_STABLE 2017-09-12 09:56:39 +02:00
David Monllao 57d11528b0 Merge branch 'MDL-59399-32' of git://github.com/ryanwyllie/moodle into MOODLE_32_STABLE 2017-09-12 08:12:46 +02:00
David Monllao 52155a2496 Merge branch 'MDL-59867-32' of git://github.com/damyon/moodle into MOODLE_32_STABLE 2017-09-12 07:11:11 +02:00
David Monllao 1b81de7861 Merge branch 'MDL-59879-32' of https://github.com/abias/moodle into MOODLE_32_STABLE 2017-09-12 07:04:58 +02:00
Eloy Lafuente (stronk7) 5258d49a10 Merge branch 'wip-MDL-59808-32' of git://github.com/marinaglancy/moodle into MOODLE_32_STABLE 2017-09-12 00:14:01 +02:00
Eloy Lafuente (stronk7) 7e14be9814 Merge branch 'MDL-60025-32' of git://github.com/jleyva/moodle into MOODLE_32_STABLE 2017-09-11 23:51:12 +02:00
Dan Poltawski df68f1fcbd Merge branch 'MDL-35849-32' of git://github.com/ankitagarwal/moodle into MOODLE_32_STABLE 2017-09-11 14:19:22 +01:00
Jake Dallimore 9b7b9d2740 MDL-60086 travis: Bumping the postgres version to 9.6
The new Travis images don't have 9.1 installed any more.
2017-09-11 14:39:00 +08:00
Jun Pataleta 3b92e304d3 Merge branch 'wip-MDL-55849-32' of git://github.com/abgreeve/moodle into MOODLE_32_STABLE 2017-09-11 13:30:46 +08:00
Adrian Greeve cb9f449c71 MDL-55849 mod_assign: Behat update for group submission reopening. 2017-09-11 12:01:38 +08:00
Adrian Greeve 255ef8e427 MDL-55849 mod_assign: Reopening assignments only increases by one.
Group assignments when being reopened will only increase the
attempt total by one.
2017-09-11 12:01:38 +08:00
Eloy Lafuente (stronk7) 9146c518ec Moodle release 3.2.5 2017-09-09 22:48:05 +02:00
Mathew May c84a3c9c40 MDL-53244 login: Add error message for recaptcha 2017-09-08 12:58:11 +12:00
David Monllao 43343ee9fc weekly release 3.2.4+ 2017-09-07 11:39:06 +02:00
David Mudrák fad00feee6 MDL-59969 admin: Warn admins if a development libs directory exists
We can't really control the direct web access to directories in dirroot,
that is part of the server setup. So we at least warn admins as they may
not realize the risks of having directories like vendor or node_modules
exposed.

Credit goes to Petr Škoda for mentioning the PHPUnit issue CVE-2017-9841
to me.
2017-09-07 11:06:39 +02:00
Marina Glancy e6f067b27d MDL-59972 mod_feedback: escape subject when showing the contact form 2017-09-07 11:06:39 +02:00
Jake Dallimore be365f2dbe MDL-58953 user: additional test case for user_can_view_profile() 2017-09-07 11:06:38 +02:00
Jake Dallimore 420440b2c1 MDL-58953 user: fix course checking logic in user_can_view_profile()
Make sure to check that $user in enrolled in $course before checking
whether the current user has capabilities in that course, and make sure
that we don't check user context caps when handling a specific course.
2017-09-07 11:06:38 +02:00
Simey Lameze 84650826a8 MDL-59776 core_calendar: unit tests of module events deletion 2017-09-07 11:06:37 +02:00
Simey Lameze 14d47d237e MDL-59776 core_calendar: prevent deletion of module events 2017-09-07 11:06:37 +02:00
Juan Leyva c70c7b65f0 MDL-58762 core: Get full course objects on navigation
The course object passed as parameter to extend_navigation_user
callback contained only a few parameters, some parameters like
showgrades or showreports were missing.
The callback should receive a full course object.
2017-09-07 11:06:37 +02:00
Juan Leyva efa8edcb86 MDL-58762 report: Check group permissions in course user reports
Teachers were able to see any student report even with forced separated
groups and capability moodle/course:accessallgroups off.
2017-09-07 11:06:36 +02:00
Jun Pataleta c97838cd76 Merge branch 'm32_MDL-59635_Properly_Escape_Column_Names_Reserved_Words_Proof' of https://github.com/scara/moodle into MOODLE_32_STABLE 2017-09-07 11:06:36 +02:00
Eloy Lafuente (stronk7) 730d8c788d Merge branch 'MDL-59696-32' of git://github.com/junpataleta/moodle into MOODLE_32_STABLE 2017-09-07 11:06:35 +02:00
Eloy Lafuente (stronk7) 21d2db211d Merge branch 'MDL-59198-32' of git://github.com/ankitagarwal/moodle into MOODLE_32_STABLE 2017-09-07 11:06:35 +02:00
David Monllao 9b18d1df37 Merge branch 'MOODLE_32_STABLE-MDL-59799' of https://github.com/jojoob/moodle into MOODLE_32_STABLE 2017-09-07 11:06:34 +02:00
Dan Poltawski 5da7d05120 Merge branch 'wip-MDL-59992-32' of git://github.com/marinaglancy/moodle into MOODLE_32_STABLE 2017-09-07 11:06:34 +02:00
David Monllao 3a3dab265b Merge branch 'wip-MDL-59815-32' of git://github.com/abgreeve/moodle into MOODLE_32_STABLE 2017-09-07 11:06:33 +02:00
Dan Poltawski 999d7ecc45 Merge branch 'MOODLE_32_STABLE-MDL_59834-Indexing_of_personal_messages' of https://github.com/mattporritt/moodle into MOODLE_32_STABLE 2017-09-07 11:06:33 +02:00
David Monllao d9d159e6fb Merge branch 'wip-MDL-59898-32' of git://github.com/abgreeve/moodle into MOODLE_32_STABLE 2017-09-07 11:06:32 +02:00
David Monllao 04bfebf961 Merge branch 'MDL-59963_32-report-logs-origin-pagination' of https://github.com/lucaboesch/moodle into MOODLE_32_STABLE 2017-09-07 11:06:32 +02:00
Damyon Wiese 6961e8882d MDL-59867 autocomplete: Prevent duplicate ids.
Rendering a form with 2 autocompletes in it can get messed up because of duplicated ids.
2017-09-07 09:34:04 +08:00
Marina Glancy c079d43dc1 MDL-59808 webservice_rest: comply with restformat argument 2017-09-07 08:34:40 +08:00
Juan Leyva b46369041c MDL-60025 mod_book: Return correct values for chapters update time
Instead returning the time when the chapter was created or modified we
were returning the time when the book was created or modified.
2017-09-06 12:38:34 +02:00
Juan Leyva 51cd0c4072 MDL-60018 mod_chat: Fix chatmethod field type in get_chats_by_courses WS 2017-09-06 12:16:43 +02:00
Marina Glancy def68f84a0 MDL-60033 webservice_xmlrpc: extra escaping in the server URL 2017-09-06 13:44:06 +08:00
Ryan Wyllie ad445893db MDL-59399 atto: make media plugin shortform explandable 2017-09-06 05:28:04 +00:00
Ankit Agarwal fec32f3cd7 MDL-35849 login: Add role alert to error messages
Error messages should be prominent to screen readers as well as visual users,
adding the role alert is recommended way to achieve it for screen readers and this is
also what we do for ->notification apis
2017-09-05 12:50:29 +05:30
Matteo Scaramuccia f550fd73ba MDL-59635 tool_replace: Escape the column name. 2017-09-04 13:39:08 +02:00
Matteo Scaramuccia 2a266d605a MDL-59635 ddl: Added test_get_enc_quoted(). 2017-09-04 13:39:07 +02:00
Jun Pataleta 011f82f04d MDL-59696 theme_bootstrapbase: Set max-width for custom-select elements
* Set custom-select elements with a maximum width of 100% of their
container.
2017-09-04 10:12:48 +08:00
Jun Pataleta 25c9f019b6 MDL-59696 templates: Remove form-group div for url-select template
* Removed the div with the class 'form-group' that's enclosing the
select element and friends. It's not needed since the urlselect template
is an inline form.
* Also, for completeness, I added the helpicon data for the template's
context.
2017-09-04 10:12:48 +08:00
Tobias Garske ec4bcc0a02 MDL-59898 access: Added Icon references. 2017-09-04 09:56:53 +08:00
Matt Porritt 72870eb4ff MDL-59834 Global Search: Indexing user messages
Make indexing of user messages tolerant to user deletion.
When creating the search document for user messages,
add a check to see if the user has been deleted in the
system. If they have been deleted abort creating the search
document.
This is to avoid rasining an error when trying to get the
user context for a deleted user.
2017-09-04 09:18:22 +10:00
Johannes Burk 5405eda8cb MDL-59799 course: Include course/lib.php before using move_courses(). 2017-09-01 16:44:37 +02:00
Luca Bösch 799da2b41e MDL-53936 reports: State default index page explicitly in pagination url 2017-09-01 11:51:32 +02:00
Luca Bösch d7a5ede0ef MDL-59963 reports: origin parameter looked at in log reports 2017-09-01 11:50:28 +02:00
Jun Pataleta 3393db1467 weekly release 3.2.4+ 2017-09-01 13:26:59 +08:00
Jun Pataleta c8b9ac4d4d Merge branch 'install_32_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_32_STABLE 2017-09-01 13:26:58 +08:00
Andrew Nicols 8c0221add0 Merge branch 'MDL-56646-32-fix' of https://github.com/xow/moodle into MOODLE_32_STABLE 2017-08-31 15:01:03 +08:00
John Okely 0a6282a861 MDL-56646 mod_assign: Improve grade fix strings 2017-08-31 14:54:16 +08:00
John Okely ab0e6eed08 MDL-56646 mod_assign: Make rescale behat more specific 2017-08-31 14:54:10 +08:00
Marina Glancy a0aac0bd6b MDL-59992 webservice: fix debugging message event context already set 2017-08-31 12:14:01 +08:00
Eloy Lafuente (stronk7) a7df7cbe77 Merge branch 'MDL-59927-32-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_32_STABLE 2017-08-30 11:06:09 +02:00
Peter Spicer b8dcc85f7c MDL-59815 access: Fix definition of risks for user:delete. 2017-08-30 11:35:22 +08:00
Connor Sheremeta bd937195eb MDL-54540 lti: Add allowfullscreen attribute to LTI IFrames 2017-08-29 13:46:34 -06:00
Helen Foster f2d07696c1 MDL-59927 lang: Merge English strings from the en_fix language pack
Significant string changes:

- firstpagetitle_help,mod_wiki - improved wording
- completionicons_help,core_completion - removing confusing sentence
  about the tick being optional
2017-08-29 16:01:27 +02:00
Dan Poltawski 5391a3ccea Merge branch 'MDL-59195_assign_comment_permissions_32' of git://github.com/davosmith/moodle into MOODLE_32_STABLE 2017-08-29 11:59:18 +01:00
Jun Pataleta 5b13b5438d Merge branch 'MDL-59908-32' of git://github.com/ankitagarwal/moodle into MOODLE_32_STABLE 2017-08-29 17:42:27 +08:00
Andrew Nicols ceec1f258f Merge branch 'MDL-56646-32' of https://github.com/xow/moodle into MOODLE_32_STABLE 2017-08-29 15:52:16 +08:00
John Okely 75c1e649b1 MDL-56646 assign: Fix negative grades in restore 2017-08-29 07:18:52 +00:00
John Okely 167507dcf8 MDL-56646 assign: Add ability to fix errant grades 2017-08-29 07:18:52 +00:00
Ankit Agarwal f644ae8a7d MDL-59198 lti: Make params LTI2 compatible
LTI2 recommends to include both upper case and lower case of custom params.
This patch makes our implementation confer to that standard.
2017-08-29 11:43:51 +05:30
Andrew Nicols d7d8b68ae3 Merge branch 'MDL-35290-32' of https://github.com/snake/moodle into MOODLE_32_STABLE 2017-08-29 13:17:12 +08:00
Jake Dallimore 100a53119a MDL-35290 files: File manager reports files which can't be read 2017-08-29 11:13:37 +08:00
Eloy Lafuente (stronk7) ba88f2a04f Merge branch 'MDL-59870_32-participants-th-top-vertical-aligned' of http://github.com/lucaboesch/moodle into MOODLE_32_STABLE 2017-08-29 01:03:49 +02:00
AMOS bot 7440a3e306 Automatically generated installer lang files 2017-08-29 00:08:21 +08:00
John Okely 1b8ca8081b MDL-56646 assign: Don't rescale any negative grades 2017-08-28 07:31:45 +00:00
John Okely 7bd00375bc MDL-56646 assign: Behat test rescaling after viewing student 2017-08-28 07:31:45 +00:00
Jun Pataleta 144bf3064c Merge branch 'wip-MDL-59708-32' of git://github.com/marinaglancy/moodle into MOODLE_32_STABLE 2017-08-28 15:02:24 +08:00
Jake Dallimore 655b454366 MDL-35290 files: File manager shouldn't break with lost/moved files 2017-08-28 08:41:24 +08:00
AMOS bot e8e1e9cbc7 Automatically generated installer lang files 2017-08-28 00:09:46 +08:00
AMOS bot c338b3ddaf Automatically generated installer lang files 2017-08-26 00:07:31 +08:00
Eloy Lafuente (stronk7) 1626cc036e Merge branch 'wip-MDL-59881-32' of git://github.com/abgreeve/moodle into MOODLE_32_STABLE 2017-08-25 01:00:18 +02:00
Luca Bösch 9b8b0c907a MDL-59870 users: Default align participant table header row.
Instead of putting vertical-align: middle as indication for participants table
headers, none is set which leads to theme default, i.e. bottom in Clean and Boost.
2017-08-25 00:11:00 +02:00
AMOS bot 765e7e426a Automatically generated installer lang files 2017-08-25 00:05:58 +08:00
AMOS bot 17f0da3a56 Automatically generated installer lang files 2017-08-25 00:05:57 +08:00
Tim Hunt e3993969d6 MDL-59929 signup: inprove usability when duplicate email entered 2017-08-24 16:33:24 +01:00
Eloy Lafuente (stronk7) 5e7cb19d97 weekly release 3.2.4+ 2017-08-24 14:14:23 +02:00
Ankit Agarwal f78533b6ae MDL-59908 backup: Backup rule should use both http and https schemes 2017-08-24 11:34:12 +05:30
Ankit Agarwal 9c086d3891 MDL-59908 backup: Add tests to make sure both http(s) schemes are parsed 2017-08-24 11:34:11 +05:30
Eloy Lafuente (stronk7) 32e408c9f4 Merge branch 'MDL-59790-32' of git://github.com/lameze/moodle into MOODLE_32_STABLE 2017-08-23 11:38:28 +02:00
Andrew Nicols 9fd6166e32 Merge branch 'MDL-57412-32' of https://github.com/xow/moodle into MOODLE_32_STABLE 2017-08-23 16:58:38 +08:00
John Okely 360c8b7a8f MDL-57412 adminlib: change linkcoursesections default to 1 2017-08-23 15:09:42 +08:00
John Okely 7681e279d4 MDL-57412 upgrade: Set linkcoursesections to 1 if boost in use 2017-08-23 15:09:42 +08:00
Simey Lameze 490a62a963 MDL-59790 core: fix tooltip for pie chart 2017-08-23 12:28:29 +08:00
Andrew Nicols 95eb86b4d4 Merge branch 'MDL-51827_32' of git://github.com/timhunt/moodle into MOODLE_32_STABLE 2017-08-23 09:38:51 +08:00
Eloy Lafuente (stronk7) 7330fa406d Merge branch 'MDL-59663-32' of git://github.com/junpataleta/moodle into MOODLE_32_STABLE 2017-08-22 21:04:00 +02:00
Tim Hunt 64d7716d76 MDL-51827 account confirm: take users to their dashboard
This is an old bit of UI inconsistency. For some reason it used to take
people to the list of all courses. Given modern Moodle usability
conventions, that does not really make sense any more.
2017-08-22 14:34:57 +01:00
Eloy Lafuente (stronk7) 4d5d8cd090 Merge branch 'MDL-59784-32' of git://github.com/andrewnicols/moodle into MOODLE_32_STABLE 2017-08-22 12:29:01 +02:00
Andrew Nicols 1862ff1afb Merge branch 'MDL-59826-32' of https://github.com/snake/moodle into MOODLE_32_STABLE 2017-08-22 16:01:46 +08:00
Andrew Nicols 0030a24f5c Merge branch 'MDL-59825-32' of https://github.com/snake/moodle into MOODLE_32_STABLE 2017-08-22 15:35:35 +08:00
Jun Pataleta b0a0e7abf9 Merge branch 'MDL-57775-32-xmlrpc' of git://github.com/mudrd8mz/moodle into MOODLE_32_STABLE 2017-08-22 15:00:34 +08:00
Andrew Nicols e9fc0c3145 Merge branch 'MDL-59893-32' of https://github.com/snake/moodle into MOODLE_32_STABLE 2017-08-22 14:33:59 +08:00
Jake Dallimore 5dde47c0d1 MDL-59893 assign: don't prefix file links when downloading as folders
Change to download_rewrite_pluginfile_urls() ensuring prefix isn't
added to file links when downloading with the  downloadasfolders
user preference set to true. Links to files in onlinetext now work
when downloading as folders.
2017-08-22 13:00:02 +08:00
Jake Dallimore 6f363ad9e1 MDL-59893 assign: fixes for groupname prefix when downloading
assign->download_submissions():
- groupname now only added to zip file name if not empty, fixing a
double hyphen bug in the file name.
assign->download_rewrite_pluginfile_urls():
- groupname is now correctly determined using get_submission_group()
instead of using groups_get_activity_group() which fails when there
is no active activity group set. Uses the same logic that
download_submission() uses to prefix file names. Fixes a bug where an
empty groupname prefix was generated, resulting in broken links.
2017-08-22 12:59:57 +08:00
Andrew Nicols 576f9bf393 Merge branch 'MDL-57246-32-forumredirect' of git://github.com/roperto/moodle into MOODLE_32_STABLE 2017-08-22 12:34:28 +08:00
Adrian Greeve c63aff3469 MDL-59881 question bank: Use supplied function parameters.
question_usage_by_activity::start_all_questions now uses all
three of the parameters that are defined.
2017-08-22 09:37:16 +08:00
Eloy Lafuente (stronk7) 5b7bb8c728 Merge branch 'MDL-55937-32' of git://github.com/ankitagarwal/moodle into MOODLE_32_STABLE 2017-08-21 23:22:24 +02:00
Eloy Lafuente (stronk7) 817db54ce6 Merge branch 'MDL-59049-32' of https://github.com/snake/moodle into MOODLE_32_STABLE 2017-08-21 23:09:26 +02:00
Davo Smith ce5bf80ab6 MDL-59195 mod_assign: add behat tests for comments error 2017-08-21 10:28:32 +01:00
Davo Smith 31fb71994e MDL-59195 assignsubmission_comments: fix permission checks 2017-08-21 10:28:32 +01:00
Alexander Bias 6eeaf27bd1 MDL-59879 navigation: Add node key to competencies navigation node 2017-08-21 10:55:37 +02:00
John Okely e0fc3b6d52 MDL-57412 course: Unit test get_view_url for course formats 2017-08-21 12:56:02 +08:00
John Okely 2a9926f8b4 MDL-57412 navigationlib: Respect linkcoursesections again 2017-08-21 12:56:02 +08:00
Jun Pataleta c0361874e1 MDL-59663 course: Render the appropriate course-category tree action 2017-08-21 10:02:04 +08:00
Eloy Lafuente (stronk7) 7e74569bd8 Merge branch 'MDL-59836-32' of git://github.com/junpataleta/moodle into MOODLE_32_STABLE 2017-08-18 12:36:40 +02:00
Jake Dallimore 9d78a83e27 MDL-59825 user: user_can_view_profile() checks all of a $user's courses
This function used to check only those courses shared by both users
when it should have been checking all courses in which $user is
enrolled. Managers can view a user's course profile without necessarily
sharing the course (being enrolled in) with the $user.
2017-08-18 11:38:21 +08:00
Jun Pataleta 1932699a0e MDL-59836 core_amd: Use only one input event handler
* We have duplicate input event handlers for the autocomplete element
which are both firing when the input element's value is being set.
In case an AJAX handler is defined for the autocomplete suggestions,
this causes the autocomplete suggestions so show "No suggestions" first
and then load the results from the AJAX handler a little bit later.
2017-08-18 11:37:38 +08:00
Jake Dallimore 458be04b51 MDL-59826 output: make context_header() aware of page context.
There are times, such as when viewing a user profile within a course,
when user_can_view_profile() should be passed a course to force it to
restrict its capability checks to only the supplied course. This change
makes sure that core_renderer->context_header() calls this correctly.
2017-08-18 11:33:01 +08:00
Andrew Nicols be115c1097 MDL-59784 core: Modal factory should listen before fetching templates 2017-08-18 11:19:50 +08:00
Andrew Nicols fb6da21229 MDL-59784 core: Modal should accept title as a promise 2017-08-18 11:19:50 +08:00
Jake Dallimore 17c7a576e3 MDL-59049 badges: allows users to view badges from deleted courses 2017-08-18 10:52:41 +08:00
Andrew Nicols 2f8dec8a00 MDL-59784 core: Refactor addblock to listen earlier 2017-08-18 09:37:17 +08:00
Eloy Lafuente (stronk7) fca5d3d71d weekly release 3.2.4+ 2017-08-17 10:39:20 +02:00
Eloy Lafuente (stronk7) 261b8a8663 Merge branch 'install_32_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_32_STABLE 2017-08-17 10:39:19 +02:00
AMOS bot f6b077722c Automatically generated installer lang files 2017-08-17 00:08:48 +08:00
David Mudrák ddbbe8b563 MDL-57775 xmlrpc: Formal fix of coding style and phpdocs
- There was missing MOODLE_INTERNAL check.
- The client is not used for unit tests only so the class description
  was obsolete.
2017-08-15 21:43:28 +02:00
David Mudrák 9943a9b471 MDL-57775 xmlrpc: Test webservice_xmlrpc_client request encoding
The patch wraps the underlying xmlrpc_encode_request() call into a
standalone method that can be then unit-tested.
2017-08-15 21:43:28 +02:00
David Mudrák aafd4121d5 MDL-57775 xmlrpc: Pass escaping to xmlrpc_encode_request() calls
This patch adds the missing 'escaping' option to all remaining
xmlrpc_encode_request() calls in the moodle core code.

Without this, the xmlrpc_decode_request() call on the server side may
lead to wrongly decoded non-ascii characters.
2017-08-15 21:43:27 +02:00
Eloy Lafuente (stronk7) 05f4445462 Merge branch 'MDL-58435-m32' of https://github.com/NeillM/moodle into MOODLE_32_STABLE 2017-08-15 16:35:49 +02:00
Eloy Lafuente (stronk7) 71cd7f8f89 Merge branch 'MDL-59667-32-2' of git://github.com/ryanwyllie/moodle into MOODLE_32_STABLE 2017-08-15 13:13:26 +02:00
Neill Magill 326938cdfc MDL-58435 behat: Update existing tests to use section editing steps 2017-08-15 09:59:50 +01:00
Ankit Agarwal b48c52b48d MDL-55937 assign: Check for group submission caps when userid=0 2017-08-15 11:15:59 +05:30
Jun Pataleta 03173aad6e Merge branch 'MDL-57611-moodle32' of https://github.com/jebarviabb/moodle into MOODLE_32_STABLE 2017-08-15 11:51:02 +08:00
gthomas2 56d1010f4c MDL-59708 file: Add CUD callbacks, backport of MDL-57476 2017-08-15 09:51:41 +08:00
Ryan Wyllie fbc1d6810f MDL-59667 form: stop datepicker from rendering outside viewport
Stop the date picker panel from being rendered outside of the
viewport, for example when being displayed in a modal.
2017-08-15 01:25:51 +00:00
Jun Pataleta cc6a0292a8 Merge branch 'MDL-59785-32' of git://github.com/lameze/moodle into MOODLE_32_STABLE 2017-08-14 16:57:18 +08:00
Jun Pataleta 6b040158b9 Merge branch 'MDL-59740_32' of git://github.com/markn86/moodle into MOODLE_32_STABLE 2017-08-14 13:48:34 +08:00
Andrew Nicols 7bf9b144e1 Merge branch 'wip-MDL-57188-32-2' of git://github.com/marinaglancy/moodle into MOODLE_32_STABLE 2017-08-14 13:16:58 +08:00
Andrew Nicols 7be5ceab6f Merge branch 'MDL-59737_32' of git://github.com/markn86/moodle into MOODLE_32_STABLE 2017-08-14 12:30:09 +08:00
Simey Lameze 826f8dcfad MDL-59785 mod_book: all navigation styles must mark as completed 2017-08-14 11:44:09 +08:00
AMOS bot e56476777a Automatically generated installer lang files 2017-08-14 00:08:48 +08:00
Josh Ebarvia 2a772b417a MDL-57611 report_log: Fix capability checks for viewing logs 2017-08-11 13:07:22 +09:30
David Monllao a19dda0243 weekly release 3.2.4+ 2017-08-10 09:11:32 +02:00
David Monllao 4693ab804f NOBUG: Fixed SVG browser compatibility 2017-08-10 09:11:31 +02:00
Neill Magill f29641a554 MDL-58435 behat: Behat section editing step should work on section 0 2017-08-09 15:24:15 +01:00
Marina Glancy a7b9152399 MDL-57188 course: correct return url to manage page 2017-08-08 14:49:06 +08:00
Eloy Lafuente (stronk7) 5dad2e2824 Merge branch 'MDL-59506-32' of git://github.com/andrewnicols/moodle into MOODLE_32_STABLE 2017-08-07 19:55:40 +02:00
Eloy Lafuente (stronk7) 8d5c561c07 Merge branch 'MDL-59504-32' of git://github.com/junpataleta/moodle into MOODLE_32_STABLE 2017-08-07 19:27:31 +02:00
Dan Poltawski 5b6eae27eb Merge branch 'MDL-59172-32' of https://github.com/snake/moodle into MOODLE_32_STABLE 2017-08-07 16:20:16 +01:00
David Monllao 0783b383b9 Merge branch 'MDL-59642-32' of git://github.com/andrewnicols/moodle into MOODLE_32_STABLE 2017-08-07 14:41:53 +02:00
Mark Nelson 51fdfc53b7 MDL-59740 core_form: add ability to specify if a button is primary 2017-08-07 17:38:26 +08:00
Mark Nelson 1a20218834 MDL-59737 core_backup: changed reference to domain doesntexist.com 2017-08-07 17:18:45 +08:00
David Monllao 74cf6f09d0 Merge branch 'wip-MDL-59055-32' of git://github.com/marinaglancy/moodle into MOODLE_32_STABLE 2017-08-07 09:22:07 +02:00
Andrew Nicols 1cc7c1c1cf Merge branch 'MDL-51745-moodle32' of https://github.com/jebarviabb/moodle into MOODLE_32_STABLE 2017-08-07 14:49:09 +08:00
Josh Ebarvia 9e3a44b58a MDL-51745 mod_lesson: Use format_text in response feedback 2017-08-07 15:51:10 +09:30
Andrew Nicols 8002fc9e27 Merge branch 'MDL-59662_32-errors-typo' of https://github.com/lucaboesch/moodle into MOODLE_32_STABLE 2017-08-07 13:36:57 +08:00
Andrew Nicols 284eec64a7 Merge branch 'MDL-59698-32' of git://github.com/damyon/moodle into MOODLE_32_STABLE 2017-08-07 12:57:04 +08:00
Andrew Nicols 046fc0386f Merge branch 'MDL-59728_32-boost-question-bank-header-align' of https://github.com/lucaboesch/moodle into MOODLE_32_STABLE 2017-08-07 12:40:27 +08:00
Damyon Wiese 782f95ce5e MDL-59055 grades: behat test 2017-08-07 10:09:54 +08:00
Marina Glancy b8bb94808c MDL-59055 grades: provide backward-compatibility of changes 2017-08-07 10:09:53 +08:00
Marina Glancy 1b735f2761 MDL-59055 grades: fix bug displaying item id instead of grade
Thanks to Marcelo Santos for initial patch
2017-08-07 10:09:53 +08:00
Andrew Nicols 39c4326890 MDL-59506 core_lock: use a null lock during install
Use a different lock factory during installation which does not actually
lock at all.
2017-08-07 10:01:11 +08:00
Jake Dallimore 52f2f22fba MDL-59172 user: user_can_view_profile() now checks viewalldetails cap 2017-08-07 09:30:57 +08:00
Pierre Guinoiseau 98982ba82b MDL-59504 pix: update icon for Mahara 2017-08-07 09:02:42 +08:00
Luca Bösch 893888e2ab MDL-59728 questions: Align question bank headers. 2017-08-04 15:25:17 +02:00
Luca Bösch 34816abc7e MDL-59662 database: Typo in variable name. 2017-08-04 10:30:52 +02:00
Andrew Nicols cd0978d66c MDL-59642 stats: Correct random unit test failure
The unit test was creating four events, and then relying on them being
retrieved in the order in which they were created.

I've modified the test to:
* ensure timecreated are spaced apart; and
* add an order by timecreated when fetching them.
2017-08-04 15:07:38 +08:00
Andrew Nicols 66cfaa5f43 weekly release 3.2.4+ 2017-08-04 11:50:07 +08:00
Andrew Nicols 18bdade5d7 Merge branch 'install_32_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_32_STABLE 2017-08-04 11:49:48 +08:00
AMOS bot 84ed229ae6 Automatically generated installer lang files 2017-08-04 00:11:14 +08:00
Andrew Nicols ecebcb44e2 Merge branch 'MDL-59582-32' of git://github.com/danpoltawski/moodle into MOODLE_32_STABLE 2017-08-03 15:50:46 +08:00
Dan Poltawski dee212c897 MDL-59582 npm: update shrinkwrap file for npm 8.2.0 2017-08-03 08:28:39 +01:00
Andrew Nicols 6702f7a907 Merge branch 'm32_MDL-59583_Fix_MariaDB_10d2d7_Breaking_Change' of https://github.com/scara/moodle into MOODLE_32_STABLE 2017-08-03 12:34:22 +08:00
Damyon Wiese d3e49e59f3 MDL-59698 behat: Remove bad tests
These tests are an abuse and should not have been accepted. Behat tests should use real pages.
Adding testing only entry points to Moodle is a bad security practice and is not the purpose of behat.
2017-08-03 10:30:40 +08:00
Matteo Scaramuccia f597bb1def MDL-59583 dml: fixed NULL values w/ MariaDB 10.2.7+ 2017-08-03 00:30:26 +02:00
Andrew Nicols b3dd3a0278 Merge branch 'MDL-57259-32' of git://github.com/ryanwyllie/moodle into MOODLE_32_STABLE 2017-08-02 13:40:28 +08:00
Ryan Wyllie d92ef7d2c5 MDL-57259 external: fix page url debug in fragment loading 2017-08-02 03:44:34 +00:00
Andrew Nicols 082ea214c7 Merge branch 'MDL-55364-32-fix' of https://github.com/xow/moodle into MOODLE_32_STABLE 2017-08-02 10:52:51 +08:00
John Okely 3971cdc602 MDL-55364 forum: Combine user picture and user name rows 2017-08-02 10:30:55 +08:00
Dan Poltawski fb982745a6 Merge branch 'MDL-55364-32' of https://github.com/xow/moodle into MOODLE_32_STABLE 2017-08-01 11:36:39 +01:00
David Monllao 8e7d737d39 Merge branch 'wip-MDL-53492-32' of git://github.com/marinaglancy/moodle into MOODLE_32_STABLE 2017-08-01 09:23:01 +02:00
Andrew Nicols 8b60f9b1c2 Merge branch 'MDL-58928_32-alt-attribute-enrolment-edit-delete-icons' of https://github.com/lucaboesch/moodle into MOODLE_32_STABLE 2017-08-01 14:56:44 +08:00
Andrew Nicols e0818e74b6 Merge branch 'MDL-59473-MOODLE_32_STABLE' of https://github.com/sytabaresa/moodle into MOODLE_32_STABLE 2017-08-01 10:51:57 +08:00
Luca Bösch 387e76f6a9 MDL-58928 enrol: delete and edit icon alt attribute 2017-07-31 17:33:19 +02:00
David Monllao 99c6170e39 Merge branch 'wip-MDL-59496-32-3' of git://github.com/marinaglancy/moodle into MOODLE_32_STABLE 2017-07-31 17:15:14 +02:00
David Monllao bcc09bcf64 Merge branch 'wip-MDL-59311-32' of git://github.com/marinaglancy/moodle into MOODLE_32_STABLE 2017-07-31 14:47:35 +02:00
David Monllao f97f4c2e8c Merge branch 'MDL-59535-32' of git://github.com/lameze/moodle into MOODLE_32_STABLE 2017-07-31 14:20:14 +02:00
David Monllao 629dbe65bf Merge branch 'MDL-57546-32' of git://github.com/andrewnicols/moodle into MOODLE_32_STABLE 2017-07-31 14:10:12 +02:00
Dan Poltawski 5d65c618b4 Merge branch 'MDL-59632_32' of git://github.com/dmonllao/moodle into MOODLE_32_STABLE 2017-07-31 11:33:09 +01:00
Dan Poltawski 15e9965d66 Merge branch 'wip-MDL-59476-32-2' of git://github.com/marinaglancy/moodle into MOODLE_32_STABLE 2017-07-31 10:21:33 +01:00
Andrew Nicols b42b18958a Merge branch 'MDL-58196-32' of git://github.com/ankitagarwal/moodle into MOODLE_32_STABLE 2017-07-31 15:30:11 +08:00
David Monllao 683241a7b1 Merge branch 'MDL-58744-32' of https://github.com/jacac/moodle into MOODLE_32_STABLE 2017-07-31 08:36:56 +02:00
Ankit Agarwal 3e0beaa76b MDL-58196 availability: Fix UI for pass/fail config
For pass/fail setting to work properly, activities must have 'Require grade' completion set,
just make sure we don't allow activities without this setting to be set
2017-07-31 11:56:39 +05:30
Ankit Agarwal f13679ffff MDL-58196 availability: Add appropriate dependencies in mform 2017-07-31 11:56:39 +05:30
Andrew Nicols 8c5da164a5 Merge branch 'm32_MDL-59583_Fix_MariaDB_10d2d7_Breaking_Change' of https://github.com/scara/moodle into MOODLE_32_STABLE 2017-07-31 11:51:24 +08:00
Marina Glancy 37975e9873 MDL-53492 registration: Moodle.net is more correct than Moodle.org 2017-07-31 11:38:38 +08:00
Marina Glancy 35d13bc3fa MDL-53492 registration: use https://moodle.net as hub url 2017-07-31 11:38:34 +08:00
Daniel Materka 557c609d7b MDL-55364 forum: fix overlapping columns in the table at low resolutions 2017-07-31 11:24:35 +08:00
Marina Glancy 7824b31705 MDL-59496 registration: display unregistered warning consistently 2017-07-31 11:24:20 +08:00
AMOS bot 9ea038335d Automatically generated installer lang files 2017-07-31 00:10:33 +08:00
AMOS bot 8c61b3fa9e Automatically generated installer lang files 2017-07-29 00:10:53 +08:00
Simey Lameze 40e3615636 MDL-59535 tool_behat: fix fatal error if there is no setup 2017-07-28 08:47:45 +08:00
AMOS bot 26c6b51f3c Automatically generated installer lang files 2017-07-28 00:07:58 +08:00
Jakob Ackermann 69dd75f44c MDL-58744 blocks: Add system context block position in non user context. 2017-07-27 09:03:53 -07:00
Dan Poltawski 8d826b10c6 weekly release 3.2.4+ 2017-07-27 10:10:49 +01:00
Dan Poltawski 87269161af Merge branch 'install_32_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_32_STABLE 2017-07-27 10:10:48 +01:00
David Monllao 3ac7b54f9c MDL-59632 search: Style search box for boost 2017-07-27 11:01:17 +02:00
Marina Glancy 2ecdf3527f MDL-59311 course: duplicate module rebuilds cache twice
slightly refactor duplicate_module() code so it does not rebuild course cache
twice and also we do not need to move module if it is already the last module in a section
2017-07-27 08:17:07 +08:00
Dan Poltawski 8ab93c866d Merge branch 'MDL-57698-32-fix' of https://github.com/xow/moodle into MOODLE_32_STABLE 2017-07-26 09:41:41 +01:00
John Okely b1fce6b62e MDL-57698 backup: Decrease deadlock fixture size 2017-07-26 10:41:39 +08:00
Andrew Nicols 05caa18842 MDL-57546 mediaplayer_youtube: Respect mobile URLs 2017-07-26 10:41:29 +08:00
Sebastian Tabares Amaya 21f36301a6 MDL-59473 request: Fix Loop Redirection in Oauth2
Conflicts:
	lib/oauthlib.php
2017-07-25 20:22:22 -05:00
AMOS bot eb0c054eb2 Automatically generated installer lang files 2017-07-26 00:07:52 +08:00
Dan Poltawski 097e33c3c8 Merge branch 'MDL-57698-32' of https://github.com/xow/moodle into MOODLE_32_STABLE 2017-07-25 11:48:12 +01:00
Matteo Scaramuccia 6a1af02a0c MDL-59583 dml: fixed breaking change added w/ MariaDB 10.2.7+ 2017-07-25 12:34:29 +02:00
Matteo Scaramuccia bd586072ae MDL-59583 dml: improve perfs by unsetting the key. 2017-07-25 12:31:52 +02:00
Dan Poltawski 1d7c7a52ff Merge branch 'MDL-58761_bad_regex_in_custom_step_MOODLE_32_STABLE' of https://github.com/gthomas2/moodle into MOODLE_32_STABLE 2017-07-25 11:06:24 +01:00
David Monllao 7dfe16bf72 Merge branch 'MDL-59485-32' of https://github.com/IMSGlobal/moodle into MOODLE_32_STABLE 2017-07-25 11:11:23 +02:00
Dan Poltawski 7ec1dd5900 Merge branch 'MDL-59432-32' of git://github.com/lameze/moodle into MOODLE_32_STABLE 2017-07-25 07:58:47 +01:00
Marina Glancy f3f2867300 MDL-59476 dml: temporary mysql tables should not use compressed rows 2017-07-25 14:25:30 +08:00
David Monllao 6832876b63 Merge branch 'MDL-59509-32' of git://github.com/andrewnicols/moodle into MOODLE_32_STABLE 2017-07-24 13:04:04 +02:00
Dan Poltawski 894c661782 Merge branch 'MDL-58174-32' of https://github.com/abias/moodle into MOODLE_32_STABLE 2017-07-24 09:05:49 +01:00
Andrew Nicols 40310fa348 Merge branch 'wip-MDL-38129-32' of git://github.com/marinaglancy/moodle into MOODLE_32_STABLE 2017-07-24 15:29:57 +08:00
Andrew Nicols bd9a279c0e Merge branch 'wip-MDL-59561-32' of git://github.com/abgreeve/moodle into MOODLE_32_STABLE 2017-07-24 13:22:51 +08:00
Andrew Nicols 614b87e26e Merge branch 'MDL-59490-32' of https://github.com/spvickers/moodle into MOODLE_32_STABLE 2017-07-24 12:53:20 +08:00
AMOS bot 83fd7eee00 Automatically generated installer lang files 2017-07-23 00:08:55 +08:00
AMOS bot 7c7b2b57cb Automatically generated installer lang files 2017-07-22 00:08:01 +08:00
John Okely 60eb84c9a8 MDL-57698 sqlsrv: Unit test NOLOCK 2017-07-21 14:46:53 +08:00
John Okely 5c409b7e78 MDL-57698 sqlsrv: Query temp tables with no lock 2017-07-21 14:46:53 +08:00
John Okely 5c1b2fbbbf MDL-57698 sqlsrv: Unit test deadlock case 2017-07-21 14:46:53 +08:00
Andrew Nicols 62d4895808 MDL-59509 dml: sqlsrv should respect port setting
Details of how to connect to a specific port are available at
https://docs.microsoft.com/en-us/sql/connect/php/how-to-connect-on-a-specified-port
2017-07-21 13:24:10 +08:00
Adrian Greeve 30b8eb2d46 MDL-59561 database: Update to creating new indexes in mysql.
When updating the mysql system to utf8mb4 not all tables are
converted to the row format of compressed or dynamic. If a new
index is created there is a possibility that the table could be
using compact or redundant and then an error will be shown saying
that the index size is too large. This fix handles this exception
and converts the table over to compressed.
2017-07-21 09:32:19 +08:00
AMOS bot 98c7360862 Automatically generated installer lang files 2017-07-21 00:07:06 +08:00
Dan Poltawski 0581a9be05 weekly release 3.2.4+ 2017-07-20 13:20:50 +01:00
Dan Poltawski e760f0978f Merge branch 'install_32_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_32_STABLE 2017-07-20 13:20:49 +01:00
Marco Ferrante 4e184445f2 MDL-59432 auth_db: add aliases to field mapping query
This patch fixes an issue with mapping different internal fields
to the same external field.
2017-07-20 15:00:09 +08:00
Andrew Nicols bfc16833c6 Merge branch 'MDL-59527-32-fix1' of http://github.com/damyon/moodle into MOODLE_32_STABLE 2017-07-20 10:44:15 +08:00
Andrew Nicols 4fc7dd679a Merge branch 'wip-MDL-57649-32-fix2' of git://github.com/abgreeve/moodle into MOODLE_32_STABLE 2017-07-20 10:23:56 +08:00
Damyon Wiese e00ed4b740 MDL-59527 autocomplete: Don't fetch ajax twice 2017-07-20 10:02:40 +08:00
Adrian Greeve 4a162dc36a MDL-57649 mod_lesson: Improvement to upgrade query.
We only need one record for each filearea that we
are removing.
2017-07-20 10:02:08 +08:00
AMOS bot 40727c30b0 Automatically generated installer lang files 2017-07-20 00:06:51 +08:00
Dan Poltawski 39bf55dc27 Merge branch 'wip-MDL-57649-32-fix' of git://github.com/abgreeve/moodle into MOODLE_32_STABLE 2017-07-19 09:33:16 +01:00
Adrian Greeve e651adf8e4 MDL-57649 mod_lesson: Additional refinement to upgrade script. 2017-07-19 15:46:17 +08:00
Dan Poltawski 9a79219353 Merge branch 'MDL-59569-32' of git://github.com/andrewnicols/moodle into MOODLE_32_STABLE 2017-07-19 08:44:00 +01:00
Andrew Nicols 43591af1ea Merge branch 'wip-MDL-39471-32-fix' of git://github.com/abgreeve/moodle into MOODLE_32_STABLE 2017-07-19 14:59:38 +08:00
Adrian Greeve c6e1eb9729 MDL-39471 mod_assign: Fix for missing function in 3.2
Moodle 3.2 doesn't have can_edit_group_submission.
This replaces the lack of that function.
2017-07-19 12:58:47 +08:00
Andrew Nicols 4f2e59fba6 MDL-59569 travis: Remove haveged 2017-07-19 12:22:26 +08:00
Stephen Vickers dad0b29a9c MDL-59485 mod_lti: Add missing capabilities
Capabilities missing which should allow Moodle to pass IMS certification
for LTI 2.0
2017-07-18 10:58:44 +01:00
Dan Poltawski e28350a3ad Merge branch 'MDL-59255-MOODLE_32_STABLE' of github.com:lucisgit/moodle into MOODLE_32_STABLE 2017-07-18 10:54:07 +01:00
Marina Glancy a2a9067174 MDL-59255 media: support rtmp:// in URLs 2017-07-18 10:28:19 +01:00
David Monllao 849895e2ad Merge branch 'wip-MDL-39471-32' of git://github.com/abgreeve/moodle into MOODLE_32_STABLE 2017-07-18 10:49:33 +02:00
Dan Poltawski 09c63a0cb4 Merge branch 'm32_MDL-59109_Backup_Missing_AutoCommit' of https://github.com/scara/moodle into MOODLE_32_STABLE 2017-07-18 09:45:38 +01:00
David Monllao 7ea1012da8 Merge branch 'MDL-57991-m32' of https://github.com/micaherne/moodle into MOODLE_32_STABLE 2017-07-18 09:40:36 +02:00
David Monllao 1eabeab91c Merge branch 'wip-MDL-58362-32' of git://github.com/marinaglancy/moodle into MOODLE_32_STABLE 2017-07-18 09:08:58 +02:00
Marina Glancy b048026672 MDL-38129 gradeexport: custom profile fields case problem
Do not use custom pfofile field name as a field alias in DB query, use field id instead.
DML lowercases all column aliases and fields with uppercase letters no longer match.
2017-07-18 11:06:28 +08:00
David Monllao 7b735c2537 MDL-59411 course: Fix unavailable typo 2017-07-17 16:40:54 +02:00
David Monllao 6f90ebe723 Merge branch 'wip-MDL-59411-32' of git://github.com/marinaglancy/moodle into MOODLE_32_STABLE 2017-07-17 15:48:28 +02:00
David Monllao a1fbd17805 Merge branch 'MDL-59527-32' of git://github.com/damyon/moodle into MOODLE_32_STABLE 2017-07-17 14:08:36 +02:00
Dan Poltawski 46fdac233f Merge branch 'm32_MDL-58119_Add_Cache_Control_Immutable_Support' of https://github.com/scara/moodle into MOODLE_32_STABLE 2017-07-17 11:46:39 +01:00
Alexander Bias b539369338 MDL-58174 themes: Make build_action_menu_from_navigation() protected 2017-07-17 11:16:08 +02:00
David Monllao a419a8c997 Merge branch 'wip-MDL-59377-32-3' of git://github.com/marinaglancy/moodle into MOODLE_32_STABLE 2017-07-17 11:05:42 +02:00
David Monllao 5ed5e269c3 Merge branch 'MDL-59068-32' of git://github.com/dpalou/moodle into MOODLE_32_STABLE 2017-07-17 10:10:09 +02:00
Dan Poltawski 14356a747d Merge branch 'wip-MDL-57649-32' of git://github.com/abgreeve/moodle into MOODLE_32_STABLE 2017-07-17 09:01:09 +01:00
David Monllao 0e314c3d57 Merge branch 'MDL-54607-32' of git://github.com/ankitagarwal/moodle into MOODLE_32_STABLE 2017-07-17 09:32:20 +02:00
David Monllao e788c61ef1 Merge branch 'wip-MDL-55912-32' of git://github.com/abgreeve/moodle into MOODLE_32_STABLE 2017-07-17 09:09:16 +02:00
Marina Glancy f7b3577b49 MDL-59377 mod_label: set showdescription to be always 1 2017-07-17 13:44:36 +08:00
Marina Glancy e7d88a04ff MDL-59377 course: when module intro is visible display embedded files
Even when course module is not available the intro text can still be visible on the
course page. In this case the availability restriction is displayed to the student
but link to the activity is not available
2017-07-17 13:44:30 +08:00
Andrew Nicols 5d3bf18f21 Merge branch 'mdl55979-moodle32' of https://github.com/tlock/moodle into MOODLE_32_STABLE 2017-07-17 12:29:44 +08:00
Andrew Nicols 98f10b0102 Merge branch 'MDL-59371-32' of git://github.com/lameze/moodle into MOODLE_32_STABLE 2017-07-17 10:24:37 +08:00
Adrian Greeve d6dfe368d2 MDL-39471 mod_assign: Comment visibility in blind marking.
Students can now see the identity of anyone making comments.
Markers on the otherhand can only see the identity of themselves
when making comments.
2017-07-17 09:26:50 +08:00
Adrian Greeve bbd50f0350 MDL-55912 mod_assign: Set grader details to the correct user. 2017-07-17 09:23:22 +08:00
Adrian Greeve 8782b691a5 MDL-57649 mod_lesson: Delete answer files correctly.
The files associated with answers and responses were
not being deleted due to the fact that the wrong itemid
was being used.
2017-07-17 09:19:00 +08:00
AMOS bot ad06286d06 Automatically generated installer lang files 2017-07-17 00:06:58 +08:00
Matteo Scaramuccia 49950dcb9c MDL-58119 files: Reviewed lifetime value 2017-07-15 00:18:48 +02:00
Matteo Scaramuccia 2168357af1 MDL-58119 files: Use immutable Cache-Control extension. 2017-07-15 00:18:48 +02:00
Matteo Scaramuccia bcaee8da27 MDL-58119 files: Used if-then instead of ternary operators 2017-07-15 00:18:48 +02:00
Matteo Scaramuccia a81049f6d4 MDL-58119 files: Let send_stored_file() rely on send_file(). 2017-07-15 00:18:48 +02:00
Matteo Scaramuccia afc5de4613 MDL-59109 scorm: Save autocommit setting in the backup. 2017-07-15 00:13:55 +02:00
Dan Poltawski bc60c1a2eb weekly release 3.2.4+ 2017-07-14 11:46:47 +01:00
Dan Poltawski 47ff6a3cb3 Merge branch 'install_32_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_32_STABLE 2017-07-14 11:46:46 +01:00
Damyon Wiese 69f7abf28b MDL-59527 forms: Race cond with ajax autocomplete
Sometimes (rarely) the auto complete will show "No suggestions" when there are valid suggestions.
2017-07-14 12:44:50 +08:00
Ankit Agarwal 50769c72ad MDL-54607 calendar: Export 0 duration events properly
Thanks to Paul Prencis for initial suggestion of this patch
2017-07-14 09:36:11 +05:30
Ankit Agarwal bf4f34f276 MDL-54607 calendar: Update benu lib to allow for instantaneous events 2017-07-14 09:36:11 +05:30
Simey Lameze 2abb0ed3a1 MDL-59371 gradereport_overview: allow auth user role to view report 2017-07-12 17:58:00 +08:00
Simey Lameze 97663c81c9 MDL-59371 gradereport_overview: add missing course id to url 2017-07-12 14:33:03 +08:00
Andrew Nicols f3a6c1d383 MDL-59431 requirejs: Prioritise errors 2017-07-12 10:06:36 +08:00
Andrew Nicols b4ebecb7d7 MDL-59431 requirejs: Correct failed JS check 2017-07-12 10:06:36 +08:00
Eloy Lafuente (stronk7) 3336effb72 MDL-56629 dataformat_html: Adding UTF-8 charset
Also adding the HEAD tag which was missing.

(credit goes to Frédéric Massart - FMCorz, thanks!)
2017-07-11 13:55:04 +02:00
Eloy Lafuente (stronk7) 3b5086345e Merge branch 'MDL-54965-32' of git://github.com/tobiasreischmann/moodle into MOODLE_32_STABLE 2017-07-11 13:41:50 +02:00
David Monllao bb245a5462 Merge branch 'wip-MDL-59363-32' of git://github.com/marinaglancy/moodle into MOODLE_32_STABLE 2017-07-11 12:37:26 +02:00
David Monllao 8a1518fe54 Merge branch 'MDL-59431_32' of git://github.com/timhunt/moodle into MOODLE_32_STABLE 2017-07-11 12:05:53 +02:00
David Monllao 625ec8107e Merge branch 'wip-MDL-59441-32' of git://github.com/marinaglancy/moodle into MOODLE_32_STABLE 2017-07-11 11:41:24 +02:00
Eloy Lafuente (stronk7) 2a5e99e1fa Merge branch 'MDL-57432-32' of git://github.com/danpoltawski/moodle into MOODLE_32_STABLE 2017-07-11 10:19:35 +02:00
Stephen Vickers 6d114ec627 MDL-59490 mod_lti: Prevent text wrapping
Update html_to_text method calls with a width of zero.
2017-07-10 17:29:23 +01:00
AMOS bot 23d8296f6a Automatically generated installer lang files 2017-07-11 00:06:48 +08:00
Dan Poltawski 807a0908fa Merge branch 'wip-MDL-40408-32' of git://github.com/marinaglancy/moodle into MOODLE_32_STABLE 2017-07-10 14:36:54 +01:00
David Monllao e635e8d6fd Merge branch 'MDL-52501-m32' of https://github.com/NeillM/moodle into MOODLE_32_STABLE 2017-07-10 14:39:07 +02:00
Dan Poltawski 56a9e58990 Merge branch 'MDL-59317-m32' of https://github.com/NeillM/moodle into MOODLE_32_STABLE 2017-07-10 13:28:24 +01:00
David Monllao baf675f111 Merge branch 'MDL-58332-32' of git://github.com/ryanwyllie/moodle into MOODLE_32_STABLE 2017-07-10 14:22:22 +02:00
Tobias Reischmann 038a740720 MDL-54965 mod_data: removed unused code in display_add_field()
Since the refactoring towards using the filepicker for file and picture
fields there are several variables, which are set but never read. Thus,
I removed them.
2017-07-10 14:15:31 +02:00
Tobias Reischmann 016c8adf69 MDL-54965 mod_data: Init draft area for empty file/pic fields
When a file or picture field was added with existing records, these
records could not be saved, since the draft area was not created
properly.

Co-authored-by: Jérôme Mouneyrac <mouneyrac>
2017-07-10 14:15:31 +02:00
Dan Poltawski 8543b83fce Merge branch 'wip-MDL-46495-32' of git://github.com/marinaglancy/moodle into MOODLE_32_STABLE 2017-07-10 13:15:22 +01:00
Michael Aherne 6eaed6226e MDL-57991 media: Prevent mediaplayer taking up too much space 2017-07-10 10:23:40 +01:00
Dan Poltawski 379e9f845c MDL-57432 environment: raise Moodle requirement
Due to Moodle 2.7 and Moodle 3.4 not having a common compatible php version
between them to upgrade from Moodle 3.4 from Moodle 2.7 you'll need to upgrade
to a higher version first or upgrade php at the same time as upgrade,
this encourages the former.
2017-07-10 09:22:03 +01:00
Dan Poltawski 342c1613e3 MDL-57432 environment: raise Moodle 3.4 requirements
1) PHP minimum version raised to 7.0.0
2) Intl extension raised from optional to required
2017-07-10 09:22:03 +01:00
Dan Poltawski cc417612da MDL-57432 environment: 3.4 base information
This is a direct copy of the 3.3 branch to
have changes under control easier in next commits.
2017-07-10 09:22:03 +01:00
Ryan Wyllie 118f7f0b8c MDL-58332 message: remove concat in get_popup_notifications sql
Removed the concat to generate the uniqueid field for the popup
notifications data. The concat can't be used directly in the SQL because
the syntax changes between databases. The sql_concat helper can't be
used because it assumes all values are database columns (which they
aren't in this case).

Instead I've just removed the uniqueid field because it isn't required
for the union all to work and the field isn't being used by anything.
This should fixed the compatibility issues between databases.
2017-07-10 02:09:02 +00:00
Eloy Lafuente (stronk7) 23360fd95b Moodle release 3.2.4 2017-07-08 20:43:34 +02:00
AMOS bot 0ed1c5d259 Automatically generated installer lang files 2017-07-08 00:16:24 +08:00
Jake Dallimore 28f52bc329 weekly release 3.2.3+ 2017-07-07 12:10:16 +08:00
Jake Dallimore 8c18772edc Merge branch 'install_32_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_32_STABLE 2017-07-07 12:10:14 +08:00
AMOS bot dd819dbb88 Automatically generated installer lang files 2017-07-07 00:06:39 +08:00
Neill Magill 6ab7d00049 MDL-52501 assign: Fix group submissions without submission record
Based on work by Tim Lock <tim.lock@blackboard.com>

While upgrading to Moodle 2.8 or above it is possible for it to fail if
the site has multiple graded attempts for a user without an associated
submission record. This caused the upgrade to violate the databases
unique key rules.

This same issue could apply to a backup that was created of an
assignment that had this issue, when it is restored into Moodle 2.8 or
later.

This change adds the attempt number from the grade table into the query
that is inserting the new submission record (thanks to Tim). It also
moves the insert query before the latest flag is set on submission
records to ensure that only one has it, without this it is possible that
multiple submission records would be marked as the latest after an
upgrade or restore.
2017-07-06 15:30:22 +01:00
Neill Magill 4f20f1eb43 MDL-59317 message: Message page taking long time to load
The OR clause in these queries used different sets of columns to select
userid which meant that the indexes that included user id could not be
used.

This change splits the query so that each individual part can use one of
the indexes that includes a userid which speeds them up considerably.
2017-07-06 15:30:06 +01:00
Simey Lameze 4c48d88c46 MDL-59456 auth_cas: patch phpCAS auth bypass vulnerability 2017-07-06 09:33:27 +01:00
Jun Pataleta af16b393ea MDL-58651 logstore_database: Set dbhandlesoptions in test page 2017-07-05 23:04:51 +08:00
Dan Poltawski 2dc0dc6293 MDL-57021 passwords: only use unmask field with shared secrets
When a user is entering a password which isn't returned back to them
then its not correct to use the unmask element - this element was
designed for places where we are storing shared secrets.
2017-07-05 12:25:41 +02:00
Eloy Lafuente (stronk7) a3aa1600de Merge branch 'MDL-59398-32-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_32_STABLE 2017-07-05 11:52:42 +02:00
Eloy Lafuente (stronk7) fb629ce56a Merge branch 'MDL-59294-32' of git://github.com/junpataleta/moodle into MOODLE_32_STABLE 2017-07-05 09:44:54 +02:00
Eloy Lafuente (stronk7) 33f31a12d4 Merge branch 'MDL-58286-32' of https://github.com/xow/moodle into MOODLE_32_STABLE 2017-07-05 09:40:55 +02:00
Helen Foster 92033f7e9d MDL-59398 lang: Merge English strings from the en_fix language pack 2017-07-05 09:34:14 +02:00
John Okely 8e28bc402b MDL-58286 enrol_ldap: Pass connection to ldap_paged_results_supported
Thanks to Bianco Veigel for the original patch.
2017-07-05 09:50:10 +08:00
Eloy Lafuente (stronk7) 1cee1602be Merge branch 'MDL-58651_32' of git://github.com/aolley/moodle into MOODLE_32_STABLE 2017-07-05 01:23:39 +02:00
Dani Palou a939a4757f MDL-59068 lesson: Revert MDL-54849
MDL-54859 made the 'wrong jump' setting useless, since clicking 'No' always sends the user to the next page.
2017-07-04 10:34:40 +02:00
Jake Dallimore bea116e2ff Merge branch 'MDL-59380-32' of git://github.com/damyon/moodle into MOODLE_32_STABLE 2017-07-04 16:29:36 +08:00
Marina Glancy 822d05775a MDL-59441 calendar: unittest fix for modules without generators 2017-07-04 11:18:33 +08:00
Marina Glancy 106eb4921a MDL-59409 admin: set admin user in unittest 2017-07-04 11:05:24 +08:00
Ankit Agarwal bc1d916868 MDL-56565 forum: Add sitename as heading when there is nothing to display 2017-07-04 10:11:39 +08:00
Ankit Agarwal a053131595 MDL-56565 forum: Make sure userfullname is not disclosed 2017-07-04 10:11:39 +08:00
Jake Dallimore f3b9685ad0 MDL-56565 navigation: fix for cap checks in nav and context header
Fix to:
- Make sure we properly check both user and course contexts in
the load_for_user function in navigation lib and user the
user_can_view_profile function for same-course access checks.
- Use user_can_view_profile in the renderer's context_header to
properly decide whether a user can view another user's picture
and messaging options in the page header.
2017-07-04 10:11:39 +08:00
Jake Dallimore 93e09909ab MDL-56565 navigation: fix user details disclosure in nav tree
Fixes a bug in which a user's full name might be disclosed via the
nav tree. Nav generation now checks the current user's access to the
user before adding the node, else adds a dummy node.
2017-07-04 10:11:39 +08:00
Jake Dallimore f373c08314 MDL-56565 core: fix user details disclosure in page context header
Fixes a bug with context_header function in which user details were
displayed regardless of the current user's capabilities.
2017-07-04 10:11:39 +08:00
Marina Glancy dacac4d10b MDL-59409 admin: check access to every setting in category 2017-07-04 10:03:42 +08:00
Tim Hunt e526050151 MDL-59431 requirejs: better reporting if a JS file cannot be loaded 2017-06-30 17:26:14 +01:00
Marina Glancy 57e71a0f92 MDL-46495 tool_uploadcourse: set enablecompletion to default 2017-06-30 10:26:13 +08:00
Jake Dallimore 35d1b3da7a weekly release 3.2.3+ 2017-06-29 16:23:47 +08:00
Jake Dallimore a52742dea7 Merge branch 'install_32_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_32_STABLE 2017-06-29 16:23:46 +08:00
Marina Glancy b235d79cff MDL-59411 course: display access restriction in access error message 2017-06-29 13:47:47 +08:00
Jun Pataleta ffd642a654 MDL-59294 block_login: Make display of ID provider buttons consistent 2017-06-29 09:36:56 +08:00
Marina Glancy 9995cdb506 MDL-58362 registration: correctly retrieve registration values 2017-06-29 08:32:03 +08:00
Mark Nelson dbbbf02dc0 MDL-56046 mod_quiz: do not close the sheet twice 2017-06-28 14:15:36 +08:00
Jun Pataleta e29ea1b2c9 MDL-59294 theme_bootstrapbase: Fix display of ID provider buttons 2017-06-28 13:39:02 +08:00
Jake Dallimore 74accbdd85 Merge branch 'wip-MDL-59308-32' of git://github.com/marinaglancy/moodle into MOODLE_32_STABLE 2017-06-28 13:10:16 +08:00
Adam Olley eea5900c13 MDL-58651 logstore_database: Add ability to not send database options
In the core dml:
PostgreSQL connections now use advanced options to reduce connection overhead.
These options are not compatible with some connection poolers. The
dbhandlesoptions parameter has been added to allow the database to configure
the required defaults.

This item adds a setting to the logstore_database plugin to let you set the
same flag for your destination database - without it you won't be able to ship
logs to a postgresql database with a pgbouncer frontend.
2017-06-28 13:20:36 +09:30
Marina Glancy c204ffed0d MDL-59363 mod_workshop: user object must have alternative name fields 2017-06-28 11:37:17 +08:00
Marina Glancy 01005ff69a MDL-59308 calendar: pass module context when known
this will protect us from exceptions when context for removed instance can not be retrieved
2017-06-28 11:18:03 +08:00
Eloy Lafuente (stronk7) ee3ba0c3f8 Merge branch 'MDL-57809-32-progressbar' of https://github.com/roperto/moodle into MOODLE_32_STABLE 2017-06-27 20:17:55 +02:00
Eloy Lafuente (stronk7) 5bbc58a7fb Merge branch 'wip-MDL-59136-32' of git://github.com/marinaglancy/moodle into MOODLE_32_STABLE 2017-06-27 18:09:50 +02:00
David Monllao c6a447f1b7 Merge branch 'MDL-32151-32' of git://github.com/junpataleta/moodle into MOODLE_32_STABLE 2017-06-27 17:47:47 +02:00
Eloy Lafuente (stronk7) 2584ce25c7 Merge branch 'MDL-59362_32' of git://github.com/markn86/moodle into MOODLE_32_STABLE 2017-06-27 17:22:11 +02:00
Danny Jung 2dd87cb37a MDL-59073 Workshop: Prevent submission without content or file 2017-06-27 17:06:02 +02:00
David Monllao 53456587f6 Merge branch 'MDL-59158-32' of git://github.com/junpataleta/moodle into MOODLE_32_STABLE 2017-06-27 16:40:07 +02:00
David Monllao b9874d0c13 Merge branch 'MDL-57927-32' of git://github.com/lameze/moodle into MOODLE_32_STABLE 2017-06-27 15:55:40 +02:00
Eloy Lafuente (stronk7) bf58adf836 Merge branch 'MDL-58844-32' of git://github.com/andrewnicols/moodle into MOODLE_32_STABLE 2017-06-27 11:42:22 +02:00
Eloy Lafuente (stronk7) afeb42ed9e Merge branch 'MDL-59296-32' of git://github.com/crazyserver/moodle into MOODLE_32_STABLE 2017-06-27 11:40:10 +02:00
Jake Dallimore 52cabc8f66 Merge branch 'MDL-59312-32' of https://github.com/xow/moodle into MOODLE_32_STABLE 2017-06-27 15:10:41 +08:00
Damyon Wiese 4197baf775 MDL-59380 fragments: Include js from templates
Mustache templates containing {{#js}} blocks are not returned via the
fragments API. This is because the requirements manager is assigned when the renderer is created
and not updated by the call to start collecting page requirements.
2017-06-27 13:35:40 +08:00
Jake Dallimore ba9f218e17 Merge branch 'MDL-56046_32-fix' of git://github.com/markn86/moodle into MOODLE_32_STABLE 2017-06-27 13:18:50 +08:00
Mark Nelson 32dc9a45d6 MDL-56046 dataformat: minor changes to PHPDocs and upgrade.txt 2017-06-27 11:26:35 +08:00
Andrew Nicols 8c696ccafc MDL-58844 testing: Move to GCE build infrastructure
Switch back to GCE build infrastructure for Travis Builds and move
databases to RAM Disk.

This also adds a software entropy generator (haveged) which is
recommended when using a RAMdisk for the database.
2017-06-27 09:39:20 +08:00
Eloy Lafuente (stronk7) 0bfbdaef20 Merge branch 'MDL-56046_32' of git://github.com/markn86/moodle into MOODLE_32_STABLE 2017-06-27 02:43:00 +02:00
Eloy Lafuente (stronk7) 55fc1104d5 Merge branch 'MDL-40818-32' of git://github.com/junpataleta/moodle into MOODLE_32_STABLE 2017-06-27 01:50:48 +02:00
Eloy Lafuente (stronk7) 7032ff37b7 Merge branch 'MDL-59295-32' of git://github.com/lameze/moodle into MOODLE_32_STABLE 2017-06-27 00:54:25 +02:00
Eloy Lafuente (stronk7) 1d0867ae48 Merge branch 'mdl58813-moodle32' of https://github.com/tlock/moodle into MOODLE_32_STABLE 2017-06-26 19:38:51 +02:00
Mark Nelson 4e50a38018 MDL-56046 core: enable multiple sheets for flexible table 2017-06-26 13:55:21 +08:00
Mark Nelson a54703d88f MDL-56046 dataformat: added related information to upgrade.txt 2017-06-26 13:55:21 +08:00
Mark Nelson 4ba0709401 MDL-56046 dataformat_*: convert core plugins 2017-06-26 13:28:02 +08:00
Mark Nelson f72bc10fe3 MDL-56046 core: convert download_as_dataformat to use new API 2017-06-26 13:28:02 +08:00
Mark Nelson b15859b879 MDL-56046 core_dataformat: added functions to support multiple sheets
Also removed write_header() and write_footer(). The reason for this
is because in core we want to know if the format being used supports
multiple sheets. To do this, and ensure we do not break third-party
dataformat plugins, we are using method_exist(). If write_header()
and write_footer() remain in the base class then this will always
be true.
2017-06-26 13:19:09 +08:00
Mark Nelson ed248331a4 MDL-59362 core: ensure we use 'new' when throwing exceptions 2017-06-26 13:10:43 +08:00
Marina Glancy 5b8ca7ac93 MDL-59136 roles: avoid double escaping in role names 2017-06-26 11:57:49 +08:00
Jake Dallimore 0efb93bbe9 Merge branch 'MDL-49484-moodle32' of github.com:jebarviabb/moodle into MOODLE_32_STABLE 2017-06-26 10:52:49 +08:00
Josh Ebarvia f3008f556c MDL-49484 mod_lesson: Fix lesson page headers when editing 2017-06-24 05:23:16 +09:30
AMOS bot aac5a4f103 Merge branch 'MOODLE_32_STABLE' into install_32_STABLE 2017-06-24 00:09:03 +08:00
Pau Ferrer Ocaña e5881ad801 MDL-59296 data: Fix latlong field search 2017-06-23 09:15:31 +02:00
Andrew Nicols c244743775 MDL-59312 js: Improve display of exception stacktrace 2017-06-23 10:50:11 +08:00
John Okely deb442a293 MDL-59312 notification: Normalise backtrace/stacktrace 2017-06-23 10:50:11 +08:00
Andrew Nicols 93a935049e MDL-59312 js: Add exception on AJAX error 2017-06-23 10:50:11 +08:00
Jun Pataleta f2fb8f5a7f MDL-32151 group: Use appropriate error langstring error key 2017-06-23 10:28:13 +08:00
Jun Pataleta 3a5ae742f1 MDL-32151 grade: Use appropriate error langstring error key 2017-06-23 10:28:13 +08:00
Jun Pataleta 017d8f1aec MDL-59158 theme_boost: Remove auto width and height for user picture 2017-06-23 10:13:00 +08:00
Jun Pataleta 95e1ac08fe MDL-40818 calendar: Require login to calendar pages
* Make sure that the course ID being passed points to an existing course
* Require user to login before granting access to calendar pages.
2017-06-23 09:21:05 +08:00
Daniel Thee Roperto ef43566698 MDL-57809 weblib: Added missing NO_OUTPUT_BUFFERING directive. 2017-06-23 09:42:37 +10:00
Daniel Thee Roperto d33f7642dd MDL-57809 weblib: Added opening disclaimer and file-level phpdocs. 2017-06-23 09:42:37 +10:00
Daniel Thee Roperto a9a72025b6 MDL-57809 weblib: Progress bar and output buffer - added debugging
This fix makes Moodle show a debbuging message if using progressbar without defining NO_OUTPUT_BUFFERING.
2017-06-23 09:42:37 +10:00
AMOS bot 222189cc75 Automatically generated installer lang files 2017-06-23 00:08:05 +08:00
Dan Poltawski 62c58d22be weekly release 3.2.3+ 2017-06-22 15:40:47 +01:00
Simey Lameze b962ac2439 MDL-59295 tool_lp: remove useless ng-label attribute 2017-06-22 15:49:46 +08:00
Tim Lock c2f08942d9 MDL-58813 webservice: create_courses() initialise all section records 2017-06-22 11:13:38 +09:30
Eloy Lafuente (stronk7) 9072b59c0e Merge branch 'MDL-59217-32' of git://github.com/ryanwyllie/moodle into MOODLE_32_STABLE 2017-06-20 20:40:45 +02:00
Eloy Lafuente (stronk7) f86bb360b5 Merge branch 'MDL-59269-32-languninstall' of git://github.com/mudrd8mz/moodle into MOODLE_32_STABLE 2017-06-20 17:57:15 +02:00
Mathieu Petit-Clair 90e86c7568 MDL-58952 admin: use valid default for language selection dropdown. 2017-06-20 11:31:55 +01:00
Dan Poltawski f730eb2a81 Merge branch 'MDL-59005-32' of git://github.com/lameze/moodle into MOODLE_32_STABLE 2017-06-20 09:52:46 +01:00
Dan Poltawski 485decb3a2 Merge branch 'MDL-58472-32' of git://github.com/damyon/moodle into MOODLE_32_STABLE 2017-06-20 09:36:53 +01:00
Jun Pataleta b95a012124 Merge branch 'MDL-57770-32' of git://github.com/lameze/moodle into MOODLE_32_STABLE 2017-06-20 16:28:31 +08:00
Jake Dallimore f7e3be1bbb Merge branch 'wip-MDL-58729-32' of git://github.com/abgreeve/moodle into MOODLE_32_STABLE 2017-06-20 15:19:13 +08:00
Simey Lameze 5a5efa8bd9 MDL-57927 tool_lp: make both buttons consistent 2017-06-20 08:50:32 +08:00
Dan Poltawski 079c73c98d Merge branch 'MDL-59048_32' of https://github.com/timhunt/moodle into MOODLE_32_STABLE 2017-06-19 15:43:19 +01:00
Dan Poltawski 3fb4b3a9ed Merge branch 'MDL-59173-32' of git://github.com/tobiasreischmann/moodle into MOODLE_32_STABLE 2017-06-19 12:27:45 +01:00
Dan Poltawski c7d6a0e356 Merge branch 'wip-MDL-51917-32' of git://github.com/marinaglancy/moodle into MOODLE_32_STABLE 2017-06-19 12:21:50 +01:00
Dan Poltawski 8b57dd0768 Merge branch 'MDL-46418-32-hiddenrepos' of git://github.com/mudrd8mz/moodle into MOODLE_32_STABLE 2017-06-19 10:33:34 +01:00
Jun Pataleta 97d966df08 Merge branch 'MDL-44961-32' of git://github.com/ankitagarwal/moodle into MOODLE_32_STABLE 2017-06-19 16:25:18 +08:00
Jun Pataleta fe67ec46da Merge branch 'MDL-58310-32' of https://github.com/xow/moodle into MOODLE_32_STABLE 2017-06-19 13:26:46 +08:00
John Okely 285e7e5eb3 MDL-58310 ajax: suppress errors upon page unload 2017-06-19 11:45:45 +08:00
John Okely 53e3825619 MDL-58310 message: No longer need to supress errors from messaging 2017-06-19 11:45:45 +08:00
Vladimir Zhirov 90156e427c MDL-59005 resource: fixed zip extraction for filenames in CP-1251/CP-866 2017-06-19 08:51:19 +08:00
David Mudrák 5074849703 MDL-59269 lang: Fix ability to uninstall certain language packs
In the issue MDL-39319 (6ddf92c77), the ability to uninstall multiple
language packs at once was added. By a mistake, the PARAM_ALPHAEXT was
used as paramater type for the dash-separated list of language packs to
be uninstalled. Language packs with a number in the name (such as
en_us_k12) do not pass the ALPHAEXT cleaning.

This patch changes the parameter cleaning to PARAM_SAFEPATH which is
more appropriate for the given scenario as language code themselves must
be SAFEDIRs.
2017-06-16 14:15:31 +02:00
Tobias Reischmann c5a8568799 MDL-59173 tablelib.php: changed default of $params in set_sql to array()
Default of $params = null leads to a problem in query_db().
There this value is used in array_merge, which can not handle null
values. If null is passed for one of the params the outcome will be null
independent of the value of the second param!
2017-06-16 10:27:21 +02:00
Jake Dallimore ab7056032d weekly release 3.2.3+ 2017-06-16 13:29:36 +08:00
David Mudrák 0d063c69ac MDL-46418 repositories: Fix how enabled repositories are populated
Repository instances are stored in the 'repository' table. Repositories
in the table are either 'Enabled and visible' or 'Enabled but hidden'.
Hidden repositories still serve their files, but are not visible in the
filepicker UI. Disabling a repository instance removes its record from
the table.

In the original implementation of the plugin manager (see b9934a17), the
method plugintype_repository::get_enabled_repositories() correctly
returned all records from the repository table. Then as a part of the
bigger refactoring in MDL-41437, the commit bde002b8 replaced the
original method with the new get_enabled_plugins() one which started to
return visible repositories only.

As a consequence, the admin tree stopped populating setting page nodes
for hidden repository instances. So attempting to visit their setting
page threw a section error. Credit goes to Ike Quigley for debugging and
tracing this down.

This patch fixes the way how the list of enabled repositories is
populated by the plugin manager so that both visible and hidden
repositories are returned again. This does not affect the filepicker
itself as it is using its own methods for obtaining the list.
2017-06-15 21:22:48 +02:00
Simey Lameze ac6ab5b8d2 MDL-57770 tool_lp: style fixes for the competency rule dialog 2017-06-15 15:39:17 +08:00
Ankit Agarwal 74fbdebd0d MDL-59217 restore: Check for userride only for activity events 2017-06-15 06:02:38 +00:00
Mark Nelson e523626603 MDL-59140 core: apply limit only on courses to be shown in specific nav
There can be a different number of courses displayed in the
'Navigation' block and in the 'Flat' navigation. This patch
decides what courses we want to display on each, then
applies the 'navcourselimit' setting individually.
2017-06-15 13:36:35 +08:00
Ankit Agarwal c33e03ae95 MDL-44961 logs: Keep log dates constant during restore 2017-06-14 15:21:36 +05:30
Jake Dallimore b3f3c3c395 Merge branch 'MDL-59142-32' of git://github.com/lameze/moodle into MOODLE_32_STABLE 2017-06-14 11:40:13 +08:00
Marina Glancy d2a5e259b7 MDL-40408 mod_data: skip metadata fields during import 2017-06-14 11:32:14 +08:00
Dan Poltawski 072c0b4196 Merge branch 'MDL-59171-32' of git://github.com/junpataleta/moodle into MOODLE_32_STABLE 2017-06-13 14:40:47 +01:00
Dan Poltawski 638aa54cbb Merge branch 'MDL-59140_32' of git://github.com/markn86/moodle into MOODLE_32_STABLE 2017-06-13 13:23:39 +01:00
Mark Nelson 8d9e621f2c MDL-59140 core: upgrade 'navcourselimit' if set to old default value 2017-06-13 18:27:04 +08:00
Mark Nelson bb3956eb5c MDL-59140 core: limit the number of courses shown in the navigation
If the user is enrolled in more courses than the limit then a 'More...'
link is displayed which takes the user to the course/index.php page.
2017-06-13 18:27:04 +08:00
Mark Nelson a8fc3a33ab MDL-59140 core: changes to the 'navcourselimit' setting
Changed the default and description.
2017-06-13 18:23:52 +08:00
Eloy Lafuente (stronk7) 2c6f3befeb Merge branch 'wip-MDL-58523-32' of git://github.com/marinaglancy/moodle into MOODLE_32_STABLE 2017-06-13 11:21:48 +02:00
Jun Pataleta d11850101e Merge branch 'MDL-58991-32' of git://github.com/lameze/moodle into MOODLE_32_STABLE 2017-06-14 16:56:36 +08:00
Dan Poltawski 531c1ec0be Merge branch 'MDL-41426_32-block-completionstatus-spaces' of https://github.com/lucaboesch/moodle into MOODLE_32_STABLE 2017-06-13 09:53:56 +01:00
Eloy Lafuente (stronk7) 8ae8ed4aca MDL-46322 database: alias sort fields to avoid ambiguous naming 2017-06-13 09:17:08 +01:00
Jake Dallimore 1faba07075 Merge branch 'MDL-58136-32' of git://github.com/damyon/moodle into MOODLE_32_STABLE 2017-06-13 15:55:45 +08:00
Damyon Wiese 587b99609d MDL-58136 course: Remove lines from unit test
Remove unused vars and logic from the unit test for classifying a course.
2017-06-13 15:08:18 +08:00
Marina Glancy c9192ffccb MDL-51917 course completion: order activities in reports
Thanks to Nick Phillips for initial patch
2017-06-13 14:49:24 +08:00
Marina Glancy 4290182491 MDL-58523 mod_feedback: deleting response should reset completion 2017-06-13 14:36:35 +08:00
Jake Dallimore cb1c0ae4dc Merge branch 'MDL-51691-moodle32' of https://github.com/jebarviabb/moodle into MOODLE_32_STABLE 2017-06-13 10:35:37 +08:00
Damyon Wiese ffc7fda945 MDL-58136 navigation: Ensure we have all course fields
To properly classify courses we need the start/end dates etc.
2017-06-13 10:10:22 +08:00
Marcus Green a9ba142326 MDL-58248 theme_boost: label/span for sidepanel expand button
Add string "Side panel" to make the purpose of
trigram/hamburger icon at top left clearer, particularly
when using screen readers e.g. Jaws/NVDA.
Currently it reads out only "expand"
2017-06-13 09:51:07 +08:00
Simey Lameze 59527f3e7a MDL-59142 core_theme: cache post-processed css
Thanks Cameron Ball for the base patch
2017-06-13 09:39:56 +08:00
Damyon Wiese 8122557661 MDL-58472 videojs: Force manual initialise
If we let videojs auto-init the video/audio tags present in the page - we cannot guarantee that the
youtube library will be loaded by the time video.js is processing the tag.

Video.js uses the presence of a data-setup attibute to signal that it should auto-init this tag, so
we have to rename our config attribute to something else.
2017-06-13 09:13:07 +08:00
Eloy Lafuente (stronk7) ae84db35c7 Merge branch 'MDL-40015-32' of git://github.com/jleyva/moodle into MOODLE_32_STABLE 2017-06-13 01:23:52 +02:00
Eloy Lafuente (stronk7) ab8b6fae1a Merge branch 'mdl58161-moodle32' of https://github.com/tlock/moodle into MOODLE_32_STABLE 2017-06-13 01:22:09 +02:00
Josh Ebarvia b3ca553f3a MDL-51691 assignsubmission_feedback: Fix delete comments 2017-06-13 08:39:08 +09:30
Tim Lock 7e31bb6dc2 MDL-58161 user: tests: user_can_view_profile fails under certain cases 2017-06-13 08:09:14 +09:30
Eloy Lafuente (stronk7) 5e39900691 Merge branch 'MDL-59112-32' of git://github.com/jleyva/moodle into MOODLE_32_STABLE 2017-06-12 14:39:22 +02:00
Dan Poltawski a4f5cdddcf Merge branch 'mdl46322-moodle32' of https://github.com/AndresMelo/moodle into MOODLE_32_STABLE 2017-06-12 10:29:53 +01:00
Damyon Wiese 4d26fcd737 MDL-58136 cache: Add a course completion cache
The last change added 1 db read per course per page which is not OK. Add a cache to compensate.
2017-06-12 16:11:52 +08:00
Damyon Wiese 11127354db MDL-58136 boost: Limit courses in flatnav
Only show "in-progress" courses in the boost flat navigation (as per the myoverview block).
2017-06-12 16:09:56 +08:00
Adrian Greeve f751b97393 MDL-58729 database: Improve performance of CLI tool.
Imporve the speed with which mysql_collation converts to
a different collation.
2017-06-12 14:15:34 +08:00
Jake Dallimore 9265a5db56 Merge branch 'MDL-57103-32' of https://github.com/xow/moodle into MOODLE_32_STABLE 2017-06-12 13:59:57 +08:00
Jun Pataleta f5942f3e6f Merge branch 'MDL-59154-32' of git://github.com/andrewnicols/moodle into MOODLE_32_STABLE 2017-06-12 13:45:33 +08:00
John Okely 3ad8f33235 MDL-57103 lib: Force ajax renderer for all ajax fatal errors 2017-06-12 10:37:37 +08:00
Jun Pataleta abeb033dfb MDL-59171 mod_lti: Set mod_lti_view_lti's type to 'read' 2017-06-12 08:34:52 +08:00
Tim Lock bb4b394482 MDL-55979 quiz: Fix error moving question from last page
When moving the last question from the last page to the last slot of the previous page would show the error in the error
log but move successfully.
2017-06-09 08:35:38 +09:30
Luca Bösch 98b955d665 MDL-41426 block: Whitespace lacking in completion status block 2017-06-08 19:10:21 +02:00
Dan Poltawski 7624f86fb2 weekly release 3.2.3+ 2017-06-08 12:16:21 +01:00
Dan Poltawski 7f4835a7da Merge branch 'install_32_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_32_STABLE 2017-06-08 12:16:20 +01:00
Juan Leyva ba76815aaf MDL-40015 core_course: Fix description of duplicate_course WS
It said that the duplication didn’t include user data, but that’s not
true since there is a parameter to include it.
2017-06-08 10:20:46 +01:00
Juan Leyva 70dcc1e39a MDL-59112 theme_clean: Always return expected moodle_url
The function was returned some times a moodle_url object and another
times just a string with a relative URL.
2017-06-08 09:40:47 +01:00
Andrew Nicols 25ffa9a67f MDL-59154 theme: Lock for all caching builds
The previous behaviour was to only lock when in theme designer mode.
As a result, when generating the theme for after a reset, each new
client was starting the generation afresh and no locking was taking
place at all.
2017-06-08 12:05:39 +08:00
Dan Poltawski 99864cdf74 Merge branch 'MDL-59101-32' of git://github.com/junpataleta/moodle into MOODLE_32_STABLE 2017-06-07 16:26:21 +01:00
Jun Pataleta d356128f05 MDL-59101 calendar: Properly calculate expected until date 2017-06-07 23:12:52 +08:00
Dan Poltawski c33c78a33c Merge branch 'MDL-58658_32' of https://github.com/sk-unikent/moodle into MOODLE_32_STABLE 2017-06-06 10:01:44 +01:00
Dan Poltawski 3ec562a322 Merge branch 'MDL-59086_32' of git://github.com/markn86/moodle into MOODLE_32_STABLE 2017-06-06 08:44:52 +01:00
Simey Lameze 07e6a3c6c1 MDL-58991 report_stats: use same date handling on chart rendering
This commmit fixes applies the same date handling used on stats
table render to the charts render.
2017-06-06 13:56:04 +08:00
Jun Pataleta 5ec875b281 Merge branch 'MDL-58646-32' of git://github.com/danpoltawski/moodle into MOODLE_32_STABLE 2017-06-06 12:24:46 +08:00
Jake Dallimore a202546fd3 Merge branch 'MDL-58900-32' of git://github.com/lameze/moodle into MOODLE_32_STABLE 2017-06-06 11:40:12 +08:00
Eloy Lafuente (stronk7) 589b4c0360 Merge branch 'MDL-58826_32_STABLE' of https://github.com/marxjohnson/moodle into MOODLE_32_STABLE 2017-06-06 01:45:17 +02:00
Dan Poltawski 5f6cf92f97 Merge branch 'MDL-59080_M32' of git://github.com/lazydaisy/moodle into MOODLE_32_STABLE 2017-06-05 12:49:48 +01:00
Mark Johnson 43391de3e2 MDL-58826 theme_boost: Prevent fatal errors in action menu behat steps 2017-06-05 09:04:06 +01:00
AMOS bot fbf621bd29 Automatically generated installer lang files 2017-06-04 00:07:23 +08:00
AMOS bot 5a10b55442 Automatically generated installer lang files 2017-06-04 00:07:23 +08:00
AMOS bot 554167b43a Automatically generated installer lang files 2017-06-03 00:07:58 +08:00
Dan Poltawski c90e9381d2 MDL-58646 lib: import latest sabberworm/PHP-CSS-Parser
This version includes a fix[1] contributed by Frédéric Massart investigating
our compilation time issues, which significantly improves the speed of
processing font awesome.

Thanks, Fred!

[1] https://github.com/sabberworm/PHP-CSS-Parser/pull/120
2017-06-02 11:03:51 +01:00
Mary Evans 8ac3e5ea59 MDL-59080 theme_boost: make drawer.scss variables default
--author="Urs Hunkler <urs.hunkler@unodo.de>"
2017-06-02 07:58:43 +01:00
Dan Poltawski 74554368a0 weekly release 3.2.3+ 2017-06-01 09:28:23 +01:00
Dan Poltawski 6f4d9a89d5 Merge branch 'install_32_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_32_STABLE 2017-06-01 09:28:22 +01:00
Jake Dallimore 7fd70c34a0 Merge branch 'MDL-59094-32' of git://github.com/danpoltawski/moodle into MOODLE_32_STABLE 2017-06-01 15:29:15 +08:00
AMOS bot a31c6bc4b9 Automatically generated installer lang files 2017-06-01 00:12:41 +08:00
Dan Poltawski 6160631e28 Merge branch 'MDL-59093-32' of git://github.com/junpataleta/moodle into MOODLE_32_STABLE 2017-05-31 11:09:27 +01:00
Dan Poltawski c82ad7c6e0 MDL-59094 npm: Update shrinkwrap file to npm 5 generated
Starting with npm version 5, npm install will generate a lockfile
(now named package-lock.json) or update the existing npm-shrinkwrap.json

To prevent changes being generated in the codebase when this happens, we
need to commit the version 5 generated shrinkwrap.

This is related to a general overhaul [1] of how npm manages things. But
for our purposes, we the lockfile should be BC to previous versions [2].

Going forward, we need to ensure we generate the lockfile on npm >=5 to
prevent differences from the previously un-versioned lockfile.

[1] http://blog.npmjs.org/post/161081169345/v500
[2] https://github.com/npm/npm/issues/16728#issuecomment-305104149
2017-05-31 10:13:45 +01:00
Jun Pataleta 087ab1e345 MDL-59093 calendar: Use a fixed start day for forever BYMONTH test 2017-05-31 15:02:15 +08:00
Simey Lameze f7c9dd2158 MDL-58900 mod_assign: fix incorrect overrides ordering 2017-05-31 10:51:01 +08:00
Jake Dallimore 984bcd770c Merge branch 'MDL-54887-32' of git://github.com/junpataleta/moodle into MOODLE_32_STABLE 2017-05-31 08:40:43 +08:00
Eloy Lafuente (stronk7) e84d284e65 Merge branch 'MDL-49988_fix_wiki_preview_32_STABLE' of https://github.com/DMaterka/moodle into MOODLE_32_STABLE 2017-05-31 00:30:45 +02:00
Dan Poltawski 352b9b00d6 Merge branch 'MDL-58997_32-group-names-multilang' of https://github.com/lucaboesch/moodle into MOODLE_32_STABLE 2017-05-30 16:56:23 +01:00
Luca Bösch 2a7bb7a0f8 MDL-58997 calendar: Group names passing multilang filters. 2017-05-30 16:52:07 +02:00
Dan Poltawski 269e1f027e Merge branch 'MDL-49040-moodle32' of https://github.com/jebarviabb/moodle into MOODLE_32_STABLE 2017-05-30 11:42:35 +01:00
Jun Pataleta 48903d67ea Merge branch 'MDL-57313-32-clibootswatch' of git://github.com/mudrd8mz/moodle into MOODLE_32_STABLE 2017-05-30 16:58:15 +08:00
Jun Pataleta 3bfdb64f43 MDL-54887 calendar: PR fixes
* Use the calendar_event::description property and format it using
format_text() on it in order to apply the appropriate filters.
* Then use html_to_text() on it to strip the tags and convert the
description to plain text while converting <br> and <p> tags to
line breaks.
2017-05-30 16:53:57 +08:00
Soon-Systems a42233487e MDL-54887 calendar: Format summary + description of an event for export 2017-05-30 16:53:57 +08:00
Mark Nelson 07da0155a7 MDL-59086 gradereport_grader: style 'Save changes' button 2017-05-30 13:44:15 +08:00
AMOS bot 1a7cf17ed8 Automatically generated installer lang files 2017-05-28 14:07:41 +08:00
David Mudrák 818bc4c9a7 MDL-57313 boost: Fix the CLI utility import-bootswatch.php 2017-05-26 09:48:28 +02:00
Dan Poltawski 8708ea0968 weekly release 3.2.3+ 2017-05-24 19:14:43 +01:00
Dan Poltawski cdffe52b28 Merge branch 'install_32_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_32_STABLE 2017-05-24 19:14:41 +01:00
Tim Hunt 67970b8675 MDL-59048 user tours: avoid white-on-white text in Clean 2017-05-24 17:25:23 +01:00
AMOS bot d979b4614d Automatically generated installer lang files 2017-05-25 00:04:44 +08:00
gthomas2 3aed71750d MDL-58761 behat: Fix regex in i_open_my_profile_in_edit_mode step 2017-05-24 13:57:54 +01:00
Andrew Nicols 85eacc3a31 MDL-58577 stats: Correct groupby when getting report options 2017-05-23 19:46:55 +08:00
Andrew Nicols bfc16e66a5 Merge branch 'MDL-58577_32-statistics-report-header-multilang' of https://github.com/lucaboesch/moodle into MOODLE_32_STABLE 2017-05-23 19:45:56 +08:00
Luca Bösch 3a8f07f241 MDL-58577 stats: Use multilang with role in header 2017-05-23 11:14:09 +02:00
Jun Pataleta e621a47c48 Merge branch 'MDL-58895-32' of git://github.com/ankitagarwal/moodle into MOODLE_32_STABLE 2017-05-23 16:54:35 +08:00
Jake Dallimore 4bb9787760 Merge branch 'MDL-58921_32-calculated-question-name-multilang' of https://github.com/lucaboesch/moodle into MOODLE_32_STABLE 2017-05-23 16:27:06 +08:00
Jun Pataleta 2469a838f1 Merge branch 'MDL-58165-32' of https://github.com/abias/moodle into MOODLE_32_STABLE 2017-05-23 14:47:38 +08:00
Ankit Agarwal c28e5eaee2 MDL-58895 groups: Add bootstrap classes to buttons 2017-05-23 12:05:42 +05:30
Alexander Bias f85f0c80da MDL-58165 navigation: Add node key to private files navigation node 2017-05-23 07:24:11 +02:00
Josh Ebarvia 4643358a5c MDL-49040 gradereport_grader: Fix feedback truncation after & char 2017-05-23 13:04:23 +09:30
AMOS bot 2774649389 Automatically generated installer lang files 2017-05-23 00:05:47 +08:00
Dan Poltawski 18d41005e3 Merge branch 'MDL-58922_32-calculatedmulti-question-name-multilang' of https://github.com/lucaboesch/moodle into MOODLE_32_STABLE 2017-05-22 10:44:52 +01:00
Luca Bösch a281621189 MDL-58921 questions: Calculated question name passing multilang.
In edit calculated question the question name does pass format_string to process multilang tags.
2017-05-22 11:37:22 +02:00
Luca Bösch ab8fa2ff7a MDL-58922 questions: Calculatedmulti question name passing multilang.
In edit calculatedmulti question the question name does pass format_string to process multilang tags.
2017-05-22 11:32:52 +02:00
David Monllao fb0e1b10fe Merge branch 'MOODLE_32_STABLE-MDL-56973' of https://github.com/fwsl/moodle into MOODLE_32_STABLE 2017-05-22 15:14:19 +08:00
Jake Dallimore 78f7595fd9 Merge branch 'MDL-56617_32-course-cbm-grade-to-pass' of https://github.com/lucaboesch/moodle into MOODLE_32_STABLE 2017-05-22 14:33:32 +08:00
David Monllao 338097adce Merge branch 'MDL-58986_32' of git://github.com/markn86/moodle into MOODLE_32_STABLE 2017-05-22 12:22:37 +08:00
David Monllao f98e259ddb Merge branch 'MDL-57957_32' of https://github.com/bostelm/moodle into MOODLE_32_STABLE 2017-05-22 10:44:32 +08:00
Luca Bösch 0e106b8332 MDL-56617 mod_quiz: No grade to pass check if CBM used
When certainty-based marking is used, grades can 'exceed' the maximum grade
(because they are multiplied by factors). Therefore, in such cases, don't show
no warning.
2017-05-19 12:43:07 +02:00
Grzegorz Ziółek 25e3a8a14c MDL-56973 wiki: New page title readonly after changing course language 2017-05-19 11:10:41 +02:00
David Monllao 46280f7478 weekly release 3.2.3+ 2017-05-19 13:08:36 +08:00
David Monllao 80bf9ac40a Merge branch 'install_32_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_32_STABLE 2017-05-19 13:08:34 +08:00
Andres e2b4084bfd MDL-46322 mod_assign: Only list enrolled graders as potential markers 2017-05-18 22:22:45 -05:00
Mark Nelson 2a667a0820 MDL-58986 mod_quiz: add CSS classes to buttons on comment page 2017-05-18 16:50:06 +08:00
Andres Melo a4ad655bf1 MDL-46322 mod_assign: Only list enrolled graders as potential markers 2017-05-17 15:54:40 -05:00
AMOS bot 653e23bcc1 Automatically generated installer lang files 2017-05-18 00:07:20 +08:00
Mark Nelson 80d970cd0e MDL-58776 core_tag: removed whitespace from id attribute
This was preventing the JS from finding the element.
2017-05-17 12:13:40 +01:00
Simey Lameze f8962b4270 MDL-58884 core_competency: add exporter required course fields 2017-05-17 15:01:49 +08:00
Jake Dallimore e2f921ea2a Merge branch 'MDL-58947-m32' of https://github.com/sammarshallou/moodle into MOODLE_32_STABLE 2017-05-17 09:16:55 +08:00
Andrew Nicols 3586517ff8 Merge branch 'MDL-58795-moodle32' of https://github.com/jebarviabb/moodle into MOODLE_32_STABLE 2017-05-17 07:05:31 +08:00
Daniel Materka 4e8f93abba MDL-49988 wiki: fix broken page layout if html contains line breaks 2017-05-16 19:00:02 +01:00
Dan Poltawski 164d1e290e Merge branch 'MDL-58776-32' of git://github.com/ankitagarwal/moodle into MOODLE_32_STABLE 2017-05-16 17:49:07 +01:00
AMOS bot 373bd248b9 Automatically generated installer lang files 2017-05-17 00:09:11 +08:00
Henning Bostelmann c6bbd48e23 MDL-57957 mod_assign: show feedback file in absence of grade item 2017-05-16 12:00:46 +01:00
Iñaki Arenaza 4db85a5943 MDL-57558 ldap: fix ldap_get_entries_moodle()
While ldap_get_entries_moodle() PHPdocs state that it returns "array
ldap-entries with lower-cased attributes as indexes.", this is not true. It
uses ldap_get_attributes() internally, which returns both numerically indexed
attribute names, and dictionary-like entries indexed by attribute names.

Current code lowercases the dictionary-like entries, but then uses the
numerically indexed entries for the attribute names used as keys in the
returned array. The numerically indexed names might or might not be lowercased,
depending on the LDAP server and PHP version) version. E.g., OpenLDAP 2.x,
Novell eDirectory 8.x and MS Active Directory return mixed-cased attribute
names, and PHP 5.x and PHP 7.x don't lowercase them inside ldap_get_entries().

This is probably why all calls to ldap_get_entries_moodle() are followed by
calls to array_change_key_case(), even if that shouldn't be necessary.

So make sure we always return lower-cased attributs as indexes and add some
unit tests to avoid regressions in the future.
2017-05-16 10:47:22 +01:00
Jun Pataleta 726fce53e7 Merge branch 'MDL-58811-32-extra-slash' of https://github.com/dmitriim/moodle into MOODLE_32_STABLE 2017-05-16 17:43:14 +08:00
Josh Ebarvia 5607f04f15 MDL-58795 gradereport_grader: Prevent duplicates in grader report
Currently, the sorting being used for the grader report table
(asc/desc arrows) is just the grade_grades.finalgrade.
This adds grade_grades.userid in the sort to prevent duplicate
in records returned when using pages.
2017-05-16 16:56:44 +09:30
Jake Dallimore 5d37f70d68 Merge branch 'MDL-58723-32' of git://github.com/junpataleta/moodle into MOODLE_32_STABLE 2017-05-16 15:17:57 +08:00
Jun Pataleta 163e56dfbb MDL-58723 calendar: Better testing of forever recurring events
* Change the start date of the parent event to the current date
  for tests that with events that recur forever.
* Limit query results to 100 for events that recur forever that can
  generate more than 100 event records.
2017-05-16 14:40:29 +08:00
Andrew Nicols 07f1e2b49c Merge branch 'MDL-58756_32-statslib-roles-multilang' of https://github.com/lucaboesch/moodle into MOODLE_32_STABLE 2017-05-16 13:53:23 +08:00
Luca Bösch 328159027c MDL-58756 stats: Use multilang with role. 2017-05-16 07:28:43 +02:00
Dmitrii Metelkin c6e47712f5 MDL-58811 backup: fix an extra slash on restore for the legacy files 2017-05-16 14:31:05 +10:00
David Monllao 4a1d28e6c6 Merge branch 'MDL-58884-32' of git://github.com/StudiUM/moodle into MOODLE_32_STABLE 2017-05-16 10:41:53 +08:00
Jake Dallimore cbbfaad531 Merge branch 'MDL-58770-32' of https://github.com/IMSGlobal/moodle into MOODLE_32_STABLE 2017-05-16 09:58:42 +08:00
sam marshall bb78b2fd22 MDL-58947 Search: Label URLs not correctly calculated 2017-05-15 17:56:41 +01:00
AMOS bot 021b544c7a Automatically generated installer lang files 2017-05-16 00:07:22 +08:00
Dan Poltawski 71e94edfd8 Merge branch 'MDL-58916-32' of https://github.com/xow/moodle into MOODLE_32_STABLE 2017-05-15 11:01:43 +01:00
Dan Poltawski 37b143aeaf Merge branch 'MDL-58841-32' of git://github.com/cameron1729/moodle into MOODLE_32_STABLE 2017-05-15 10:46:11 +01:00
Dan Poltawski d1e6ca40a0 Merge branch 'MDL-58852_32-choice-chart-options-multilang' of https://github.com/lucaboesch/moodle into MOODLE_32_STABLE 2017-05-15 10:23:05 +01:00
Andrew Nicols d926390fba Merge branch 'MDL-58893-32-missing-div' of https://github.com/dmitriim/moodle into MOODLE_32_STABLE 2017-05-15 15:15:34 +08:00
Andrew Nicols 1dcc39e9a1 Merge branch 'MDL-58920_32-calculated-question-edit-name-multilang' of https://github.com/lucaboesch/moodle into MOODLE_32_STABLE 2017-05-15 14:54:20 +08:00
Dmitrii Metelkin e48bab0b24 MDL-58893 portfolio: add missing closing div 2017-05-15 15:52:52 +10:00
David Monllao bc71da7f50 Merge branch 'MDL-58656-32' of git://github.com/damyon/moodle into MOODLE_32_STABLE 2017-05-15 11:39:39 +08:00
AMOS bot 3739127caf Automatically generated installer lang files 2017-05-14 00:04:48 +08:00
Luca Bösch 4321953314 MDL-58920 questions: Calculated question name passing multilang.
In "Shared wild cards" table calculated question name do pass format_string to process multilang tags.
Thus, not breaking the layout any more.
2017-05-12 18:07:55 +02:00
AMOS bot d69fcc7bc1 Automatically generated installer lang files 2017-05-13 00:04:43 +08:00
Dan Poltawski 723ed522a5 weekly release 3.2.3+ 2017-05-12 10:02:00 +01:00
Dan Poltawski 0d011d9ad3 Merge branch 'install_32_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_32_STABLE 2017-05-12 10:01:59 +01:00
John Okely 15e5a39266 MDL-58916 user_profile: Pass site context when determining menu options 2017-05-12 15:59:48 +08:00
AMOS bot 1a63aaddeb Automatically generated installer lang files 2017-05-12 00:04:33 +08:00
Issam Taboubi ec66fbbeec MDL-58884 competency: Inaccurate stats proficient competencies in course 2017-05-11 11:51:53 -04:00
Skylar Kelty 11580ef62a MDL-58658 caching: Add static acceleration unit test for empty arrays 2017-05-11 11:04:25 +01:00
Skylar Kelty 8afd92382e MDL-58658 caching: Fix static acceleration for empty arrays 2017-05-11 11:04:15 +01:00
AMOS bot cf4753e354 Automatically generated installer lang files 2017-05-11 00:04:44 +08:00
David Monllao ed8c3327fb Merge branch 'MDL-58833-32' of git://github.com/andrewnicols/moodle into MOODLE_32_STABLE 2017-05-10 14:07:59 +08:00
David Monllao 3bd5edccf8 Merge branch 'MDL-58843-32-exchandler' of git://github.com/mudrd8mz/moodle into MOODLE_32_STABLE 2017-05-10 14:06:06 +08:00
Dan Poltawski 01932fa6fa Merge branch 'MDL-58836-32' of git://github.com/damyon/moodle into MOODLE_32_STABLE 2017-05-10 06:57:12 +01:00
Andrew Nicols db8ff4bc78 Merge branch 'MDL-58780-32' of git://github.com/junpataleta/moodle into MOODLE_32_STABLE 2017-05-10 11:49:07 +08:00
Eloy Lafuente (stronk7) 2dced48edf Merge branch 'wip-MDL-58854-32' of git://github.com/marinaglancy/moodle into MOODLE_32_STABLE 2017-05-10 02:09:34 +02:00
AMOS bot 835bc90d7c Automatically generated installer lang files 2017-05-10 00:05:27 +08:00
Dan Poltawski 4d160525d3 weekly release 3.2.3+ 2017-05-09 12:41:47 +01:00
Dan Poltawski b3d4341009 Merge branch 'install_32_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_32_STABLE 2017-05-09 12:41:44 +01:00
Cameron Ball bfa2ed7f6c MDL-58841 mod_assign: Style "view all" link on grading summary 2017-05-09 15:05:58 +08:00
David Mudrák 00fe8e5e3f MDL-58843 core: Do not expect a particular class of the thrown exception
Since PHP 7, the custom exception handlers are also called to handle
thrown Errors which are not Exceptions.
2017-05-09 08:42:53 +02:00
Andrew Nicols 5aeb8b003c Merge branch 'MDL-58822-32' of git://github.com/ryanwyllie/moodle into MOODLE_32_STABLE 2017-05-09 14:16:57 +08:00
Ryan Wyllie d90b7b734c MDL-58822 backup: backup and restore user override events 2017-05-09 05:49:25 +00:00
Jun Pataleta 26aaa71667 MDL-58780 mod_assign: Remove AS keyword in table alias
* The AS keyword is not recognised by Oracle for table aliases.
This is okay with other databases, but optional, so better to
remove it.
2017-05-09 12:00:45 +08:00
Marina Glancy 2265e74a31 MDL-58854 theme_boost: override templates for columns 2017-05-09 10:36:38 +08:00
Damyon Wiese 04f82f5669 MDL-58836 auth: Improve backwards compatibility
Auth plugins with custom signup forms may not be using renderables / renderers - or
even if they are they may return a renderable that can only be rendered with the renderer from the auth
plugin.

This change checks if the signup form is a renderable - if so try the plugin renderer or fall back on the general renderer.
Otherwise call display() from the mform which is the previous way of rendering an mform.
2017-05-09 10:27:39 +08:00
Luca Bösch e4d2487dd2 MDL-58852 choice: Use multilang for choice options in charts 2017-05-08 23:29:40 +02:00
AMOS bot b603370a23 Automatically generated installer lang files 2017-05-09 00:06:57 +08:00
Andrew Nicols 6ed25aee09 MDL-58833 tool_templatelibrary: Skip if directory empty 2017-05-08 15:02:20 +08:00
Jun Pataleta 9fff50ae00 MDL-58810 calendar: Fix rrule_manager issues
* Set the correct repeat ID for the recurring event
* Unset UUID for 'child' events of recurring events
2017-05-08 09:48:46 +08:00
Jun Pataleta 787d1a8f53 MDL-58810 calendar: Add coverage for UUID in recurring events 2017-05-08 09:40:19 +08:00
Ankit Agarwal b84949f618 MDL-58776 tags: Add bootstrap classes to buttons 2017-05-02 12:26:20 +05:30
Stephen Vickers 22227b7701 MDL-58770 mod_lti: Strip HTML from parameters
Remove HTML tags from parameters which should be plain text.
2017-05-01 21:10:40 +01:00
Damyon Wiese 8a33f2a530 MDL-58656 competencies: Fix buggy scale caching
This affects the competency breakdown report in a course.
2017-04-20 13:24:56 +08:00
Daniel Thee Roperto e7d8b8031f MDL-57246 forum: Fixed mod/forum/view.php redirection.
Fixed: Trying to view a forum without the capability may lead you to a broken page.
2017-04-04 16:15:50 +10:00
673 changed files with 14490 additions and 4125 deletions
+28 -5
View File
@@ -2,7 +2,7 @@
# process (which uses our internal CI system) this file is here for the benefit
# of community developers git clones - see MDL-51458.
sudo: false
sudo: required
# We currently disable Travis notifications entirely until https://github.com/travis-ci/travis-ci/issues/4976
# is fixed.
@@ -16,6 +16,12 @@ php:
- 7.1
- 5.6
addons:
packages:
- mysql-server-5.6
- mysql-client-core-5.6
- mysql-client-5.6
services:
- redis-server
@@ -46,12 +52,9 @@ matrix:
fast_finish: true
include:
# Run grunt/npm install on lowest supported npm version
- php: 7.1
env: DB=none TASK=GRUNT NVM_VERSION='4'
# Run grunt/npm install on highest version ('node' is an alias for the latest node.js version.)
- php: 7.1
env: DB=none TASK=GRUNT NVM_VERSION='node'
env: DB=none TASK=GRUNT NVM_VERSION='8.9'
exclude:
# MySQL - it's just too slow.
@@ -70,6 +73,26 @@ cache:
- $HOME/.npm
install:
- >
if [ "$DB" = 'mysqli' ];
then
sudo mkdir /mnt/ramdisk
sudo mount -t tmpfs -o size=1024m tmpfs /mnt/ramdisk
sudo stop mysql
sudo mv /var/lib/mysql /mnt/ramdisk
sudo ln -s /mnt/ramdisk/mysql /var/lib/mysql
sudo start mysql
fi
- >
if [ "$DB" = 'pgsql' ];
then
sudo mkdir /mnt/ramdisk
sudo mount -t tmpfs -o size=1024m tmpfs /mnt/ramdisk
sudo service postgresql stop
sudo mv /var/lib/postgresql /mnt/ramdisk
sudo ln -s /mnt/ramdisk/postgresql /var/lib/postgresql
sudo service postgresql start 9.6
fi
- >
if [ "$TASK" = 'PHPUNIT' ];
then
+1 -1
View File
@@ -89,7 +89,7 @@ if ($PAGE->user_allowed_editing()) {
$savebutton = false;
$outputhtml = '';
foreach ($settingspage->children as $childpage) {
if ($childpage->is_hidden()) {
if ($childpage->is_hidden() || !$childpage->check_access()) {
continue;
}
if ($childpage instanceof admin_externalpage) {
+41 -5
View File
@@ -53,7 +53,7 @@ Options:
-h, --help Print out this help
Example:
\$ sudo -u www-data /usr/bin/php admin/cli/mysql_collation.php --collation=utf8_general_ci
\$ sudo -u www-data /usr/bin/php admin/cli/mysql_collation.php --collation=utf8mb4_unicode_ci
";
if (!empty($options['collation'])) {
@@ -145,9 +145,22 @@ if (!empty($options['collation'])) {
$skipped++;
} else {
$DB->change_database_structure("ALTER TABLE $table->name DEFAULT CHARACTER SET $charset DEFAULT COLLATE = $collation");
echo "CONVERTED\n";
$converted++;
try {
$DB->change_database_structure("ALTER TABLE $table->name CONVERT TO CHARACTER SET $charset COLLATE $collation");
echo "CONVERTED\n";
$converted++;
} catch (ddl_exception $e) {
$result = mysql_set_row_format($table->name, $charset, $collation, $engine);
if ($result) {
echo "CONVERTED\n";
$converted++;
} else {
// We don't know what the problem is. Stop the conversion.
cli_error("Error: Tried to convert $table->name, but there was a problem. Please check the details of this
table and try again.");
die();
}
}
}
$sql = "SHOW FULL COLUMNS FROM $table->name WHERE collation IS NOT NULL";
@@ -190,7 +203,7 @@ if (!empty($options['collation'])) {
$DB->change_database_structure($sql);
} else {
echo "ERROR (unknown column type: $column->type)\n";
$error++;
$errors++;
continue;
}
echo "CONVERTED\n";
@@ -290,3 +303,26 @@ function mysql_get_column_collations($tablename) {
$rs->close();
return $collations;
}
function mysql_set_row_format($tablename, $charset, $collation, $engine) {
global $DB;
$sql = "SELECT row_format
FROM INFORMATION_SCHEMA.TABLES
WHERE table_schema = DATABASE() AND table_name = ?";
$rs = $DB->get_record_sql($sql, array($tablename));
if ($rs) {
if ($rs->row_format == 'Compact' || $rs->row_format == 'Redundant') {
$rowformat = $DB->get_row_format_sql($engine, $collation);
// Try to convert to compressed format and then try updating the collation again.
$DB->change_database_structure("ALTER TABLE $tablename $rowformat");
$DB->change_database_structure("ALTER TABLE $tablename CONVERT TO CHARACTER SET $charset COLLATE $collation");
} else {
// Row format may not be the problem. Can not diagnose problem. Send fail reply.
return false;
}
} else {
return false;
}
return true;
}
+354
View File
@@ -1754,6 +1754,7 @@
<VENDOR name="oracle" version="10.2" />
</DATABASE>
<PHP version="5.6.5" level="required">
<RESTRICT function="restrict_php_version_72" message="unsupportedphpversion72" />
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
@@ -1919,6 +1920,7 @@
<VENDOR name="oracle" version="10.2" />
</DATABASE>
<PHP version="5.6.5" level="required">
<RESTRICT function="restrict_php_version_72" message="unsupportedphpversion72" />
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
@@ -2081,4 +2083,356 @@
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
<MOODLE version="3.4" requires="3.0">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mariadb" version="5.5.31" />
<VENDOR name="mysql" version="5.5.31" />
<VENDOR name="postgres" version="9.3" />
<VENDOR name="mssql" version="10.0" />
<VENDOR name="oracle" version="10.2" />
</DATABASE>
<PHP version="7.0.0" level="required">
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
<ON_CHECK message="pcreunicodewarning" />
</FEEDBACK>
</PCREUNICODE>
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
<ON_ERROR message="iconvrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="optional">
<FEEDBACK>
<ON_CHECK message="mbstringrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_ERROR message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="required">
<FEEDBACK>
<ON_ERROR message="opensslrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="tokenizer" level="optional">
<FEEDBACK>
<ON_CHECK message="tokenizerrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="xmlrpc" level="optional">
<FEEDBACK>
<ON_CHECK message="xmlrpcrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="soap" level="optional">
<FEEDBACK>
<ON_CHECK message="soaprecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="ctype" level="required">
<FEEDBACK>
<ON_ERROR message="ctyperequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zip" level="required">
<FEEDBACK>
<ON_ERROR message="ziprequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zlib" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="gd" level="required">
<FEEDBACK>
<ON_ERROR message="gdrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="simplexml" level="required">
<FEEDBACK>
<ON_ERROR message="simplexmlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="spl" level="required">
<FEEDBACK>
<ON_ERROR message="splrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="pcre" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="dom" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xml" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xmlreader" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="intl" level="required">
<FEEDBACK>
<ON_ERROR message="intlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="json" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="hash" level="required"/>
<PHP_EXTENSION name="fileinfo" level="required"/>
</PHP_EXTENSIONS>
<PHP_SETTINGS>
<PHP_SETTING name="memory_limit" value="96M" level="required">
<FEEDBACK>
<ON_ERROR message="settingmemorylimit" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="file_uploads" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="settingfileuploads" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="opcache.enable" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="opcacherecommended" />
</FEEDBACK>
</PHP_SETTING>
</PHP_SETTINGS>
<CUSTOM_CHECKS>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_storage_engine" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbstorageengine" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="question/engine/upgrade/upgradelib.php" function="quiz_attempts_upgraded" level="required">
<FEEDBACK>
<ON_ERROR message="quizattemptsupgradedmessage" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_slasharguments" level="optional">
<FEEDBACK>
<ON_CHECK message="slashargumentswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_tables_row_format" level="optional">
<FEEDBACK>
<ON_CHECK message="unsupporteddbtablerowformat" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_unoconv_version" level="optional">
<FEEDBACK>
<ON_CHECK message="unoconvwarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_libcurl_version" level="optional">
<FEEDBACK>
<ON_CHECK message="libcurlwarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_format" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbfileformat" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_per_table" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbfilepertable" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_large_prefix" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddblargeprefix" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_is_https" level="optional">
<FEEDBACK>
<ON_CHECK message="ishttpswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_incomplete_unicode_support" level="optional">
<FEEDBACK>
<ON_CHECK message="incompleteunicodesupport" />
</FEEDBACK>
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
<MOODLE version="3.5" requires="3.1">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mariadb" version="5.5.31" />
<VENDOR name="mysql" version="5.5.31" />
<VENDOR name="postgres" version="9.3" />
<VENDOR name="mssql" version="10.0" />
<VENDOR name="oracle" version="10.2" />
</DATABASE>
<PHP version="7.0.0" level="required">
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
<ON_CHECK message="pcreunicodewarning" />
</FEEDBACK>
</PCREUNICODE>
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
<ON_ERROR message="iconvrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="optional">
<FEEDBACK>
<ON_CHECK message="mbstringrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_ERROR message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="required">
<FEEDBACK>
<ON_ERROR message="opensslrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="tokenizer" level="optional">
<FEEDBACK>
<ON_CHECK message="tokenizerrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="xmlrpc" level="optional">
<FEEDBACK>
<ON_CHECK message="xmlrpcrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="soap" level="optional">
<FEEDBACK>
<ON_CHECK message="soaprecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="ctype" level="required">
<FEEDBACK>
<ON_ERROR message="ctyperequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zip" level="required">
<FEEDBACK>
<ON_ERROR message="ziprequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zlib" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="gd" level="required">
<FEEDBACK>
<ON_ERROR message="gdrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="simplexml" level="required">
<FEEDBACK>
<ON_ERROR message="simplexmlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="spl" level="required">
<FEEDBACK>
<ON_ERROR message="splrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="pcre" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="dom" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xml" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xmlreader" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="intl" level="required">
<FEEDBACK>
<ON_ERROR message="intlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="json" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="hash" level="required"/>
<PHP_EXTENSION name="fileinfo" level="required"/>
</PHP_EXTENSIONS>
<PHP_SETTINGS>
<PHP_SETTING name="memory_limit" value="96M" level="required">
<FEEDBACK>
<ON_ERROR message="settingmemorylimit" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="file_uploads" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="settingfileuploads" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="opcache.enable" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="opcacherecommended" />
</FEEDBACK>
</PHP_SETTING>
</PHP_SETTINGS>
<CUSTOM_CHECKS>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_storage_engine" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbstorageengine" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="question/engine/upgrade/upgradelib.php" function="quiz_attempts_upgraded" level="required">
<FEEDBACK>
<ON_ERROR message="quizattemptsupgradedmessage" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_slasharguments" level="optional">
<FEEDBACK>
<ON_CHECK message="slashargumentswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_tables_row_format" level="optional">
<FEEDBACK>
<ON_CHECK message="unsupporteddbtablerowformat" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_unoconv_version" level="optional">
<FEEDBACK>
<ON_CHECK message="unoconvwarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_libcurl_version" level="optional">
<FEEDBACK>
<ON_CHECK message="libcurlwarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_format" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbfileformat" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_per_table" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbfilepertable" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_large_prefix" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddblargeprefix" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_is_https" level="optional">
<FEEDBACK>
<ON_CHECK message="ishttpswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_incomplete_unicode_support" level="optional">
<FEEDBACK>
<ON_CHECK message="incompleteunicodesupport" />
</FEEDBACK>
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
</COMPATIBILITY_MATRIX>
+8 -1
View File
@@ -863,10 +863,17 @@ $cachewarnings = cache_helper::warnings();
$eventshandlers = $DB->get_records_sql('SELECT DISTINCT component FROM {events_handlers}');
$themedesignermode = !empty($CFG->themedesignermode);
// Check if a directory with development libraries exists.
if (is_dir($CFG->dirroot.'/vendor') || is_dir($CFG->dirroot.'/node_modules')) {
$devlibdir = true;
} else {
$devlibdir = false;
}
admin_externalpage_setup('adminnotifications');
$output = $PAGE->get_renderer('core', 'admin');
echo $output->admin_notifications_page($maturity, $insecuredataroot, $errorsdisplayed, $cronoverdue, $dbproblems,
$maintenancemode, $availableupdates, $availableupdatesfetch, $buggyiconvnomb,
$registered, $cachewarnings, $eventshandlers, $themedesignermode);
$registered, $cachewarnings, $eventshandlers, $themedesignermode, $devlibdir);
+14 -6
View File
@@ -128,7 +128,7 @@ class hub_selector_form extends moodleform {
//remove moodle.org from the hub list
foreach ($hubs as $key => $hub) {
if ($hub['url'] == HUB_MOODLEORGHUBURL) {
if ($hub['url'] == HUB_MOODLEORGHUBURL || $hub['url'] == HUB_OLDMOODLEORGHUBURL) {
unset($hubs[$key]);
}
}
@@ -225,19 +225,25 @@ class site_registration_form extends moodleform {
$imageurl = get_config('hub', 'site_imageurl_' . $cleanhuburl);
$privacy = get_config('hub', 'site_privacy_' . $cleanhuburl);
$address = get_config('hub', 'site_address_' . $cleanhuburl);
if ($address === false) {
$address = '';
}
$region = get_config('hub', 'site_region_' . $cleanhuburl);
$country = get_config('hub', 'site_country_' . $cleanhuburl);
if ($country === false) {
$country = $admin->country;
if (empty($country)) {
$country = $admin->country ?: $CFG->country;
}
$language = get_config('hub', 'site_language_' . $cleanhuburl);
if ($language === false) {
$language = current_language();
$language = explode('_', current_language())[0];
}
$geolocation = get_config('hub', 'site_geolocation_' . $cleanhuburl);
if ($geolocation === false) {
$geolocation = '';
}
$contactable = get_config('hub', 'site_contactable_' . $cleanhuburl);
$emailalert = get_config('hub', 'site_emailalert_' . $cleanhuburl);
$emailalert = ($emailalert === 0) ? 0 : 1;
$emailalert = ($emailalert === false || $emailalert) ? 1 : 0;
$coursesnumber = get_config('hub', 'site_coursesnumber_' . $cleanhuburl);
$usersnumber = get_config('hub', 'site_usersnumber_' . $cleanhuburl);
$roleassignmentsnumber = get_config('hub', 'site_roleassignmentsnumber_' . $cleanhuburl);
@@ -306,11 +312,12 @@ class site_registration_form extends moodleform {
$mform->addElement('hidden', 'regioncode', '-');
$mform->setType('regioncode', PARAM_ALPHANUMEXT);
$countries = get_string_manager()->get_list_of_countries();
$countries = ['' => ''] + get_string_manager()->get_list_of_countries();
$mform->addElement('select', 'countrycode', get_string('sitecountry', 'hub'), $countries);
$mform->setDefault('countrycode', $country);
$mform->setType('countrycode', PARAM_ALPHANUMEXT);
$mform->addHelpButton('countrycode', 'sitecountry', 'hub');
$mform->addRule('countrycode', $strrequired, 'required', null, 'client');
$mform->addElement('text', 'geolocation', get_string('sitegeolocation', 'hub'),
array('class' => 'registration_textfield'));
@@ -328,6 +335,7 @@ class site_registration_form extends moodleform {
$mform->addElement('text', 'contactphone', get_string('sitephone', 'hub'),
array('class' => 'registration_textfield'));
$mform->setType('contactphone', PARAM_TEXT);
$mform->setDefault('contactphone', $contactphone);
$mform->addHelpButton('contactphone', 'sitephone', 'hub');
$mform->setForceLtr('contactphone');
+2 -7
View File
@@ -181,13 +181,8 @@ if (empty($cancel) and $unregistration and !$confirm) {
echo $OUTPUT->header();
//check if the site is registered on Moodle.org and display a message about registering on MOOCH
$registered = $DB->count_records('registration_hubs', array('huburl' => HUB_MOODLEORGHUBURL, 'confirmed' => 1));
if (empty($registered)) {
$warningmsg = get_string('registermoochtips', 'hub');
$warningmsg .= $renderer->single_button(new moodle_url('register.php', array('huburl' => HUB_MOODLEORGHUBURL
, 'hubname' => 'Moodle.org')), get_string('register', 'admin'));
echo $renderer->box($warningmsg, 'buttons mdl-align generalbox adminwarning');
}
$adminrenderer = $PAGE->get_renderer('core', 'admin');
echo $adminrenderer->warn_if_not_registered();
//do not check sesskey if confirm = false because this script is linked into email message
if (!empty($errormessage)) {
+3 -1
View File
@@ -180,17 +180,19 @@ if (!empty($error)) {
// Some Moodle.org registration explanation.
if ($huburl == HUB_MOODLEORGHUBURL) {
$notificationtype = \core\output\notification::NOTIFY_ERROR;
if (!empty($registeredhub->token)) {
if ($registeredhub->timemodified == 0) {
$registrationmessage = get_string('pleaserefreshregistrationunknown', 'admin');
} else {
$lastupdated = userdate($registeredhub->timemodified, get_string('strftimedate', 'langconfig'));
$registrationmessage = get_string('pleaserefreshregistration', 'admin', $lastupdated);
$notificationtype = \core\output\notification::NOTIFY_INFO;
}
} else {
$registrationmessage = get_string('registrationwarning', 'admin');
}
echo $OUTPUT->notification($registrationmessage);
echo $OUTPUT->notification($registrationmessage, $notificationtype);
echo $OUTPUT->heading(get_string('registerwithmoodleorg', 'admin'));
$renderer = $PAGE->get_renderer('core', 'register');
+47 -5
View File
@@ -276,12 +276,15 @@ class core_admin_renderer extends plugin_renderer_base {
* @param int|null $availableupdatesfetch timestamp of the most recent updates fetch or null (unknown)
* @param string[] $cachewarnings An array containing warnings from the Cache API.
* @param array $eventshandlers Events 1 API handlers.
* @param bool $themedesignermode Warn about the theme designer mode.
* @param bool $devlibdir Warn about development libs directory presence.
*
* @return string HTML to output.
*/
public function admin_notifications_page($maturity, $insecuredataroot, $errorsdisplayed,
$cronoverdue, $dbproblems, $maintenancemode, $availableupdates, $availableupdatesfetch,
$buggyiconvnomb, $registered, array $cachewarnings = array(), $eventshandlers = 0, $themedesignermode = false) {
$buggyiconvnomb, $registered, array $cachewarnings = array(), $eventshandlers = 0,
$themedesignermode = false, $devlibdir = false) {
global $CFG;
$output = '';
@@ -290,6 +293,7 @@ class core_admin_renderer extends plugin_renderer_base {
$output .= $this->legacy_log_store_writing_error();
$output .= empty($CFG->disableupdatenotifications) ? $this->available_updates($availableupdates, $availableupdatesfetch) : '';
$output .= $this->insecure_dataroot_warning($insecuredataroot);
$output .= $this->development_libs_directories_warning($devlibdir);
$output .= $this->themedesignermode_warning($themedesignermode);
$output .= $this->display_errors_warning($errorsdisplayed);
$output .= $this->buggy_iconv_warning($buggyiconvnomb);
@@ -520,6 +524,24 @@ class core_admin_renderer extends plugin_renderer_base {
}
}
/**
* Render a warning that a directory with development libs is present.
*
* @param bool $devlibdir True if the warning should be displayed.
* @return string
*/
protected function development_libs_directories_warning($devlibdir) {
if ($devlibdir) {
$moreinfo = new moodle_url('/report/security/index.php');
$warning = get_string('devlibdirpresent', 'core_admin', ['moreinfourl' => $moreinfo->out()]);
return $this->warning($warning, 'error');
} else {
return '';
}
}
/**
* Render an appropriate message if dataroot is insecure.
* @param bool $errorsdisplayed
@@ -782,17 +804,37 @@ class core_admin_renderer extends plugin_renderer_base {
if (!$registered) {
$registerbutton = $this->single_button(new moodle_url('/admin/registration/register.php',
array('huburl' => HUB_MOODLEORGHUBURL, 'hubname' => 'Moodle.org')),
if (has_capability('moodle/site:config', context_system::instance())) {
$registerbutton = $this->single_button(new moodle_url('/admin/registration/register.php',
array('huburl' => HUB_MOODLEORGHUBURL, 'hubname' => 'Moodle.net')),
get_string('register', 'admin'));
$str = 'registrationwarning';
} else {
$registerbutton = '';
$str = 'registrationwarningcontactadmin';
}
return $this->warning( get_string('registrationwarning', 'admin')
. '&nbsp;' . $this->help_icon('registration', 'admin') . $registerbutton );
return $this->warning( get_string($str, 'admin')
. '&nbsp;' . $this->help_icon('registration', 'admin') . $registerbutton ,
'error alert alert-danger');
}
return '';
}
/**
* Return an admin page warning if site is not registered with moodle.org
*
* @since Moodle 3.2.5
* @return string
*/
public function warn_if_not_registered() {
global $CFG;
require_once($CFG->dirroot . '/' . $CFG->admin . '/registration/lib.php');
$registrationmanager = new registration_manager();
return $this->registration_warning($registrationmanager->get_registeredhub(HUB_MOODLEORGHUBURL) ? true : false);
}
/**
* Helper method to render the information about the available Moodle update
*
+15 -1
View File
@@ -5,11 +5,19 @@
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
redirect_if_major_upgrade_required();
$query = trim(optional_param('query', '', PARAM_NOTAGS)); // Search string
$context = context_system::instance();
$PAGE->set_context($context);
$hassiteconfig = has_capability('moodle/site:config', $context);
if ($hassiteconfig && moodle_needs_upgrading()) {
redirect(new moodle_url('/admin/index.php'));
}
admin_externalpage_setup('search', '', array('query' => $query)); // now hidden page
$adminroot = admin_get_root(); // need all settings here
@@ -38,6 +46,12 @@ if ($data = data_submitted() and confirm_sesskey() and isset($data->action) and
// to modify them
echo $OUTPUT->header($focus);
// Display a warning if site is not registered.
if (empty($query)) {
$adminrenderer = $PAGE->get_renderer('core', 'admin');
echo $adminrenderer->warn_if_not_registered();
}
echo $OUTPUT->heading(get_string('administrationsite'));
if ($errormsg !== '') {
@@ -49,7 +63,7 @@ if ($errormsg !== '') {
$showsettingslinks = true;
if (has_capability('moodle/site:config', $context)) {
if ($hassiteconfig) {
require_once("admin_settings_search_form.php");
$form = new admin_settings_search_form();
$form->display();
+3 -2
View File
@@ -179,10 +179,11 @@ preferences,moodle|/user/preferences.php|preferences',
'idnumber' => new lang_string('sort_idnumber', 'admin'),
);
$temp->add(new admin_setting_configselect('navsortmycoursessort', new lang_string('navsortmycoursessort', 'admin'), new lang_string('navsortmycoursessort_help', 'admin'), 'sortorder', $sortoptions));
$temp->add(new admin_setting_configtext('navcourselimit',new lang_string('navcourselimit','admin'),new lang_string('confignavcourselimit', 'admin'),20,PARAM_INT));
$temp->add(new admin_setting_configtext('navcourselimit', new lang_string('navcourselimit', 'admin'),
new lang_string('confignavcourselimit', 'admin'), 10, PARAM_INT));
$temp->add(new admin_setting_configcheckbox('usesitenameforsitepages', new lang_string('usesitenameforsitepages', 'admin'), new lang_string('configusesitenameforsitepages', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('linkadmincategories', new lang_string('linkadmincategories', 'admin'), new lang_string('linkadmincategories_help', 'admin'), 1));
$temp->add(new admin_setting_configcheckbox('linkcoursesections', new lang_string('linkcoursesections', 'admin'), new lang_string('linkcoursesections_help', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('linkcoursesections', new lang_string('linkcoursesections', 'admin'), new lang_string('linkcoursesections_help', 'admin'), 1));
$temp->add(new admin_setting_configcheckbox('navshowfrontpagemods', new lang_string('navshowfrontpagemods', 'admin'), new lang_string('navshowfrontpagemods_help', 'admin'), 1));
$temp->add(new admin_setting_configcheckbox('navadduserpostslinks', new lang_string('navadduserpostslinks', 'admin'), new lang_string('navadduserpostslinks_help', 'admin'), 1));
+3 -1
View File
@@ -28,7 +28,9 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
$ADMIN->add('development', $temp);
// "Profiling" settingpage (conditionally if the 'xhprof' extension is available only).
$xhprofenabled = extension_loaded('xhprof') || extension_loaded('tideways');
$xhprofenabled = extension_loaded('tideways_xhprof');
$xhprofenabled = $xhprofenabled || extension_loaded('tideways');
$xhprofenabled = $xhprofenabled || extension_loaded('xhprof');
$temp = new admin_settingpage('profiling', new lang_string('profiling', 'admin'), 'moodle/site:config', !$xhprofenabled);
// Main profiling switch.
$temp->add(new admin_setting_configcheckbox('profilingenabled', new lang_string('profilingenabled', 'admin'), new lang_string('profilingenabled_help', 'admin'), false));
+1 -1
View File
@@ -11,7 +11,7 @@ $hassiteconfig = has_capability('moodle/site:config', $systemcontext);
$ADMIN->add('root', new admin_externalpage('adminnotifications', new lang_string('notifications'), "$CFG->wwwroot/$CFG->admin/index.php"));
$ADMIN->add('root', new admin_externalpage('registrationmoodleorg', new lang_string('registration', 'admin'),
"$CFG->wwwroot/$CFG->admin/registration/register.php?huburl=" . HUB_MOODLEORGHUBURL . "&hubname=Moodle.org&sesskey=" . sesskey()));
"$CFG->wwwroot/$CFG->admin/registration/register.php?huburl=" . HUB_MOODLEORGHUBURL . "&hubname=Moodle.net&sesskey=" . sesskey()));
$ADMIN->add('root', new admin_externalpage('registrationhub', new lang_string('registerwith', 'hub'),
"$CFG->wwwroot/$CFG->admin/registration/register.php", 'moodle/site:config', true));
$ADMIN->add('root', new admin_externalpage('registrationhubs', new lang_string('hubs', 'admin'),
+2 -3
View File
@@ -24,9 +24,6 @@
defined('MOODLE_INTERNAL') || die();
global $CFG;
require_once($CFG->libdir . '/behat/classes/behat_selectors.php');
/**
* Renderer for behat tool web features
*
@@ -44,6 +41,8 @@ class tool_behat_renderer extends plugin_renderer_base {
* @return string HTML code
*/
public function render_stepsdefinitions($stepsdefinitions, $form) {
global $CFG;
require_once($CFG->libdir . '/behat/classes/behat_selectors.php');
$html = $this->generic_info();
@@ -31,7 +31,7 @@ $string['delete_confirmation'] = 'Are you absolutely sure you want to remove <st
$string['deletea'] = 'Delete {$a}';
$string['deletefiletypes'] = 'Delete a file type';
$string['description'] = 'Custom description';
$string['description_help'] = 'Simple file type description, e.g. &lsquo;Kindle ebook&rsquo;. If your site supports multiple languages and uses the multi-language filter, you can enter multi-language tags in this field to supply a description in different languages.';
$string['description_help'] = 'Simple file type description, e.g. \'Kindle ebook\'. If your site supports multiple languages and uses the multi-language filter, you can enter multi-language tags in this field to supply a description in different languages.';
$string['descriptiontype'] = 'Description type';
$string['descriptiontype_help'] = 'There are three possible ways to specify a description.
@@ -49,15 +49,15 @@ $string['error_defaulticon'] = 'Another file extension with the same MIME type i
$string['error_extension'] = 'The file type extension <strong>{$a}</strong> already exists or is invalid. File extensions must be unique and must not contain special characters.';
$string['error_notfound'] = 'The file type with extension {$a} cannot be found.';
$string['extension'] = 'Extension';
$string['extension_help'] = 'File name extension without the dot, e.g. &lsquo;mobi&rsquo;';
$string['extension_help'] = 'File name extension without the dot, e.g. \'mobi\'';
$string['groups'] = 'Type groups';
$string['groups_help'] = 'Optional list of file type groups that this type belongs to. These are generic categories such as &lsquo;document&rsquo; and &lsquo;image&rsquo;.';
$string['groups_help'] = 'Optional list of file type groups that this type belongs to. These are generic categories such as \'document\' and \'image\'.';
$string['icon'] = 'File icon';
$string['icon_help'] = 'Icon filename.
The list of icons is taken from the /pix/f directory inside your Moodle installation. You can add custom icons to this folder if required.';
$string['mimetype'] = 'MIME type';
$string['mimetype_help'] = 'MIME type associated with this file type, e.g. &lsquo;application/x-mobipocket-ebook&rsquo;';
$string['mimetype_help'] = 'MIME type associated with this file type, e.g. \'application/x-mobipocket-ebook\'';
$string['pluginname'] = 'File types';
$string['revert'] = 'Restore {$a} to Moodle defaults';
$string['revert_confirmation'] = 'Are you sure you want to restore <strong>.{$a}</strong> to Moodle defaults, discarding your changes?';
+6 -4
View File
@@ -40,7 +40,7 @@ if (empty($CFG->langotherroot)) {
$mode = optional_param('mode', 0, PARAM_INT); // action
$pack = optional_param_array('pack', array(), PARAM_SAFEDIR); // pack to install
$uninstalllang = optional_param_array('uninstalllang', array(), PARAM_LANG);// installed pack to uninstall
$confirmtounistall = optional_param('confirmtouninstall', '', PARAM_ALPHAEXT); // uninstallation confirmation
$confirmtounistall = optional_param('confirmtouninstall', '', PARAM_SAFEPATH); // uninstallation confirmation
$purgecaches = optional_param('purgecaches', false, PARAM_BOOL); // explicit caches reset
if ($purgecaches) {
@@ -74,7 +74,7 @@ if ($mode == DELETION_OF_SELECTED_LANG and (!empty($uninstalllang) or !empty($co
// Actually deleting languages, languages to delete are passed as GET parameter as string
// ...need to populate them to array.
if (empty($uninstalllang)) {
$uninstalllang = explode('-', $confirmtounistall);
$uninstalllang = explode('/', $confirmtounistall);
}
if (in_array('en', $uninstalllang)) {
@@ -84,8 +84,10 @@ if ($mode == DELETION_OF_SELECTED_LANG and (!empty($uninstalllang) or !empty($co
} else if (empty($confirmtounistall) and confirm_sesskey()) { // User chose langs to be deleted, show confirmation.
echo $OUTPUT->header();
echo $OUTPUT->confirm(get_string('uninstallconfirm', 'tool_langimport', implode(', ', $uninstalllang)),
'index.php?mode='.DELETION_OF_SELECTED_LANG.'&confirmtouninstall='.implode('-', $uninstalllang),
'index.php');
new moodle_url($PAGE->url, array(
'mode' => DELETION_OF_SELECTED_LANG,
'confirmtouninstall' => implode('/', $uninstalllang),
)), $PAGE->url);
echo $OUTPUT->footer();
die;
@@ -84,8 +84,7 @@ abstract class restore_tool_log_logstore_subplugin extends restore_subplugin {
}
}
// Roll dates.
$data->timecreated = $this->apply_date_offset($data->timecreated);
// There is no need to roll dates. Logs are supposed to be immutable. See MDL-44961.
// Revert other to its original php way.
$data->other = unserialize(base64_decode($data->other));
@@ -88,6 +88,7 @@ class store implements \tool_log\log\writer, \core\log\sql_reader {
$dboptions['dbport'] = $this->get_config('dbport', '');
$dboptions['dbschema'] = $this->get_config('dbschema', '');
$dboptions['dbcollation'] = $this->get_config('dbcollation', '');
$dboptions['dbhandlesoptions'] = $this->get_config('dbhandlesoptions', false);
try {
$db->connect($this->get_config('dbhost'), $this->get_config('dbuser'), $this->get_config('dbpass'),
$this->get_config('dbname'), false, $dboptions);
@@ -31,6 +31,8 @@ $string['databasesettings_help'] = 'Connection details for the external log data
$string['databasepersist'] = 'Persistent database connections';
$string['databaseschema'] = 'Database schema';
$string['databasecollation'] = 'Database collation';
$string['databasehandlesoptions'] = 'Database handles options';
$string['databasehandlesoptions_help'] = 'Does the remote database handle its own options.';
$string['databasetable'] = 'Database table';
$string['databasetable_help'] = 'Name of the table where logs will be stored. This table should have a structure identical to the one used by logstore_standard (mdl_logstore_standard_log).';
$string['includeactions'] = 'Include actions of these types';
@@ -54,6 +54,8 @@ if ($hassiteconfig) {
'logstore_database'), '', ''));
$settings->add(new admin_setting_configtext('logstore_database/dbcollation', get_string('databasecollation',
'logstore_database'), '', ''));
$settings->add(new admin_setting_configcheckbox('logstore_database/dbhandlesoptions', get_string('databasehandlesoptions',
'logstore_database'), get_string('databasehandlesoptions_help', 'logstore_database'), '0'));
$settings->add(new admin_setting_configtext('logstore_database/buffersize', get_string('buffersize',
'logstore_database'), get_string('buffersize_help', 'logstore_database'), 50));
@@ -64,6 +64,7 @@ $dboptions['dbsocket'] = get_config('logstore_database', 'dbsocket');
$dboptions['dbport'] = get_config('logstore_database', 'dbport');
$dboptions['dbschema'] = get_config('logstore_database', 'dbschema');
$dboptions['dbcollation'] = get_config('logstore_database', 'dbcollation');
$dboptions['dbhandlesoptions'] = get_config('logstore_database', 'dbhandlesoptions');
try {
$db->connect(get_config('logstore_database', 'dbhost'), get_config('logstore_database', 'dbuser'),
@@ -83,6 +83,11 @@ class logstore_database_store_testcase extends advanced_testcase {
} else {
set_config('dbcollation', '', 'logstore_database');
}
if (!empty($CFG->dboptions['dbhandlesoptions'])) {
set_config('dbhandlesoptions', $CFG->dboptions['dbhandlesoptions'], 'logstore_database');
} else {
set_config('dbhandlesoptions', false, 'logstore_database');
}
// Enable logging plugin.
set_config('enabled_stores', 'logstore_database', 'tool_log');
+11
View File
@@ -0,0 +1,11 @@
This files describes API changes in the logstore_database code.
=== 3.2.4 ===
* PostgreSQL connections now use advanced options to reduce connection overhead. These options are not compatible
with some connection poolers. The dbhandlesoptions parameter has been added to allow the database to configure the
required defaults. The parameters that are required in the database are;
ALTER DATABASE moodle SET client_encoding = UTF8;
ALTER DATABASE moodle SET standard_conforming_strings = on;
ALTER DATABASE moodle SET search_path = 'moodle,public'; -- Optional, if you wish to use a custom schema.
You can set these options against the database or the moodle user who connects.
+1 -1
View File
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2016120500; // The current plugin version (Date: YYYYMMDDXX).
$plugin->version = 2016120501; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2016112900; // Requires this Moodle version.
$plugin->component = 'logstore_database'; // Full name of the plugin (used for diagnostics).
@@ -51,7 +51,7 @@
</div>
</div>
<div data-region="footer" class="pull-xs-right">
<input type="button" data-action="rate" value="{{#str}}rate, tool_lp{{/str}}" class="btn btn-primary">
<button data-action="rate" class="btn btn-primary">{{#str}}rate, tool_lp{{/str}}</button>
<button data-action="cancel" class="btn btn-secondary">{{#str}}cancel{{/str}}</button>
</div>
<div class="clearfix"></div>
@@ -60,7 +60,7 @@
<div data-region="rule-base" class="form">
<div data-region="rule-outcome" class="form-group">
<label>{{#str}}outcome, tool_lp{{/str}}</label>
<select name="outcome" class="custom-select" ng-label="{{#str}}outcome, tool_lp{{/str}}">
<select name="outcome" class="custom-select">
{{#outcomes}}
<option value="{{code}}" {{#selected}}selected{{/selected}}>{{name}}</option>
{{/outcomes}}
@@ -68,7 +68,7 @@
</div>
<div data-region="rule-type" class="form-group">
<label>{{#str}}when, tool_lp{{/str}}</label>
<select name="rule" class="custom-select" ng-label="{{#str}}when, tool_lp{{/str}}">
<select name="rule" class="custom-select">
<option value="-1">{{#str}}choosedots{{/str}}</option>
{{#rules}}
<option value="{{type}}" {{#selected}}selected{{/selected}}>{{name}}</option>
@@ -81,10 +81,11 @@
{{/config}}
</div>
<div data-region="footer" class="pull-xs-right">
<div data-region="footer" class="pull-xs-right m-t-1">
{{#config}}
<input type="button" class="btn btn-primary" data-action="save" value="{{#str}}savechanges{{/str}}"/>
{{/config}}
<input type="button" class="btn btn-secondary" data-action="cancel" value="{{#str}}cancel{{/str}}"/>
</div>
<div class="clearfix"></div>
</div>
+10 -4
View File
@@ -127,7 +127,7 @@ class api {
'rememberusername' => $CFG->rememberusername,
'authloginviaemail' => $CFG->authloginviaemail,
'registerauth' => $CFG->registerauth,
'forgottenpasswordurl' => $CFG->forgottenpasswordurl,
'forgottenpasswordurl' => clean_param($CFG->forgottenpasswordurl, PARAM_URL), // We may expect a mailto: here.
'authinstructions' => $authinstructions,
'authnoneenabled' => (int) is_enabled_auth('none'),
'enablewebservices' => $CFG->enablewebservices,
@@ -153,10 +153,11 @@ class api {
$settings['launchurl'] = $url->out(false);
}
if ($logourl = $OUTPUT->get_logo_url()) {
// Check that we are receiving a moodle_url object, themes can override get_logo_url and may return incorrect values.
if (($logourl = $OUTPUT->get_logo_url()) && $logourl instanceof moodle_url) {
$settings['logourl'] = $logourl->out(false);
}
if ($compactlogourl = $OUTPUT->get_compact_logo_url()) {
if (($compactlogourl = $OUTPUT->get_compact_logo_url()) && $compactlogourl instanceof moodle_url) {
$settings['compactlogourl'] = $compactlogourl->out(false);
}
@@ -203,12 +204,17 @@ class api {
}
if (empty($section) or $section == 'sitepolicies') {
$settings->sitepolicy = $CFG->sitepolicy;
$settings->disableuserimages = $CFG->disableuserimages;
}
if (empty($section) or $section == 'gradessettings') {
require_once($CFG->dirroot . '/user/lib.php');
$settings->mygradesurl = user_mygrades_url()->out(false);
$settings->mygradesurl = user_mygrades_url();
// The previous function may return moodle_url instances or plain string URLs.
if ($settings->mygradesurl instanceof moodle_url) {
$settings->mygradesurl = $settings->mygradesurl->out(false);
}
}
return $settings;
+1
View File
@@ -23,6 +23,7 @@
*/
namespace tool_mobile;
defined('MOODLE_INTERNAL') || die();
require_once("$CFG->libdir/externallib.php");
+2 -2
View File
@@ -22,13 +22,13 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
$string['autologinkeygenerationlockout'] = 'Auto-login key generation is blocked because of too many requests within an hour.';
$string['autologinkeygenerationlockout'] = 'Auto-login key generation is blocked. You need to wait 6 minutes between requests.';
$string['autologinnotallowedtoadmins'] = 'Auto-login is not allowed for site admins.';
$string['cachedef_plugininfo'] = 'This stores the list of plugins with mobile addons';
$string['clickheretolaunchtheapp'] = 'Click here if the app does not open automatically.';
$string['configmobilecssurl'] = 'A CSS file to customise your mobile app interface.';
$string['enablesmartappbanners'] = 'Enable Smart App Banners';
$string['enablesmartappbanners_desc'] = 'This will display a banner promoting the Moodle Mobile app when visiting the site in Mobile Safari.';
$string['enablesmartappbanners_desc'] = 'If enabled, a banner promoting the mobile app will be displayed when accessing the site using a mobile browser.';
$string['forcedurlscheme'] = 'If you want to allow only your custom branded app to be opened via a browser window, then specify its URL scheme here; otherwise leave the field empty.';
$string['forcedurlscheme_key'] = 'URL scheme';
$string['httpsrequired'] = 'HTTPS required';
+8 -2
View File
@@ -94,12 +94,14 @@ class tool_mobile_external_testcase extends externallib_advanced_testcase {
set_config('typeoflogin', api::LOGIN_VIA_BROWSER, 'tool_mobile');
set_config('logo', 'mock.png', 'core_admin');
set_config('logocompact', 'mock.png', 'core_admin');
set_config('forgottenpasswordurl', 'mailto:fake@email.zy'); // Test old hack.
list($authinstructions, $notusedformat) = external_format_text($authinstructions, FORMAT_MOODLE, $context->id);
$expected['registerauth'] = 'email';
$expected['authinstructions'] = $authinstructions;
$expected['typeoflogin'] = api::LOGIN_VIA_BROWSER;
$expected['launchurl'] = "$CFG->wwwroot/$CFG->admin/tool/mobile/launch.php";
$expected['forgottenpasswordurl'] = ''; // Expect empty when it's not an URL.
if ($logourl = $OUTPUT->get_logo_url()) {
$expected['logourl'] = $logourl->out(false);
@@ -121,6 +123,10 @@ class tool_mobile_external_testcase extends externallib_advanced_testcase {
require_once($CFG->dirroot . '/course/format/lib.php');
$this->resetAfterTest(true);
$mysitepolicy = 'http://mysite.is/policy/';
set_config('sitepolicy', $mysitepolicy);
$result = external::get_config();
$result = external_api::clean_returnvalue(external::get_config_returns(), $result);
@@ -141,6 +147,7 @@ class tool_mobile_external_testcase extends externallib_advanced_testcase {
array('name' => 'numsections', 'value' => course_get_format($SITE)->get_course()->numsections),
array('name' => 'newsitems', 'value' => $SITE->newsitems),
array('name' => 'commentsperpage', 'value' => $CFG->commentsperpage),
array('name' => 'sitepolicy', 'value' => $mysitepolicy),
array('name' => 'disableuserimages', 'value' => $CFG->disableuserimages),
array('name' => 'mygradesurl', 'value' => user_mygrades_url()->out(false)),
);
@@ -150,8 +157,7 @@ class tool_mobile_external_testcase extends externallib_advanced_testcase {
// Change a value and retrieve filtering by section.
set_config('commentsperpage', 1);
$expected[10]['value'] = 1;
unset($expected[11]);
unset($expected[12]);
array_splice($expected, 11);
$result = external::get_config('frontpagesettings');
$result = external_api::clean_returnvalue(external::get_config_returns(), $result);
+6 -2
View File
@@ -25,8 +25,12 @@
defined('MOODLE_INTERNAL') || die;
// profiling tool, added to development
if ((extension_loaded('xhprof') || extension_loaded('tideways')) && (!empty($CFG->profilingenabled) || !empty($CFG->earlyprofilingenabled))) {
// Profiling tool, added to development.
$hasextension = extension_loaded('tideways_xhprof');
$hasextension = $hasextension || extension_loaded('tideways');
$hasextension = $hasextension || extension_loaded('xhprof');
$isenabled = !empty($CFG->profilingenabled) || !empty($CFG->earlyprofilingenabled);
if ($hasextension && $isenabled) {
$ADMIN->add('development', new admin_externalpage('toolprofiling', get_string('pluginname', 'tool_profiling'),
"$CFG->wwwroot/$CFG->admin/tool/profiling/index.php", 'moodle/site:config'));
}
@@ -70,6 +70,9 @@ class api {
// Look at all the templates dirs for subsystems.
$subsystems = core_component::get_core_subsystems();
foreach ($subsystems as $subsystem => $dir) {
if (empty($dir)) {
continue;
}
$dir .= '/templates';
if (is_dir($dir)) {
$dirs = mustache_template_finder::get_template_directories_for_component('core_' . $subsystem, $themename);
@@ -22,6 +22,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_templatelibrary;
defined('MOODLE_INTERNAL') || die();
require_once("$CFG->libdir/externallib.php");
@@ -166,6 +166,13 @@ class tool_uploadcourse_step2_form extends tool_uploadcourse_base_form {
$mform->addHelpButton('defaults[groupmodeforce]', 'groupmodeforce', 'group');
$mform->setDefault('defaults[groupmodeforce]', $courseconfig->groupmodeforce);
// Completion tracking.
if (!empty($CFG->enablecompletion)) {
$mform->addElement('selectyesno', 'defaults[enablecompletion]', get_string('enablecompletion', 'completion'));
$mform->setDefault('defaults[enablecompletion]', $courseconfig->enablecompletion);
$mform->addHelpButton('defaults[enablecompletion]', 'enablecompletion', 'completion');
}
// Hidden fields.
$mform->addElement('hidden', 'importid');
$mform->setType('importid', PARAM_INT);
@@ -166,6 +166,7 @@ $defaults['groupmode'] = $courseconfig->groupmode;
$defaults['groupmodeforce'] = $courseconfig->groupmodeforce;
$defaults['visible'] = $courseconfig->visible;
$defaults['lang'] = $courseconfig->lang;
$defaults['enablecompletion'] = $courseconfig->enablecompletion;
// Course template.
if (isset($options['templatecourse'])) {
+12 -12
View File
@@ -3187,6 +3187,18 @@ class CAS_Client
false/*$no_response*/, true/*$bad_response*/, $text_response
);
$result = false;
} else if ( $tree_response->getElementsByTagName("authenticationFailure")->length != 0) {
// authentication failed, extract the error code and message and throw exception
$auth_fail_list = $tree_response
->getElementsByTagName("authenticationFailure");
throw new CAS_AuthenticationException(
$this, 'Ticket not validated', $validate_url,
false/*$no_response*/, false/*$bad_response*/,
$text_response,
$auth_fail_list->item(0)->getAttribute('code')/*$err_code*/,
trim($auth_fail_list->item(0)->nodeValue)/*$err_msg*/
);
$result = false;
} else if ($tree_response->getElementsByTagName("authenticationSuccess")->length != 0) {
// authentication succeded, extract the user name
$success_elements = $tree_response
@@ -3227,18 +3239,6 @@ class CAS_Client
$result = true;
}
}
} else if ( $tree_response->getElementsByTagName("authenticationFailure")->length != 0) {
// authentication succeded, extract the error code and message
$auth_fail_list = $tree_response
->getElementsByTagName("authenticationFailure");
throw new CAS_AuthenticationException(
$this, 'Ticket not validated', $validate_url,
false/*$no_response*/, false/*$bad_response*/,
$text_response,
$auth_fail_list->item(0)->getAttribute('code')/*$err_code*/,
trim($auth_fail_list->item(0)->nodeValue)/*$err_msg*/
);
$result = false;
} else {
throw new CAS_AuthenticationException(
$this, 'Ticket not validated', $validate_url,
+1
View File
@@ -2,3 +2,4 @@ Description of phpCAS 1.3.4 library import
* downloaded from http://downloads.jasig.org/cas-clients/php/current/
* MDL-59456 phpCAS library has been patched because of an authentication bypass security vulnerability.
+1 -1
View File
@@ -143,7 +143,7 @@ class login implements renderable, templatable {
$data->error = $this->error;
$data->forgotpasswordurl = $this->forgotpasswordurl->out(false);
$data->hasidentityproviders = !empty($this->identityproviders);
$data->hasinstructions = !empty($this->instructions);
$data->hasinstructions = !empty($this->instructions) || $this->cansignup;
$data->identityproviders = $identityproviders;
list($data->instructions, $data->instructionsformat) = external_format_text($this->instructions, FORMAT_MOODLE,
context_system::instance()->id);
+6 -2
View File
@@ -171,7 +171,7 @@ class auth_plugin_db extends auth_plugin_base {
}
/**
* Returns user attribute mappings between moodle and ldap.
* Returns user attribute mappings between moodle and the external database.
*
* @return array
*/
@@ -215,8 +215,12 @@ class auth_plugin_db extends auth_plugin_base {
// If at least one field is mapped from external db, get that mapped data.
if ($selectfields) {
$select = array();
$fieldcount = 0;
foreach ($selectfields as $localname=>$externalname) {
$select[] = "$externalname";
// Without aliasing, multiple occurrences of the same external
// name can coalesce in only occurrence in the result.
$select[] = "$externalname AS F".$fieldcount;
$fieldcount++;
}
$select = implode(', ', $select);
$sql = "SELECT $select
+9 -9
View File
@@ -112,11 +112,11 @@ class auth_email_external extends external_api {
}
if (signup_captcha_enabled()) {
require_once($CFG->libdir . '/recaptchalib.php');
// We return the public key, maybe we want to use the javascript api to get the image.
// With reCAPTCHA v2 the captcha will be rendered by the mobile client using just the publickey.
// For now include placeholders for the v1 paramaters to support older mobile app versions.
$result['recaptchapublickey'] = $CFG->recaptchapublickey;
list($result['recaptchachallengehash'], $result['recaptchachallengeimage'], $result['recaptchachallengejs']) =
recaptcha_get_challenge_hash_and_urls(RECAPTCHA_API_SECURE_SERVER, $CFG->recaptchapublickey);
array('', '', '');
}
$result['warnings'] = array();
@@ -137,7 +137,7 @@ class auth_email_external extends external_api {
new external_value(PARAM_NOTAGS, 'The order of the name fields')
),
'passwordpolicy' => new external_value(PARAM_RAW, 'Password policy', VALUE_OPTIONAL),
'sitepolicy' => new external_value(PARAM_URL, 'Site policy url', VALUE_OPTIONAL),
'sitepolicy' => new external_value(PARAM_RAW, 'Site policy', VALUE_OPTIONAL),
'defaultcity' => new external_value(PARAM_NOTAGS, 'Default city', VALUE_OPTIONAL),
'country' => new external_value(PARAM_ALPHA, 'Default country', VALUE_OPTIONAL),
'profilefields' => new external_multiple_structure(
@@ -307,11 +307,11 @@ class auth_email_external extends external_api {
// Validate recaptcha.
if (signup_captcha_enabled()) {
require_once($CFG->libdir . '/recaptchalib.php');
$response = recaptcha_check_answer($CFG->recaptchaprivatekey, getremoteaddr(), $params['recaptchachallengehash'],
$params['recaptcharesponse'], true);
if (!$response->is_valid) {
$errors['recaptcharesponse'] = $response->error;
require_once($CFG->libdir . '/recaptchalib_v2.php');
$response = recaptcha_check_response(RECAPTCHA_VERIFY_URL, $CFG->recaptchaprivatekey,
getremoteaddr(), $params['recaptcharesponse']);
if (!$response['isvalid']) {
$errors['recaptcharesponse'] = $response['error'];
}
}
+9 -9
View File
@@ -276,7 +276,7 @@ class auth_plugin_ldap extends auth_plugin_base {
}
$ldapval = NULL;
foreach ($values as $value) {
$entry = array_change_key_case($user_entry[0], CASE_LOWER);
$entry = $user_entry[0];
if (($value == 'dn') || ($value == 'distinguishedname')) {
$result[$key] = $user_dn;
continue;
@@ -634,7 +634,7 @@ class auth_plugin_ldap extends auth_plugin_base {
if ($sr) {
$info = ldap_get_entries_moodle($ldapconnection, $sr);
if (!empty ($info)) {
$info = array_change_key_case($info[0], CASE_LOWER);
$info = $info[0];
if (isset($info[$this->config->expireattr][0])) {
$expiretime = $this->ldap_expirationtime2unix($info[$this->config->expireattr][0], $ldapconnection, $user_dn);
if ($expiretime != 0) {
@@ -1201,7 +1201,7 @@ class auth_plugin_ldap extends auth_plugin_base {
return false;
}
$user_entry = array_change_key_case($user_entry[0], CASE_LOWER);
$user_entry = $user_entry[0];
foreach ($attrmap as $key => $ldapkeys) {
$profilefield = '';
@@ -1369,7 +1369,7 @@ class auth_plugin_ldap extends auth_plugin_base {
$sr = ldap_read($ldapconnection, $user_dn, '(objectClass=*)', $search_attribs);
if ($sr) {
$entry = ldap_get_entries_moodle($ldapconnection, $sr);
$info = array_change_key_case($entry[0], CASE_LOWER);
$info = $entry[0];
$newattrs = array();
if (!empty($info[$this->config->expireattr][0])) {
// Set expiration time only if passwordExpirationInterval is defined
@@ -2024,7 +2024,7 @@ class auth_plugin_ldap extends auth_plugin_base {
}
$entry = ldap_get_entries_moodle($ldapconn, $sr);
$info = array_change_key_case($entry[0], CASE_LOWER);
$info = $entry[0];
$useraccountcontrol = $info['useraccountcontrol'][0];
if ($useraccountcontrol & UF_DONT_EXPIRE_PASSWD) {
// Password doesn't expire.
@@ -2069,17 +2069,17 @@ class auth_plugin_ldap extends auth_plugin_base {
}
$entry = ldap_get_entries_moodle($ldapconn, $sr);
$info = array_change_key_case($entry[0], CASE_LOWER);
$info = $entry[0];
$domaindn = $info['defaultnamingcontext'][0];
$sr = ldap_read ($ldapconn, $domaindn, '(objectClass=*)',
array('maxPwdAge'));
$entry = ldap_get_entries_moodle($ldapconn, $sr);
$info = array_change_key_case($entry[0], CASE_LOWER);
$info = $entry[0];
$maxpwdage = $info['maxpwdage'][0];
if ($sr = ldap_read($ldapconn, $user_dn, '(objectClass=*)', array('msDS-ResultantPSO'))) {
if ($entry = ldap_get_entries_moodle($ldapconn, $sr)) {
$info = array_change_key_case($entry[0], CASE_LOWER);
$info = $entry[0];
$userpso = $info['msds-resultantpso'][0];
// If a PSO exists, FGPP is being utilized.
@@ -2087,7 +2087,7 @@ class auth_plugin_ldap extends auth_plugin_base {
if (!empty($userpso)) {
$sr = ldap_read($ldapconn, $userpso, '(objectClass=*)', array('msDS-MaximumPasswordAge'));
if ($entry = ldap_get_entries_moodle($ldapconn, $sr)) {
$info = array_change_key_case($entry[0], CASE_LOWER);
$info = $entry[0];
// Default value of msds-maximumpasswordage is 42 and is always set.
$maxpwdage = $info['msds-maximumpasswordage'][0];
}
+1 -1
View File
@@ -119,7 +119,7 @@ $string['didntfindexpiretime'] = 'password_expire() didn\'t find expiration time
$string['didntgetusersfromldap'] = "Did not get any users from LDAP -- error? -- exiting\n";
$string['gotcountrecordsfromldap'] = "Got {\$a} records from LDAP\n";
$string['morethanoneuser'] = 'Strange! More than one user record found in ldap. Only using the first one.';
$string['needbcmath'] = 'You need the BCMath extension to use grace logins with Active Directory';
$string['needbcmath'] = 'You need the BCMath extension to use expired password checking with Active Directory.';
$string['needmbstring'] = 'You need the mbstring extension to change passwords in Active Directory';
$string['nodnforusername'] = 'Error in user_update_password(). No DN for: {$a->username}';
$string['noemail'] = 'Tried to send you an email but failed!';
@@ -65,8 +65,9 @@ class frontend extends \core_availability\frontend {
// Add each course-module if it has completion turned on and is not
// the one currently being edited.
if ($othercm->completion && (empty($cm) || $cm->id != $id) && !$othercm->deletioninprogress) {
$cms[] = (object)array('id' => $id, 'name' =>
format_string($othercm->name, true, array('context' => $context)));
$cms[] = (object)array('id' => $id,
'name' => format_string($othercm->name, true, array('context' => $context)),
'completiongradeitemnumber' => $othercm->completiongradeitemnumber);
}
}
@@ -24,6 +24,7 @@
$string['description'] = 'Require students to complete (or not complete) another activity.';
$string['error_selectcmid'] = 'You must select an activity for the completion condition.';
$string['error_selectcmidpassfail'] = 'You must select an activity with "Require grade" completion condition set.';
$string['label_cm'] = 'Activity or resource';
$string['label_completion'] = 'Required completion status';
$string['missing'] = '(Missing activity)';
@@ -78,6 +78,16 @@ M.availability_completion.form.fillErrors = function(errors, node) {
if (cmid === 0) {
errors.push('availability_completion:error_selectcmid');
}
var e = parseInt(node.one('select[name=e]').get('value'), 10);
if (((e === 2) || (e === 3))) {
this.cms.forEach(function(cm) {
if (cm.id === cmid) {
if (cm.completiongradeitemnumber === null) {
errors.push('availability_completion:error_selectcmidpassfail');
}
}
});
}
};
@@ -1 +1 @@
YUI.add("moodle-availability_completion-form",function(e,t){M.availability_completion=M.availability_completion||{},M.availability_completion.form=e.Object(M.core_availability.plugin),M.availability_completion.form.initInner=function(e){this.cms=e},M.availability_completion.form.getNode=function(t){var n='<span class="col-form-label p-r-1"> '+M.util.get_string("title","availability_completion")+"</span>"+' <span class="availability-group form-group"><label>'+'<span class="accesshide">'+M.util.get_string("label_cm","availability_completion")+" </span>"+'<select class="custom-select" name="cm" title="'+M.util.get_string("label_cm","availability_completion")+'">'+'<option value="0">'+M.util.get_string("choosedots","moodle")+"</option>";for(var r=0;r<this.cms.length;r++){var i=this.cms[r];n+='<option value="'+i.id+'">'+i.name+"</option>"}n+='</select></label> <label><span class="accesshide">'+M.util.get_string("label_completion","availability_completion")+' </span><select class="custom-select" '+'name="e" title="'+M.util.get_string("label_completion","availability_completion")+'">'+'<option value="1">'+M.util.get_string("option_complete","availability_completion")+"</option>"+'<option value="0">'+M.util.get_string("option_incomplete","availability_completion")+"</option>"+'<option value="2">'+M.util.get_string("option_pass","availability_completion")+"</option>"+'<option value="3">'+M.util.get_string("option_fail","availability_completion")+"</option>"+"</select></label></span>";var s=e.Node.create('<span class="form-inline">'+n+"</span>");t.cm!==undefined&&s.one("select[name=cm] > option[value="+t.cm+"]")&&s.one("select[name=cm]").set("value",""+t.cm),t.e!==undefined&&s.one("select[name=e]").set("value",""+t.e);if(!M.availability_completion.form.addedEvents){M.availability_completion.form.addedEvents=!0;var o=e.one(".availability-field");o.delegate("change",function(){M.core_availability.form.update()},".availability_completion select")}return s},M.availability_completion.form.fillValue=function(e,t){e.cm=parseInt(t.one("select[name=cm]").get("value"),10),e.e=parseInt(t.one("select[name=e]").get("value"),10)},M.availability_completion.form.fillErrors=function(e,t){var n=parseInt(t.one("select[name=cm]").get("value"),10);n===0&&e.push("availability_completion:error_selectcmid")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
YUI.add("moodle-availability_completion-form",function(e,t){M.availability_completion=M.availability_completion||{},M.availability_completion.form=e.Object(M.core_availability.plugin),M.availability_completion.form.initInner=function(e){this.cms=e},M.availability_completion.form.getNode=function(t){var n='<span class="col-form-label p-r-1"> '+M.util.get_string("title","availability_completion")+"</span>"+' <span class="availability-group form-group"><label>'+'<span class="accesshide">'+M.util.get_string("label_cm","availability_completion")+" </span>"+'<select class="custom-select" name="cm" title="'+M.util.get_string("label_cm","availability_completion")+'">'+'<option value="0">'+M.util.get_string("choosedots","moodle")+"</option>";for(var r=0;r<this.cms.length;r++){var i=this.cms[r];n+='<option value="'+i.id+'">'+i.name+"</option>"}n+='</select></label> <label><span class="accesshide">'+M.util.get_string("label_completion","availability_completion")+' </span><select class="custom-select" '+'name="e" title="'+M.util.get_string("label_completion","availability_completion")+'">'+'<option value="1">'+M.util.get_string("option_complete","availability_completion")+"</option>"+'<option value="0">'+M.util.get_string("option_incomplete","availability_completion")+"</option>"+'<option value="2">'+M.util.get_string("option_pass","availability_completion")+"</option>"+'<option value="3">'+M.util.get_string("option_fail","availability_completion")+"</option>"+"</select></label></span>";var s=e.Node.create('<span class="form-inline">'+n+"</span>");t.cm!==undefined&&s.one("select[name=cm] > option[value="+t.cm+"]")&&s.one("select[name=cm]").set("value",""+t.cm),t.e!==undefined&&s.one("select[name=e]").set("value",""+t.e);if(!M.availability_completion.form.addedEvents){M.availability_completion.form.addedEvents=!0;var o=e.one(".availability-field");o.delegate("change",function(){M.core_availability.form.update()},".availability_completion select")}return s},M.availability_completion.form.fillValue=function(e,t){e.cm=parseInt(t.one("select[name=cm]").get("value"),10),e.e=parseInt(t.one("select[name=e]").get("value"),10)},M.availability_completion.form.fillErrors=function(e,t){var n=parseInt(t.one("select[name=cm]").get("value"),10);n===0&&e.push("availability_completion:error_selectcmid");var r=parseInt(t.one("select[name=e]").get("value"),10);(r===2||r===3)&&this.cms.forEach(function(t){t.id===n&&t.completiongradeitemnumber===null&&e.push("availability_completion:error_selectcmidpassfail")})}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
@@ -78,6 +78,16 @@ M.availability_completion.form.fillErrors = function(errors, node) {
if (cmid === 0) {
errors.push('availability_completion:error_selectcmid');
}
var e = parseInt(node.one('select[name=e]').get('value'), 10);
if (((e === 2) || (e === 3))) {
this.cms.forEach(function(cm) {
if (cm.id === cmid) {
if (cm.completiongradeitemnumber === null) {
errors.push('availability_completion:error_selectcmidpassfail');
}
}
});
}
};
@@ -76,4 +76,14 @@ M.availability_completion.form.fillErrors = function(errors, node) {
if (cmid === 0) {
errors.push('availability_completion:error_selectcmid');
}
var e = parseInt(node.one('select[name=e]').get('value'), 10);
if (((e === 2) || (e === 3))) {
this.cms.forEach(function(cm) {
if (cm.id === cmid) {
if (cm.completiongradeitemnumber === null) {
errors.push('availability_completion:error_selectcmidpassfail');
}
}
});
}
};
+9
View File
@@ -136,6 +136,15 @@ abstract class backup implements checksumable {
* Usually same than major release zero version, mainly for informative/historic purposes.
*/
const RELEASE = '3.2';
/**
* Cipher to be used in backup and restore operations.
*/
const CIPHER = 'aes-256-cbc';
/**
* Bytes enforced for key, using the cypher above. Restrictive? Yes, but better than unsafe lengths
*/
const CIPHERKEYLEN = 32;
}
/*
+11
View File
@@ -15,6 +15,17 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This script is used to configure and execute the backup proccess.
*
* @package core
* @subpackage backup
* @copyright Moodle
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define('NO_OUTPUT_BUFFERING', true);
require_once('../config.php');
require_once($CFG->dirroot . '/backup/util/includes/backup_includes.php');
require_once($CFG->dirroot . '/backup/moodle2/backup_plan_builder.class.php');
+1 -1
View File
@@ -112,7 +112,7 @@ class cc_forum extends entities {
public function get_topic_data ($instance) {
$topic_data = '';
$topic_data = array();
$topic_file = $this->get_external_xml($instance['resource_indentifier']);
+1 -1
View File
@@ -68,7 +68,7 @@ class cc_quiz extends entities {
$last_question_id = 0;
$last_answer_id = 0;
$instances = '';
$instances = array();
$types = array(MOODLE_TYPE_QUIZ, MOODLE_TYPE_QUESTION_BANK);
+1 -1
View File
@@ -87,7 +87,7 @@ class cc11_basiclti extends entities11 {
public function get_basiclti_data($instance) {
$topic_data = '';
$topic_data = array();
$basiclti_file = $this->get_external_xml($instance['resource_indentifier']);
+1 -1
View File
@@ -111,7 +111,7 @@ class cc11_forum extends entities11 {
public function get_topic_data ($instance) {
$topic_data = '';
$topic_data = array();
$topic_file = $this->get_external_xml($instance['resource_indentifier']);
+1 -1
View File
@@ -82,7 +82,7 @@ class cc11_lti extends entities11 {
public function get_basiclti_data($instance) {
$topic_data = '';
$topic_data = array();
$basiclti_file = $this->get_external_xml($instance['resource_indentifier']);
+1 -1
View File
@@ -68,7 +68,7 @@ class cc11_quiz extends entities11 {
$last_question_id = 0;
$last_answer_id = 0;
$instances = '';
$instances = array();
$types = array(MOODLE_TYPE_QUIZ, MOODLE_TYPE_QUESTION_BANK);
@@ -149,6 +149,32 @@ class core_backup_controller_testcase extends advanced_testcase {
}
$this->assertTrue($alltrue);
}
/**
* Test restore of deadlock causing backup.
*/
public function test_restore_of_deadlock_causing_backup() {
global $USER, $CFG;
$this->preventResetByRollback();
$foldername = 'deadlock';
$fp = get_file_packer('application/vnd.moodle.backup');
$tempdir = $CFG->dataroot . '/temp/backup/' . $foldername;
$files = $fp->extract_to_pathname($CFG->dirroot . '/backup/controller/tests/fixtures/deadlock.mbz', $tempdir);
$this->setAdminUser();
$controller = new restore_controller(
'deadlock',
$this->courseid,
backup::INTERACTIVE_NO,
backup::MODE_GENERAL,
$USER->id,
backup::TARGET_NEW_COURSE
);
$this->assertTrue($controller->execute_precheck());
$controller->execute_plan();
$controller->destroy();
}
}
Binary file not shown.
+26
View File
@@ -1,5 +1,31 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This script is used to configure and execute the import proccess.
*
* @package core
* @subpackage backup
* @copyright Moodle
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define('NO_OUTPUT_BUFFERING', true);
// Require both the backup and restore libs
require_once('../config.php');
require_once($CFG->dirroot . '/backup/util/includes/backup_includes.php');
+14 -4
View File
@@ -164,15 +164,25 @@ class backup_course_task extends backup_task {
/**
* Helper method, used by encode_content_links.
* @param string $content content in which to encode links.
* @param unknown_type $name the name of this type of encoded link.
* @param unknown_type $path the path that identifies this type of link, up
* @param string $name the name of this type of encoded link.
* @param string $path the path that identifies this type of link, up
* to the ?paramname= bit.
* @return string content with one type of link encoded.
*/
static private function encode_links_helper($content, $name, $path) {
global $CFG;
$base = preg_quote($CFG->wwwroot . $path, '/');
return preg_replace('/(' . $base . ')([0-9]+)/', '$@' . $name . '*$2@$', $content);
// We want to convert both http and https links.
$root = $CFG->wwwroot;
$httpsroot = str_replace('http://', 'https://', $root);
$httproot = str_replace('https://', 'http://', $root);
$httpsbase = preg_quote($httpsroot . $path, '/');
$httpbase = preg_quote($httproot . $path, '/');
$return = preg_replace('/(' . $httpsbase . ')([0-9]+)/', '$@' . $name . '*$2@$', $content);
$return = preg_replace('/(' . $httpbase . ')([0-9]+)/', '$@' . $name . '*$2@$', $return);
return $return;
}
// Protected API starts here
+132
View File
@@ -97,6 +97,138 @@ class base64_encode_final_element extends backup_final_element {
}
}
/**
* Implementation of {@link backup_final_element} that provides symmetric-key AES-256 encryption of contents.
*
* This final element transparently encrypts, for secure storage and transport, any content
* that shouldn't be shown normally in plain text. Usually, passwords or keys that cannot use
* hashing algorithms, although potentially can encrypt any content. All information is encoded
* using base64.
*
* Features:
* - requires openssl extension to work. Without it contents are completely omitted.
* - automatically creates an appropriate default key for the site and stores it into backup_encryptkey config (bas64 encoded).
* - uses a different appropriate init vector for every operation, which is transmited with the encrypted contents.
* - all generated data is base64 encoded for safe transmission.
* - automatically adds "encrypted" attribute for easier detection.
* - implements HMAC for providing integrity.
*
* @copyright 2017 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class encrypted_final_element extends backup_final_element {
/** @var string cypher appropiate raw key for backups in the site. Defaults to backup_encryptkey config. */
protected $key = null;
/**
* Constructor - instantiates a encrypted_final_element, specifying its basic info.
*
* Overridden to automatically add the 'encrypted' attribute if missing.
*
* @param string $name name of the element
* @param array $attributes attributes this element will handle (optional, defaults to null)
*/
public function __construct($name, $attributes = null) {
parent::__construct($name, $attributes);
if (! $this->get_attribute('encrypted')) {
$this->add_attributes('encrypted');
}
}
/**
* Set the encryption key manually, overriding default backup_encryptkey config.
*
* @param string $key key to be used for encrypting. Required to be 256-bit key.
* Use a safe generation technique. See self::generate_encryption_random_key() below.
*/
protected function set_key($key) {
$bytes = strlen($key); // Get key length in bytes.
// Only accept keys with the expected (backup::CIPHERKEYLEN) key length. There are a number of hashing,
// random generators to achieve this esasily, like the one shown below to create the default
// site encryption key and ivs.
if ($bytes !== backup::CIPHERKEYLEN) {
$info = (object)array('expected' => backup::CIPHERKEYLEN, 'found' => $bytes);
throw new base_element_struct_exception('encrypted_final_element incorrect key length', $info);
}
// Everything went ok, store the key.
$this->key = $key;
}
/**
* Set the value of the field.
*
* This method sets the value of the element, encrypted using the specified key for it,
* defaulting to (and generating) backup_encryptkey config. HMAC is used for integrity.
*
* @param string $value plain-text content the will be stored encrypted and encoded.
*/
public function set_value($value) {
// No openssl available, skip this field completely.
if (!function_exists('openssl_encrypt')) {
return;
}
// No hmac available, skip this field completely.
if (!function_exists('hash_hmac')) {
return;
}
// Cypher not available, skip this field completely.
if (!in_array(backup::CIPHER, openssl_get_cipher_methods())) {
return;
}
// Ensure we have a good key, manual or default.
if (empty($this->key)) {
// The key has not been set manually, look for it at config (base64 encoded there).
$enckey = get_config('backup', 'backup_encryptkey');
if ($enckey === false) {
// Has not been set, calculate and save an appropiate random key automatically.
$enckey = base64_encode(self::generate_encryption_random_key(backup::CIPHERKEYLEN));
set_config('backup_encryptkey', $enckey, 'backup');
}
$this->set_key(base64_decode($enckey));
}
// Now we need an iv for this operation.
$iv = self::generate_encryption_random_key(openssl_cipher_iv_length(backup::CIPHER));
// Everything is ready, let's encrypt and prepend the 1-shot iv.
$value = $iv . openssl_encrypt($value, backup::CIPHER, $this->key, OPENSSL_RAW_DATA, $iv);
// Calculate the hmac of the value (iv + encrypted) and prepend it.
$hmac = hash_hmac('sha256', $value, $this->key, true);
$value = $hmac . $value;
// Ready, set the encoded value.
parent::set_value(base64_encode($value));
// Finally, if the field has an "encrypted" attribute, set it to true.
if ($att = $this->get_attribute('encrypted')) {
$att->set_value('true');
}
}
/**
* Generate an appropiate random key to be used for encrypting backup information.
*
* Normally used as site default encryption key (backup_encryptkey config) and also
* for calculating the init vectors.
*
* Note that until PHP 5.6.12 openssl_random_pseudo_bytes() did NOT
* use a "cryptographically strong algorithm" {@link https://bugs.php.net/bug.php?id=70014}
* But it's beyond my crypto-knowledge when it's worth finding a *real* better alternative.
*
* @param int $bytes Number of bytes to determine the key length expected.
*/
protected static function generate_encryption_random_key($bytes) {
return openssl_random_pseudo_bytes($bytes);
}
}
/**
* Implementation of backup_nested_element that provides special handling of files
*
+9 -1
View File
@@ -522,7 +522,7 @@ class backup_enrolments_structure_step extends backup_structure_step {
$enrol->annotate_ids('role', 'roleid');
// Add enrol plugin structure.
$this->add_plugin_structure('enrol', $enrol, false);
$this->add_plugin_structure('enrol', $enrol, true);
return $enrolments;
}
@@ -869,6 +869,14 @@ class backup_calendarevents_structure_step extends backup_structure_step {
AND (eventtype = 'course' OR eventtype = 'group')";
$calendar_items_params = array('courseid'=>backup::VAR_COURSEID);
$event->set_source_sql($calendar_items_sql, $calendar_items_params);
} else if ($this->name == 'activity_calendar') {
$params = array('instance' => backup::VAR_ACTIVITYID, 'modulename' => backup::VAR_MODNAME);
// If we don't want to include the userinfo in the backup then setting the courseid
// will filter out all of the user override events (which have a course id of zero).
if (!$this->get_setting_value('userinfo')) {
$params['courseid'] = backup::VAR_COURSEID;
}
$event->set_source_table('event', $params);
} else {
$event->set_source_table('event', array('courseid' => backup::VAR_COURSEID, 'instance' => backup::VAR_ACTIVITYID, 'modulename' => backup::VAR_MODNAME));
}
+20 -4
View File
@@ -2632,6 +2632,17 @@ class restore_calendarevents_structure_step extends restore_structure_step {
$data = (object)$data;
$oldid = $data->id;
$restorefiles = true; // We'll restore the files
// User overrides for activities are identified by having a courseid of zero with
// both a modulename and instance value set.
$isuseroverride = !$data->courseid && $data->modulename && $data->instance;
// If we don't want to include user data and this record is a user override event
// for an activity then we should not create it. (Only activity events can be user override events - which must have this
// setting).
if ($isuseroverride && $this->task->setting_exists('userinfo') && !$this->task->get_setting_value('userinfo')) {
return;
}
// Find the userid and the groupid associated with the event.
$data->userid = $this->get_mappingid('user', $data->userid);
if ($data->userid === false) {
@@ -2667,7 +2678,9 @@ class restore_calendarevents_structure_step extends restore_structure_step {
'name' => $data->name,
'description' => $data->description,
'format' => $data->format,
'courseid' => $this->get_courseid(),
// User overrides in activities use a course id of zero. All other event types
// must use the mapped course id.
'courseid' => $data->courseid ? $this->get_courseid() : 0,
'groupid' => $data->groupid,
'userid' => $data->userid,
'repeatid' => $this->get_mappingid('event', $data->repeatid),
@@ -2689,10 +2702,11 @@ class restore_calendarevents_structure_step extends restore_structure_step {
WHERE " . $DB->sql_compare_text('name', 255) . " = " . $DB->sql_compare_text('?', 255) . "
AND courseid = ?
AND modulename = ?
AND instance = ?
AND timestart = ?
AND timeduration = ?
AND " . $DB->sql_compare_text('description', 255) . " = " . $DB->sql_compare_text('?', 255);
$arg = array ($params['name'], $params['courseid'], $params['modulename'], $params['timestart'], $params['timeduration'], $params['description']);
$arg = array ($params['name'], $params['courseid'], $params['modulename'], $params['instance'], $params['timestart'], $params['timeduration'], $params['description']);
$result = $DB->record_exists_sql($sql, $arg);
if (empty($result)) {
$newitemid = $DB->insert_record('event', $params);
@@ -3045,7 +3059,8 @@ class restore_course_logs_structure_step extends restore_structure_step {
$data = (object)($data);
$data->time = $this->apply_date_offset($data->time);
// There is no need to roll dates. Logs are supposed to be immutable. See MDL-44961.
$data->userid = $this->get_mappingid('user', $data->userid);
$data->course = $this->get_courseid();
$data->cmid = 0;
@@ -3092,7 +3107,8 @@ class restore_activity_logs_structure_step extends restore_course_logs_structure
$data = (object)($data);
$data->time = $this->apply_date_offset($data->time);
// There is no need to roll dates. Logs are supposed to be immutable. See MDL-44961.
$data->userid = $this->get_mappingid('user', $data->userid);
$data->course = $this->get_courseid();
$data->cmid = $this->task->get_moduleid();
@@ -0,0 +1,116 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Tests for the handling of encrypted contents in backup and restore.
*
* @package core_backup
* @copyright 2016 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
global $CFG;
require_once($CFG->dirroot . '/backup/util/includes/backup_includes.php');
require_once($CFG->dirroot . '/backup/util/includes/restore_includes.php');
require_once($CFG->dirroot . '/backup/moodle2/backup_custom_fields.php');
class core_backup_encrypted_content_testscase extends advanced_testcase {
public function setUp() {
if (!function_exists('openssl_encrypt')) {
$this->markTestSkipped('OpenSSL extension is not loaded.');
} else if (!function_exists('hash_hmac')) {
$this->markTestSkipped('Hash extension is not loaded.');
} else if (!in_array(backup::CIPHER, openssl_get_cipher_methods())) {
$this->markTestSkipped('Expected cipher not available: ' . backup::CIPHER);
}
}
public function test_encrypted_final_element() {
$this->resetAfterTest(true);
// Some basic verifications.
$efe = new encrypted_final_element('test', array('encrypted'));
$this->assertInstanceOf('encrypted_final_element', $efe);
$this->assertSame('test', $efe->get_name());
$atts = $efe->get_attributes();
$this->assertCount(1, $atts);
$att = reset($atts);
$this->assertInstanceOf('backup_attribute', $att);
$this->assertSame('encrypted', $att->get_name());
// Using a manually defined (incorrect length) key.
$efe = new encrypted_final_element('test', array('encrypted'));
$key = 'this_in_not_correct_32_byte_key';
try {
set_config('backup_encryptkey', base64_encode($key), 'backup');
$efe->set_value('tiny_secret');
$this->fail('Expecting base_element_struct_exception exception, none happened');
} catch (exception $e) {
$this->assertInstanceOf('base_element_struct_exception', $e);
$this->assertEquals('encrypted_final_element incorrect key length', $e->errorcode);
}
// Using a manually defined (correct length) key.
$efe = new encrypted_final_element('test', array('testattr', 'encrypted'));
$key = hash('md5', 'Moodle rocks and this is not secure key, who cares, it is a test');
set_config('backup_encryptkey', base64_encode($key), 'backup');
$this->assertEmpty($efe->get_value());
$secret = 'This is a secret message that nobody else will be able to read but me 💩 ';
$efe->set_value($secret);
$atts = $efe->get_attributes();
$this->assertCount(2, $atts);
$this->assertArrayHasKey('encrypted', $atts); // We added it explicitly.
$this->assertTrue($atts['encrypted']->is_set());
$this->assertSame('true', $atts['encrypted']->get_value());
$this->assertNotEmpty($efe->get_value());
$this->assertTrue($efe->is_set());
// Get the crypted content and decrypt it manually.
$ctext = $efe->get_value();
$hmaclen = 32; // SHA256 is 32 bytes.
$ivlen = openssl_cipher_iv_length(backup::CIPHER);
list($hmac, $iv, $text) = array_values(unpack("a{$hmaclen}hmac/a{$ivlen}iv/a*text", base64_decode($ctext)));
$this->assertSame(hash_hmac('sha256', $iv . $text, $key, true), $hmac);
$this->assertSame($secret, openssl_decrypt($text, backup::CIPHER, $key, OPENSSL_RAW_DATA, $iv));
// Using the default site-generated key.
$efe = new encrypted_final_element('test', array('testattr'));
$this->assertEmpty($efe->get_value());
$secret = 'This is a secret message that nobody else will be able to read but me 💩 ';
$efe->set_value($secret);
$atts = $efe->get_attributes();
$this->assertCount(2, $atts);
$this->assertArrayHasKey('encrypted', $atts); // Was added automatcally, we did not specify it.
$this->assertTrue($atts['encrypted']->is_set());
$this->assertSame('true', $atts['encrypted']->get_value());
$this->assertNotEmpty($efe->get_value());
$this->assertTrue($efe->is_set());
// Get the crypted content and decrypt it manually.
$ctext = $efe->get_value();
$hmaclen = 32; // SHA256 is 32 bytes.
$ivlen = openssl_cipher_iv_length(backup::CIPHER);
list($hmac, $iv, $text) = array_values(unpack("a{$hmaclen}hmac/a{$ivlen}iv/a*text", base64_decode($ctext)));
$key = base64_decode(get_config('backup', 'backup_encryptkey'));
$this->assertSame(hash_hmac('sha256', $iv . $text, $key, true), $hmac);
$this->assertSame($secret, openssl_decrypt($text, backup::CIPHER, $key, OPENSSL_RAW_DATA, $iv));
}
}
@@ -0,0 +1,99 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Tests for backup_xml_transformer class.
*
* @package core_backup
* @subpackage moodle2
* @category backup
* @copyright 2017 Dmitrii Metelkin (dmitriim@catalyst-au.net)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
global $CFG;
require_once($CFG->dirroot . '/backup/util/includes/backup_includes.php');
require_once($CFG->dirroot . '/backup/moodle2/backup_plan_builder.class.php');
/**
* Tests for backup_xml_transformer.
*
* @package core_backup
* @copyright 2017 Dmitrii Metelkin (dmitriim@catalyst-au.net)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class backup_xml_transformer_testcase extends advanced_testcase {
/**
* Initial set up.
*/
public function setUp() {
parent::setUp();
$this->resetAfterTest(true);
}
/**
* Data provider for ::test_filephp_links_replace.
*
* @return array
*/
public function filephp_links_replace_data_provider() {
return array(
array('http://test.test/', 'http://test.test/'),
array('http://test.test/file.php/1', 'http://test.test/file.php/1'),
array('http://test.test/file.php/2/1.jpg', 'http://test.test/file.php/2/1.jpg'),
array('http://test.test/file.php/2', 'http://test.test/file.php/2'),
array('http://test.test/file.php/1/1.jpg', '$@FILEPHP@$$@SLASH@$1.jpg'),
array('http://test.test/file.php/1//1.jpg', '$@FILEPHP@$$@SLASH@$$@SLASH@$1.jpg'),
array('http://test.test/file.php?file=/1', '$@FILEPHP@$'),
array('http://test.test/file.php?file=/2/1.jpg', 'http://test.test/file.php?file=/2/1.jpg'),
array('http://test.test/file.php?file=/2', 'http://test.test/file.php?file=/2'),
array('http://test.test/file.php?file=/1/1.jpg', '$@FILEPHP@$$@SLASH@$1.jpg'),
array('http://test.test/file.php?file=/1//1.jpg', '$@FILEPHP@$$@SLASH@$$@SLASH@$1.jpg'),
array('http://test.test/file.php?file=%2f1', '$@FILEPHP@$'),
array('http://test.test/file.php?file=%2f2%2f1.jpg', 'http://test.test/file.php?file=%2f2%2f1.jpg'),
array('http://test.test/file.php?file=%2f2', 'http://test.test/file.php?file=%2f2'),
array('http://test.test/file.php?file=%2f1%2f1.jpg', '$@FILEPHP@$$@SLASH@$1.jpg'),
array('http://test.test/file.php?file=%2f1%2f%2f1.jpg', '$@FILEPHP@$$@SLASH@$$@SLASH@$1.jpg'),
array('http://test.test/file.php?file=%2F1', '$@FILEPHP@$'),
array('http://test.test/file.php?file=%2F2%2F1.jpg', 'http://test.test/file.php?file=%2F2%2F1.jpg'),
array('http://test.test/file.php?file=%2F2', 'http://test.test/file.php?file=%2F2'),
array('http://test.test/file.php?file=%2F1%2F1.jpg', '$@FILEPHP@$$@SLASH@$1.jpg'),
array('http://test.test/file.php?file=%2F1%2F%2F1.jpg', '$@FILEPHP@$$@SLASH@$$@SLASH@$1.jpg'),
);
}
/**
* Test that backup_xml_transformer replaces file php links to $@FILEPHP@$.
*
* @dataProvider filephp_links_replace_data_provider
* @param string $content Testing content.
* @param string $expected Expected result.
*/
public function test_filephp_links_replace($content, $expected) {
global $CFG;
$CFG->wwwroot = 'http://test.test';
$transformer = new backup_xml_transformer(1);
$this->assertEquals($expected, $transformer->process($content));
}
}
+25 -1
View File
@@ -1,5 +1,29 @@
<?php
//This script is used to configure and execute the restore proccess.
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This script is used to configure and execute the restore proccess.
*
* @package core
* @subpackage backup
* @copyright Moodle
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define('NO_OUTPUT_BUFFERING', true);
require_once('../config.php');
require_once($CFG->dirroot . '/backup/util/includes/restore_includes.php');
@@ -56,8 +56,10 @@ class backup_anonymizer_helper {
if (preg_match('/^anon\d*$/', $user->username)) {
$match = preg_match('/^anonfirstname\d*$/', $user->firstname);
$match = $match && preg_match('/^anonlastname\d*$/', $user->lastname);
$match = $match && preg_match('/^anon\d*@doesntexist\.com$/', $user->email);
if ($match) {
// Check .com for backwards compatibility.
$emailmatch = preg_match('/^anon\d*@doesntexist\.com$/', $user->email) ||
preg_match('/^anon\d*@doesntexist\.invalid$/', $user->email);
if ($match && $emailmatch) {
return true;
}
}
@@ -93,7 +95,7 @@ class backup_anonymizer_helper {
public static function process_user_email($value) {
static $counter = 0;
$counter++;
return 'anon' . $counter . '@doesntexist.com'; // Just a counter
return 'anon' . $counter . '@doesntexist.invalid'; // Just a counter.
}
public static function process_user_icq($value) {
@@ -60,17 +60,26 @@ class restore_structure_parser_processor extends grouped_parser_processor {
} else if (strpos($cdata, '$@FILEPHP@$') === false) { // No $@FILEPHP@$, nothing to convert
return $cdata;
}
if ($CFG->slasharguments) {
$slash = '/';
$forcedownload = '?forcedownload=1';
} else {
$slash = '%2F';
$forcedownload = '&amp;forcedownload=1';
}
// We have to remove trailing slashes, otherwise file URLs will be restored with an extra slash.
$basefileurl = rtrim(moodle_url::make_legacyfile_url($this->courseid, null)->out(true), $slash);
// Decode file.php calls
$search = array ("$@FILEPHP@$");
$replace = array(moodle_url::make_legacyfile_url($this->courseid, null));
$replace = array($basefileurl);
$result = str_replace($search, $replace, $cdata);
// Now $@SLASH@$ and $@FORCEDOWNLOAD@$ MDL-18799
$search = array('$@SLASH@$', '$@FORCEDOWNLOAD@$');
if ($CFG->slasharguments) {
$replace = array('/', '?forcedownload=1');
} else {
$replace = array('%2F', '&amp;forcedownload=1');
}
$replace = array($slash, $forcedownload);
return str_replace($search, $replace, $result);
}
@@ -44,13 +44,33 @@ class backup_course_task_testcase extends basic_testcase {
*/
public function test_course_encode_content_links() {
global $CFG;
$httpsroot = "https://moodle.org";
$httproot = "http://moodle.org";
$oldroot = $CFG->wwwroot;
// HTTPS root and links of both types in content.
$CFG->wwwroot = $httpsroot;
$encoded = backup_course_task::encode_content_links(
$CFG->wwwroot . '/course/view.php?id=123, ' .
$CFG->wwwroot . '/grade/index.php?id=123, ' .
$CFG->wwwroot . '/grade/report/index.php?id=123, ' .
$CFG->wwwroot . '/badges/view.php?type=2&id=123 and ' .
$CFG->wwwroot . '/user/index.php?id=123.');
$this->assertEquals('$@COURSEVIEWBYID*123@$, $@GRADEINDEXBYID*123@$, ' .
$httproot . '/course/view.php?id=123, ' .
$httpsroot . '/course/view.php?id=123, ' .
$httpsroot . '/grade/index.php?id=123, ' .
$httpsroot . '/grade/report/index.php?id=123, ' .
$httpsroot . '/badges/view.php?type=2&id=123 and ' .
$httpsroot . '/user/index.php?id=123.');
$this->assertEquals('$@COURSEVIEWBYID*123@$, $@COURSEVIEWBYID*123@$, $@GRADEINDEXBYID*123@$, ' .
'$@GRADEREPORTINDEXBYID*123@$, $@BADGESVIEWBYID*123@$ and $@USERINDEXVIEWBYID*123@$.', $encoded);
// HTTP root and links of both types in content.
$CFG->wwwroot = $httproot;
$encoded = backup_course_task::encode_content_links(
$httproot . '/course/view.php?id=123, ' .
$httpsroot . '/course/view.php?id=123, ' .
$httproot . '/grade/index.php?id=123, ' .
$httproot . '/grade/report/index.php?id=123, ' .
$httproot . '/badges/view.php?type=2&id=123 and ' .
$httproot . '/user/index.php?id=123.');
$this->assertEquals('$@COURSEVIEWBYID*123@$, $@COURSEVIEWBYID*123@$, $@GRADEINDEXBYID*123@$, ' .
'$@GRADEREPORTINDEXBYID*123@$, $@BADGESVIEWBYID*123@$ and $@USERINDEXVIEWBYID*123@$.', $encoded);
$CFG->wwwroot = $oldroot;
}
}
@@ -0,0 +1,132 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Tests for restore_structure_parser_processor class.
*
* @package core_backup
* @category test
* @copyright 2017 Dmitrii Metelkin (dmitriim@catalyst-au.net)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
global $CFG;
require_once($CFG->dirroot . '/backup/util/includes/backup_includes.php');
require_once($CFG->dirroot . '/backup/util/helper/restore_structure_parser_processor.class.php');
/**
* Tests for restore_structure_parser_processor class.
*
* @package core_backup
* @copyright 2017 Dmitrii Metelkin (dmitriim@catalyst-au.net)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class restore_structure_parser_processor_test extends advanced_testcase {
/**
* Initial set up.
*/
public function setUp() {
parent::setUp();
$this->resetAfterTest(true);
}
/**
* Data provider for ::test_process_cdata.
*
* @return array
*/
public function process_cdata_data_provider() {
return array(
array(null, null, true),
array("$@NULL@$", null, true),
array("$@NULL@$ ", "$@NULL@$ ", true),
array(1, 1, true),
array(" ", " ", true),
array("1", "1", true),
array("$@FILEPHP@$1.jpg", "$@FILEPHP@$1.jpg", true),
array(
"http://test.test/$@SLASH@$",
"http://test.test/$@SLASH@$",
true
),
array(
"<a href='$@FILEPHP@$1.jpg'>Image</a>",
"<a href='http://test.test/file.php/11.jpg'>Image</a>",
true
),
array(
"<a href='$@FILEPHP@$$@SLASH@$1.jpg'>Image</a>",
"<a href='http://test.test/file.php/1/1.jpg'>Image</a>",
true
),
array(
"<a href='$@FILEPHP@$$@SLASH@$$@SLASH@$1.jpg'>Image</a>",
"<a href='http://test.test/file.php/1//1.jpg'>Image</a>",
true
),
array(
"<a href='$@FILEPHP@$1.jpg'>Image</a>",
"<a href='http://test.test/file.php?file=%2F11.jpg'>Image</a>",
false
),
array(
"<a href='$@FILEPHP@$$@SLASH@$1.jpg'>Image</a>",
"<a href='http://test.test/file.php?file=%2F1%2F1.jpg'>Image</a>",
false
),
array(
"<a href='$@FILEPHP@$$@SLASH@$$@SLASH@$1.jpg'>Image</a>",
"<a href='http://test.test/file.php?file=%2F1%2F%2F1.jpg'>Image</a>",
false
),
array(
"<a href='$@FILEPHP@$$@SLASH@$1.jpg$@FORCEDOWNLOAD@$'>Image</a>",
"<a href='http://test.test/file.php/1/1.jpg?forcedownload=1'>Image</a>",
true
),
array(
"<a href='$@FILEPHP@$$@SLASH@$1.jpg$@FORCEDOWNLOAD@$'>Image</a>",
"<a href='http://test.test/file.php?file=%2F1%2F1.jpg&amp;forcedownload=1'>Image</a>",
false
),
);
}
/**
* Test that restore_structure_parser_processor replaces $@FILEPHP@$ to correct file php links.
*
* @dataProvider process_cdata_data_provider
* @param string $content Testing content.
* @param string $expected Expected result.
* @param bool $slasharguments A value for $CFG->slasharguments setting.
*/
public function test_process_cdata($content, $expected, $slasharguments) {
global $CFG;
$CFG->slasharguments = $slasharguments;
$CFG->wwwroot = 'http://test.test';
$processor = new restore_structure_parser_processor(1, 1);
$this->assertEquals($expected, $processor->process_cdata($content));
}
}
+60
View File
@@ -94,6 +94,66 @@ abstract class restore_step extends base_step {
// Return the passed value with cached offset applied.
return $value + $cache[$this->get_restoreid()];
}
/**
* Returns symmetric-key AES-256 decryption of base64 encoded contents.
*
* This method is used in restore operations to decrypt contents encrypted with
* {@link encrypted_final_element} automatically decoding (base64) and decrypting
* contents using the key stored in backup_encryptkey config.
*
* Requires openssl, cipher availability, and key existence (backup
* automatically sets it if missing). Integrity is provided via HMAC.
*
* @param string $value {@link encrypted_final_element} value to decode and decrypt.
* @return string|null decoded and decrypted value or null if the operation can not be performed.
*/
public function decrypt($value) {
// No openssl available, skip this field completely.
if (!function_exists('openssl_encrypt')) {
return null;
}
// No hash available, skip this field completely.
if (!function_exists('hash_hmac')) {
return null;
}
// Cypher not available, skip this field completely.
if (!in_array(backup::CIPHER, openssl_get_cipher_methods())) {
return null;
}
// Get the decrypt key. Skip if missing.
$key = get_config('backup', 'backup_encryptkey');
if ($key === false) {
return null;
}
// And decode it.
$key = base64_decode($key);
// Arrived here, let's proceed with authentication (provides integrity).
$hmaclen = 32; // SHA256 is 32 bytes.
$ivlen = openssl_cipher_iv_length(backup::CIPHER);
list($hmac, $iv, $text) = array_values(unpack("a{$hmaclen}hmac/a{$ivlen}iv/a*text", base64_decode($value)));
// Verify HMAC matches expectations, skip if not (integrity failed).
if (!hash_equals($hmac, hash_hmac('sha256', $iv . $text, $key, true))) {
return null;
}
// Arrived here, integrity is ok, let's decrypt.
$result = openssl_decrypt($text, backup::CIPHER, $key, OPENSSL_RAW_DATA, $iv);
// For some reason decrypt failed (strange, HMAC check should have deteted it), skip this field completely.
if ($result === false) {
return null;
}
return $result;
}
}
/*
+46
View File
@@ -91,6 +91,52 @@ class backup_step_testcase extends advanced_testcase {
$bc->destroy();
}
/**
* test restore_step class, decrypt method
*/
public function test_restore_step_decrypt() {
$this->resetAfterTest(true);
if (!function_exists('openssl_encrypt')) {
$this->markTestSkipped('OpenSSL extension is not loaded.');
} else if (!function_exists('hash_hmac')) {
$this->markTestSkipped('Hash extension is not loaded.');
} else if (!in_array(backup::CIPHER, openssl_get_cipher_methods())) {
$this->markTestSkipped('Expected cipher not available: ' . backup::CIPHER);
}
$bt = new mock_restore_task_basepath('taskname');
$bs = new mock_restore_structure_step('steptest', null, $bt);
$this->assertTrue(method_exists($bs, 'decrypt'));
// Let's prepare a string for being decrypted.
$secret = 'This is a secret message that nobody else will be able to read but me 💩 ';
$key = hash('md5', 'Moodle rocks and this is not secure key, who cares, it is a test');
$iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length(backup::CIPHER));
$message = $iv . openssl_encrypt($secret, backup::CIPHER, $key, OPENSSL_RAW_DATA, $iv);
$hmac = hash_hmac('sha256', $message, $key, true);
$crypt = base64_encode($hmac . $message);
// Running it without a key configured, returns null.
$this->assertNull($bs->decrypt($crypt));
// Store the key into config.
set_config('backup_encryptkey', base64_encode($key), 'backup');
// Verify decrypt works and returns original.
$this->assertSame($secret, $bs->decrypt($crypt));
// Finally, test the integrity failure detection is working.
// (this can be caused by changed hmac, key or message, in
// this case we are just forcing it via changed hmac).
$hmac = md5($message);
$crypt = base64_encode($hmac . $message);
$this->assertNull($bs->decrypt($crypt));
}
/**
* test backup_structure_step class
*/
+6 -1
View File
@@ -47,8 +47,13 @@ class award_criteria_activity extends award_criteria {
parent::__construct($record);
$this->course = $DB->get_record_sql('SELECT c.id, c.enablecompletion, c.cacherev, c.startdate
FROM {badge} b INNER JOIN {course} c ON b.courseid = c.id
FROM {badge} b LEFT JOIN {course} c ON b.courseid = c.id
WHERE b.id = :badgeid ', array('badgeid' => $this->badgeid), MUST_EXIST);
// If the course doesn't exist but we're sure the badge does (thanks to the LEFT JOIN), then use the site as the course.
if (empty($this->course->id)) {
$this->course = get_course(SITEID);
}
$this->courseid = $this->course->id;
}
+6 -1
View File
@@ -49,8 +49,13 @@ class award_criteria_course extends award_criteria {
parent::__construct($record);
$this->course = $DB->get_record_sql('SELECT c.id, c.enablecompletion, c.cacherev, c.startdate
FROM {badge} b INNER JOIN {course} c ON b.courseid = c.id
FROM {badge} b LEFT JOIN {course} c ON b.courseid = c.id
WHERE b.id = :badgeid ', array('badgeid' => $this->badgeid), MUST_EXIST);
// If the course doesn't exist but we're sure the badge does (thanks to the LEFT JOIN), then use the site as the course.
if (empty($this->course->id)) {
$this->course = get_course(SITEID);
}
$this->courseid = $this->course->id;
}
+7
View File
@@ -109,6 +109,13 @@ class community_hub_search_form extends moodleform {
$mform->addElement('static', 'errorhub', '', $error);
}
// Hubdirectory returns old URL for the moodle.net hub, substitute it.
foreach ($hubs as $key => $hub) {
if ($hub['url'] === HUB_OLDMOODLEORGHUBURL) {
$hubs[$key]['url'] = HUB_MOODLEORGHUBURL;
}
}
//display list of registered on hub
$registrationmanager = new registration_manager();
$registeredhubs = $registrationmanager->get_registered_on_hubs();
+4 -4
View File
@@ -90,7 +90,7 @@ echo html_writer::start_tag('tbody');
if ($USER->id != $user->id) {
echo html_writer::start_tag('tr');
echo html_writer::start_tag('td', array('colspan' => '2'));
echo html_writer::tag('b', get_string('showinguser', 'completion'));
echo html_writer::tag('b', get_string('showinguser', 'completion') . ' ');
$url = new moodle_url('/user/view.php', array('id' => $user->id, 'course' => $course->id));
echo html_writer::link($url, fullname($user));
echo html_writer::end_tag('td');
@@ -99,7 +99,7 @@ if ($USER->id != $user->id) {
echo html_writer::start_tag('tr');
echo html_writer::start_tag('td', array('colspan' => '2'));
echo html_writer::tag('b', get_string('status'));
echo html_writer::tag('b', get_string('status') . ' ');
// Is course complete?
$coursecomplete = $info->is_course_complete($user->id);
@@ -141,7 +141,7 @@ if (empty($completions)) {
} else {
echo html_writer::start_tag('tr');
echo html_writer::start_tag('td', array('colspan' => '2'));
echo html_writer::tag('b', get_string('required'));
echo html_writer::tag('b', get_string('required') . ' ');
// Get overall aggregation method.
$overall = $info->get_aggregation_method();
@@ -214,7 +214,7 @@ if (empty($completions)) {
echo core_text::strtolower(get_string('any', 'completion'));
}
echo html_writer::end_tag('i') .core_text::strtolower(get_string('required')).')';
echo ' ' . html_writer::end_tag('i') .core_text::strtolower(get_string('required')).')';
$agg_type = false;
}
}
+45 -26
View File
@@ -50,6 +50,12 @@ class block_edit_form extends moodleform {
*/
public $page;
/**
* Defaults set in set_data() that need to be returned in get_data() if form elements were not created
* @var array
*/
protected $defaults = [];
function __construct($actionurl, $block, $page) {
global $CFG;
$this->block = $block;
@@ -92,9 +98,6 @@ class block_edit_form extends moodleform {
}
$parentcontext = context::instance_by_id($this->block->instance->parentcontextid);
$mform->addElement('hidden', 'bui_parentcontextid', $parentcontext->id);
$mform->setType('bui_parentcontextid', PARAM_INT);
$mform->addElement('static', 'bui_homecontext', get_string('createdat', 'block'), $parentcontext->get_context_name());
$mform->addHelpButton('bui_homecontext', 'createdat', 'block');
@@ -109,21 +112,9 @@ class block_edit_form extends moodleform {
// implies one (and only one) harcoded page-type that will be set later
// when processing the form data at {@link block_manager::process_url_edit()}
// There are some conditions to check related to contexts
$ctxconditions = $this->page->context->contextlevel == CONTEXT_COURSE &&
$this->page->context->instanceid == get_site()->id;
// And also some pagetype conditions
$pageconditions = isset($bits[0]) && isset($bits[1]) && $bits[0] == 'site' && $bits[1] == 'index';
// So now we can be 100% sure if edition is happening at frontpage
$editingatfrontpage = $ctxconditions && $pageconditions;
// Let the form to know about that, can be useful later
$mform->addElement('hidden', 'bui_editingatfrontpage', (int)$editingatfrontpage);
$mform->setType('bui_editingatfrontpage', PARAM_INT);
// Front page, show the page-contexts element and set $pagetypelist to 'any page' (*)
// as unique option. Processign the form will do any change if needed
if ($editingatfrontpage) {
if ($this->is_editing_the_frontpage()) {
$contextoptions = array();
$contextoptions[BUI_CONTEXTS_FRONTPAGE_ONLY] = get_string('showonfrontpageonly', 'block');
$contextoptions[BUI_CONTEXTS_FRONTPAGE_SUBS] = get_string('showonfrontpageandsubs', 'block');
@@ -135,16 +126,13 @@ class block_edit_form extends moodleform {
// Any other system context block, hide the page-contexts element,
// it's always system-wide BUI_CONTEXTS_ENTIRE_SITE
} else if ($parentcontext->contextlevel == CONTEXT_SYSTEM) {
$mform->addElement('hidden', 'bui_contexts', BUI_CONTEXTS_ENTIRE_SITE);
} else if ($parentcontext->contextlevel == CONTEXT_COURSE) {
// 0 means display on current context only, not child contexts
// but if course managers select mod-* as pagetype patterns, block system will overwrite this option
// to 1 (display on current context and child contexts)
$mform->addElement('hidden', 'bui_contexts', BUI_CONTEXTS_CURRENT);
} else if ($parentcontext->contextlevel == CONTEXT_MODULE or $parentcontext->contextlevel == CONTEXT_USER) {
// module context doesn't have child contexts, so display in current context only
$mform->addElement('hidden', 'bui_contexts', BUI_CONTEXTS_CURRENT);
} else {
$parentcontextname = $parentcontext->get_context_name();
$contextoptions[BUI_CONTEXTS_CURRENT] = get_string('showoncontextonly', 'block', $parentcontextname);
@@ -181,8 +169,6 @@ class block_edit_form extends moodleform {
} else {
$values = array_keys($pagetypelist);
$value = array_pop($values);
$mform->addElement('hidden', 'bui_pagetypepattern', $value);
$mform->setType('bui_pagetypepattern', PARAM_RAW);
// Now we are really hiding a lot (both page-contexts and page-type-patterns),
// specially in some systemcontext pages having only one option (my/user...)
// so, until it's decided if we are going to add the 'bring-back' pattern to
@@ -191,7 +177,7 @@ class block_edit_form extends moodleform {
// TODO: Revisit this once MDL-30574 has been decided and implemented, although
// perhaps it's not bad to always show this statically when only one pattern is
// available.
if (!$editingatfrontpage) {
if (!$this->is_editing_the_frontpage()) {
// Try to beautify it
$strvalue = $value;
$strkey = 'page-'.str_replace('*', 'x', $strvalue);
@@ -205,10 +191,7 @@ class block_edit_form extends moodleform {
}
if ($this->page->subpage) {
if ($parentcontext->contextlevel == CONTEXT_USER) {
$mform->addElement('hidden', 'bui_subpagepattern', '%@NULL@%');
$mform->setType('bui_subpagepattern', PARAM_RAW);
} else {
if ($parentcontext->contextlevel != CONTEXT_USER) {
$subpageoptions = array(
'%@NULL@%' => get_string('anypagematchingtheabove', 'block'),
$this->page->subpage => get_string('thisspecificpage', 'block', $this->page->subpage),
@@ -252,6 +235,19 @@ class block_edit_form extends moodleform {
$this->add_action_buttons();
}
/**
* Returns true if the user is editing a frontpage.
* @return bool
*/
public function is_editing_the_frontpage() {
// There are some conditions to check related to contexts.
$ctxconditions = $this->page->context->contextlevel == CONTEXT_COURSE &&
$this->page->context->instanceid == get_site()->id;
$issiteindex = (strpos($this->page->pagetype, 'site-index') === 0);
// So now we can be 100% sure if edition is happening at frontpage.
return ($ctxconditions && $issiteindex);
}
function set_data($defaults) {
// Prefix bui_ on all the core field names.
$blockfields = array('showinsubcontexts', 'pagetypepattern', 'subpagepattern', 'parentcontextid',
@@ -281,6 +277,13 @@ class block_edit_form extends moodleform {
$defaults->bui_contexts = $defaults->bui_showinsubcontexts;
}
// Some fields may not be editable, remember the values here so we can return them in get_data().
$this->defaults = [
'bui_parentcontextid' => $defaults->bui_parentcontextid,
'bui_contexts' => $defaults->bui_contexts,
'bui_pagetypepattern' => $defaults->bui_pagetypepattern,
'bui_subpagepattern' => $defaults->bui_subpagepattern,
];
parent::set_data($defaults);
}
@@ -291,4 +294,20 @@ class block_edit_form extends moodleform {
protected function specific_definition($mform) {
// By default, do nothing.
}
/**
* Return submitted data if properly submitted or returns NULL if validation fails or
* if there is no submitted data.
*
* @return object submitted data; NULL if not valid or not submitted or cancelled
*/
public function get_data() {
if ($data = parent::get_data()) {
// Blocklib expects 'bui_editingatfrontpage' property to be returned from this form.
$data->bui_editingatfrontpage = $this->is_editing_the_frontpage();
// Some fields are non-editable and we need to populate them with the values from set_data().
return (object)((array)$data + $this->defaults);
}
return $data;
}
}
@@ -50,7 +50,7 @@ class block_glossary_random extends block_base {
if (empty($this->config->title)) {
$this->title = get_string('pluginname','block_glossary_random');
} else {
$this->title = $this->config->title;
$this->title = format_string($this->config->title, true, ['context' => $this->context]);
}
if (empty($this->config->glossary)) {
+5 -1
View File
@@ -37,7 +37,11 @@ class block_html extends block_base {
}
function specialization() {
$this->title = isset($this->config->title) ? format_string($this->config->title) : format_string(get_string('newhtmlblock', 'block_html'));
if (isset($this->config->title)) {
$this->title = $this->title = format_string($this->config->title, true, ['context' => $this->context]);
} else {
$this->title = get_string('newhtmlblock', 'block_html');
}
}
function instance_allow_multiple() {
+3 -1
View File
@@ -119,7 +119,9 @@ class block_login extends block_base {
$this->content->text .= '<h6>' . get_string('potentialidps', 'auth') . '</h6>';
$this->content->text .= '<div class="potentialidplist">';
foreach ($potentialidps as $idp) {
$this->content->text .= '<div class="potentialidp"><a href="' . $idp['url']->out() . '" title="' . s($idp['name']) . '">';
$this->content->text .= '<div class="potentialidp">';
$this->content->text .= '<a class="btn btn-default btn-block" ';
$this->content->text .= 'href="' . $idp['url']->out() . '" title="' . s($idp['name']) . '">';
$this->content->text .= $OUTPUT->render($idp['icon'], $idp['name']) . s($idp['name']) . '</a></div>';
}
$this->content->text .= '</div>';
+2 -2
View File
@@ -1018,7 +1018,7 @@ class cache implements cache_loader {
$result = $data;
}
}
if ($result) {
if ($result !== false) {
if ($this->perfdebug) {
cache_helper::record_cache_hit('** static acceleration **', $this->definition);
}
@@ -2197,4 +2197,4 @@ class cache_session extends cache {
*/
class cache_request extends cache {
// This comment appeases code pre-checker ;) !
}
}
+33
View File
@@ -2173,6 +2173,39 @@ class core_cache_testcase extends advanced_testcase {
$startstats[$requestid]['stores']['cachestore_static']['sets']);
}
public function test_static_cache() {
global $CFG;
$this->resetAfterTest(true);
$CFG->perfdebug = 15;
// Create cache store with static acceleration.
$instance = cache_config_testing::instance();
$applicationid = 'phpunit/applicationperf';
$instance->phpunit_add_definition($applicationid, array(
'mode' => cache_store::MODE_APPLICATION,
'component' => 'phpunit',
'area' => 'applicationperf',
'simplekeys' => true,
'staticacceleration' => true,
'staticaccelerationsize' => 3
));
$application = cache::make('phpunit', 'applicationperf');
// Check that stores register sets.
$this->assertTrue($application->set('setMe1', 1));
$this->assertTrue($application->set('setMe2', 0));
$this->assertTrue($application->set('setMe3', array()));
$this->assertTrue($application->get('setMe1') !== false);
$this->assertTrue($application->get('setMe2') !== false);
$this->assertTrue($application->get('setMe3') !== false);
// Check that the static acceleration worked, even on empty arrays and the number 0.
$endstats = cache_helper::get_stats();
$this->assertEquals(0, $endstats[$applicationid]['stores']['** static acceleration **']['misses']);
$this->assertEquals(3, $endstats[$applicationid]['stores']['** static acceleration **']['hits']);
}
public function test_performance_debug_off() {
global $CFG;
$this->resetAfterTest(true);
+10 -5
View File
@@ -244,13 +244,16 @@ class rrule_manager {
// Generate timestamps that obey the rrule.
$eventtimes = $this->generate_recurring_event_times($eventrec);
// Adjust the parent event's timestart, if necessary.
// Update the parent event. Make sure that its repeat ID is the same as its ID.
$calevent = new calendar_event($eventrec);
$updatedata = new stdClass();
$updatedata->repeatid = $event->id;
// Also, adjust the parent event's timestart, if necessary.
if (count($eventtimes) > 0 && !in_array($eventrec->timestart, $eventtimes)) {
$calevent = new calendar_event($eventrec);
$updatedata = (object)['timestart' => $eventtimes[0], 'repeatid' => $eventrec->id];
$calevent->update($updatedata, false);
$eventrec->timestart = $calevent->timestart;
$updatedata->timestart = reset($eventtimes);
}
$calevent->update($updatedata, false);
$eventrec->timestart = $calevent->timestart;
// Create the recurring calendar events.
$this->create_recurring_events($eventrec, $eventtimes);
@@ -720,6 +723,8 @@ class rrule_manager {
$cloneevent->repeatid = $event->id;
$cloneevent->timestart = $time;
unset($cloneevent->id);
// UUID should only be set on the first instance of the recurring events.
unset($cloneevent->uuid);
calendar_event::create($cloneevent, false);
}
+4 -3
View File
@@ -58,9 +58,11 @@ if (!$course) {
$PAGE->set_context(context_system::instance()); //TODO: wrong
}
$title = get_string('deleteevent', 'calendar');
// Check the user has the required capabilities to edit an event
if (!calendar_edit_event_allowed($event)) {
print_error('nopermissions');
if (!calendar_edit_event_allowed($event) || !empty($event->modulename)) {
print_error('nopermissions', 'error', $PAGE->url, $title);
}
// Count the repeats, do we need to consider the possibility of deleting repeats
@@ -88,7 +90,6 @@ if ($confirm) {
}
// Prepare the page to show the confirmation form
$title = get_string('deleteevent', 'calendar');
$strcalendar = get_string('calendar', 'calendar');
$PAGE->navbar->add($strcalendar, $viewcalendarurl);
+2 -1
View File
@@ -72,7 +72,8 @@ class event_form extends moodleform {
if (!empty($eventtypes->groups) && is_array($eventtypes->groups)) {
$groupoptions = array();
foreach ($eventtypes->groups as $group) {
$groupoptions[$group->id] = $group->name;
$groupoptions[$group->id] = format_string($group->name, true,
array('context' => context_course::instance($group->courseid)));
}
$mform->addElement('select', 'groupid', get_string('typegroup', 'calendar'), $groupoptions);
$mform->disabledIf('groupid', 'eventtype', 'noteq', 'group');
+3 -2
View File
@@ -77,7 +77,8 @@ if (!empty($day) && !empty($mon) && !empty($year)) {
}
if ($courseid != SITEID && !empty($courseid)) {
$course = $DB->get_record('course', array('id' => $courseid));
// Course ID must be valid and existing.
$course = $DB->get_record('course', array('id' => $courseid), '*', MUST_EXIST);
$courses = array($course->id => $course);
$issite = false;
} else {
@@ -85,7 +86,7 @@ if ($courseid != SITEID && !empty($courseid)) {
$courses = calendar_get_default_courses();
$issite = true;
}
require_course_login($course);
require_login($course, false);
$url = new moodle_url('/calendar/export.php', array('time' => $time));
+20 -6
View File
@@ -193,10 +193,20 @@ foreach($events as $event) {
$hostaddress = str_replace('http://', '', $CFG->wwwroot);
$hostaddress = str_replace('https://', '', $hostaddress);
$ev = new iCalendar_event;
$me = new calendar_event($event); // To use moodle calendar event services.
$ev = new iCalendar_event; // To export in ical format.
$ev->add_property('uid', $event->id.'@'.$hostaddress);
$ev->add_property('summary', $event->name);
$ev->add_property('description', clean_param($event->description, PARAM_NOTAGS));
// Set iCal event summary from event name.
$ev->add_property('summary', format_string($event->name, true, ['context' => $me->context]));
// Format the description text.
$description = format_text($me->description, $me->format, ['context' => $me->context]);
// Then convert it to plain text, since it's the only format allowed for the event description property.
// We use html_to_text in order to convert <br> and <p> tags to new line characters for descriptions in HTML format.
$description = html_to_text($description, 0);
$ev->add_property('description', $description);
$ev->add_property('class', 'PUBLIC'); // PUBLIC / PRIVATE / CONFIDENTIAL
$ev->add_property('last-modified', Bennu::timestamp_to_datetime($event->timemodified));
$ev->add_property('dtstamp', Bennu::timestamp_to_datetime()); // now
@@ -204,10 +214,14 @@ foreach($events as $event) {
//dtend is better than duration, because it works in Microsoft Outlook and works better in Korganizer
$ev->add_property('dtstart', Bennu::timestamp_to_datetime($event->timestart)); // when event starts.
$ev->add_property('dtend', Bennu::timestamp_to_datetime($event->timestart + $event->timeduration));
} else if ($event->timeduration == 0) {
// When no duration is present, the event is instantaneous event, ex - Due date of a module.
// Moodle doesn't support all day events yet. See MDL-56227.
$ev->add_property('dtstart', Bennu::timestamp_to_datetime($event->timestart));
$ev->add_property('dtend', Bennu::timestamp_to_datetime($event->timestart));
} else {
// When no duration is present, ie an all day event, VALUE should be date instead of time and dtend = dtstart + 1 day.
$ev->add_property('dtstart', Bennu::timestamp_to_date($event->timestart), array('value' => 'DATE')); // All day event.
$ev->add_property('dtend', Bennu::timestamp_to_date($event->timestart + DAYSECS), array('value' => 'DATE')); // All day event.
// This can be used to represent all day events in future.
throw new coding_exception("Negative duration is not supported yet.");
}
if ($event->courseid != 0) {
$coursecontext = context_course::instance($event->courseid);
+3 -2
View File
@@ -81,8 +81,9 @@ class core_calendar_external extends external_api {
$eventobj = calendar_event::load($event['eventid']);
// Let's check if the user is allowed to delete an event.
if (!calendar_edit_event_allowed($eventobj)) {
throw new moodle_exception("nopermissions");
if (!empty($eventobj->modulename) || !calendar_edit_event_allowed($eventobj)) {
throw new moodle_exception("nopermissions", 'error', '',
get_string('deleteevent', 'calendar'));
}
// Time to do the magic.
$eventobj->delete($event['repeat']);
+3 -2
View File
@@ -411,7 +411,7 @@ function calendar_get_mini($courses, $groups, $users, $calmonth = false, $calyea
$name = format_string($event->name, true);
}
}
$popupcontent .= html_writer::link($dayhref, $name);
$popupcontent .= html_writer::link($dayhref, clean_text($name));
$popupcontent .= html_writer::end_tag('div');
}
@@ -3017,7 +3017,8 @@ function calendar_add_icalendar_event($event, $courseid, $subscriptionid, $timez
// Check to see if the event started at Midnight on the imported calendar.
date_default_timezone_set($timezone);
if (date('H:i:s', $eventrecord->timestart) === "00:00:00") {
// This event should be an all day event.
// This event should be an all day event. This is not correct, we don't do anything differently for all day events.
// See MDL-56227.
$eventrecord->timeduration = 0;
}
core_date::set_default_server_timezone();
+4 -2
View File
@@ -45,13 +45,15 @@ $PAGE->set_pagelayout('admin');
$PAGE->navbar->add(get_string('managesubscriptions', 'calendar'));
if ($courseid != SITEID && !empty($courseid)) {
$course = $DB->get_record('course', array('id' => $courseid));
// Course ID must be valid and existing.
$course = $DB->get_record('course', array('id' => $courseid), '*', MUST_EXIST);
$courses = array($course->id => $course);
} else {
$course = get_site();
$courses = calendar_get_default_courses();
}
require_course_login($course);
require_login($course, false);
if (!calendar_user_can_add_event($course)) {
print_error('errorcannotimport', 'calendar');
}
+23
View File
@@ -508,4 +508,27 @@ class core_calendar_externallib_testcase extends externallib_advanced_testcase {
$this->assertEquals(1, count($eventsret['events']));
$this->assertEquals(2, count($eventsret['warnings']));
}
/**
* Test for deleting module events.
*/
public function test_delete_calendar_events_for_modules() {
$this->resetAfterTest();
$this->setAdminUser();
$course = $this->getDataGenerator()->create_course();
$nexttime = time() + DAYSECS;
$this->getDataGenerator()->create_module('assign', ['course' => $course->id, 'duedate' => $nexttime]);
$events = calendar_get_events(time(), $nexttime, true, true, true);
$this->assertCount(1, $events);
$params = [];
foreach($events as $event) {
$params[] = [
'eventid' => $event->id,
'repeat' => false
];
}
$this->expectException('moodle_exception');
core_calendar_external::delete_calendar_events($params);
}
}
+57
View File
@@ -171,4 +171,61 @@ class core_calendar_lib_testcase extends advanced_testcase {
$event = reset($events);
$this->assertEquals('assign', $event->modulename);
}
/**
* Helper function to create calendar events using the old code.
*
* @param array $properties A list of calendar event properties to set
* @return calendar_event|bool
*/
protected function create_event($properties = []) {
$record = new \stdClass();
$record->name = 'event name';
$record->eventtype = 'global';
$record->timestart = time();
$record->timeduration = 0;
$record->timesort = 0;
$record->type = 1;
$record->courseid = 0;
foreach ($properties as $name => $value) {
$record->$name = $value;
}
$event = new calendar_event($record);
return $event->create($record, false);
}
/**
* Test that when course module is deleted all events are also deleted.
*/
public function test_delete_module_delete_events() {
global $DB;
$this->resetAfterTest(true);
$this->setAdminUser();
$user = $this->getDataGenerator()->create_user();
// Create the course we will be using.
$course = $this->getDataGenerator()->create_course();
$group = $this->getDataGenerator()->create_group(['courseid' => $course->id]);
foreach (core_component::get_plugin_list('mod') as $modname => $unused) {
try {
$generator = $this->getDataGenerator()->get_plugin_generator('mod_'.$modname);
} catch (coding_exception $e) {
// Module generator is not implemented.
continue;
}
$module = $generator->create_instance(['course' => $course->id]);
// Create bunch of events of different type (user override, group override, module event).
$this->create_event(['userid' => $user->id, 'modulename' => $modname, 'instance' => $module->id]);
$this->create_event(['groupid' => $group->id, 'modulename' => $modname, 'instance' => $module->id]);
$this->create_event(['modulename' => $modname, 'instance' => $module->id]);
$this->create_event(['modulename' => $modname, 'instance' => $module->id, 'courseid' => $course->id]);
// Delete module and make sure all events are deleted.
course_delete_module($module->cmid);
$this->assertEmpty($DB->get_record('event', ['modulename' => $modname, 'instance' => $module->id]));
}
}
}
+249 -115
View File
@@ -451,6 +451,9 @@ class core_calendar_rrule_manager_testcase extends advanced_testcase {
*/
public function test_every_300_days_forever() {
global $DB;
// Change the start date for forever events to 9am of the current date.
$this->change_event_startdate(date('Ymd\T090000'));
$startdatetime = new DateTime(date('Y-m-d H:i:s', $this->event->timestart));
$interval = new DateInterval('P300D');
@@ -463,14 +466,25 @@ class core_calendar_rrule_manager_testcase extends advanced_testcase {
$mang = new rrule_manager($rrule);
$mang->parse_rrule();
$mang->create_events($this->event);
$records = $DB->get_records('event', array('repeatid' => $this->event->id), 'timestart ASC');
// Get the first 100 samples. This should be enough to verify that we have generated the recurring events correctly.
$records = $DB->get_records('event', array('repeatid' => $this->event->id), 'timestart ASC', 0, 100);
$expecteddate = clone($startdatetime);
$first = true;
foreach ($records as $record) {
$this->assertLessThanOrEqual($until, $record->timestart);
$this->assertEquals($expecteddate->format('Y-m-d H:i:s'), date('Y-m-d H:i:s', $record->timestart));
// Go to next iteration.
$expecteddate->add($interval);
// Check UUID.
if ($first) {
// The first instance of the event contains the UUID.
$this->assertEquals('uuid', $record->uuid);
$first = false;
} else {
// Succeeding instances will not contain the UUID.
$this->assertEmpty($record->uuid);
}
}
}
@@ -542,8 +556,20 @@ class core_calendar_rrule_manager_testcase extends advanced_testcase {
$expecteddate->add($interval);
}
}
}
// Forever event. This should generate events over time() + 10 year period, every 50th Monday.
/**
* Test recurrence rules for weekly frequency for RRULE with BYDAY rule set, recurring forever.
*/
public function test_weekly_byday_forever() {
global $DB;
// Set the next Monday as the starting date of this event.
$startdate = new DateTime('next Monday');
// Change the start date of the parent event.
$startdate = $this->change_event_startdate($startdate->format('Ymd\T090000'));
// Forever event. This should generate events over time() + 10 year period, every 50 weeks.
$rrule = 'FREQ=WEEKLY;BYDAY=MO;INTERVAL=50';
$mang = new rrule_manager($rrule);
@@ -554,13 +580,14 @@ class core_calendar_rrule_manager_testcase extends advanced_testcase {
$untildate->add(new DateInterval('P10Y'));
$until = $untildate->getTimestamp();
$interval = new DateInterval('P50W');
$records = $DB->get_records('event', ['repeatid' => $this->event->id], 'timestart ASC', 'id, repeatid, timestart');
// First instance of this set of recurring events: Monday, 17-08-1998.
$interval = new DateInterval('P50W');
// First instance of this set of recurring events.
$expecteddate = clone($startdate);
$expecteddate->modify('1998-08-17');
$expecteddate->add($offsetinterval);
// Iterate over each record and increment the expected date accordingly.
foreach ($records as $record) {
$eventdateexpected = $expecteddate->format('Y-m-d H:i:s');
$eventdateactual = date('Y-m-d H:i:s', $record->timestart);
@@ -666,17 +693,21 @@ class core_calendar_rrule_manager_testcase extends advanced_testcase {
public function test_monthly_events_with_bymonthday_forever() {
global $DB;
// Change the start date for forever events to 9am of the 2nd day of the current month and year.
$this->change_event_startdate(date('Ym02\T090000'));
$startdatetime = new DateTime(date('Y-m-d H:i:s', $this->event->timestart));
$startdate = new DateTime(date('Y-m-d', $this->event->timestart));
$offsetinterval = $startdatetime->diff($startdate, true);
$interval = new DateInterval('P12M');
// Forever event. This should generate events over 10 year period, on 2nd day of every 12th month.
// Forever event. This should generate events over a 10-year period, on 2nd day of the month, every 12 months.
$rrule = "FREQ=MONTHLY;INTERVAL=12;BYMONTHDAY=2";
$mang = new rrule_manager($rrule);
$until = time() + (YEARSECS * $mang::TIME_UNLIMITED_YEARS);
$untildate = new DateTime();
$untildate->add(new DateInterval('P' . $mang::TIME_UNLIMITED_YEARS . 'Y'));
$until = $untildate->getTimestamp();
$mang->parse_rrule();
$mang->create_events($this->event);
@@ -818,24 +849,33 @@ class core_calendar_rrule_manager_testcase extends advanced_testcase {
public function test_monthly_events_with_byday_forever() {
global $DB;
// Change the start date for forever events to 9am of the 2nd day of the current month and year.
$this->change_event_startdate(date('Ym02\T090000'));
$startdatetime = new DateTime(date('Y-m-d H:i:s', $this->event->timestart));
$startdate = new DateTime(date('Y-m-d', $this->event->timestart));
$offsetinterval = $startdatetime->diff($startdate, true);
$interval = new DateInterval('P12M');
// Forever event. This should generate events over 10 year period, on 2nd day of every 12th month.
// Forever event. This should generate events over a 10 year period, on 1st Monday of the month every 12 months.
$rrule = "FREQ=MONTHLY;INTERVAL=12;BYDAY=1MO";
$mang = new rrule_manager($rrule);
$until = time() + (YEARSECS * $mang::TIME_UNLIMITED_YEARS);
$untildate = new DateTime();
$untildate->add(new DateInterval('P' . $mang::TIME_UNLIMITED_YEARS . 'Y'));
$until = $untildate->getTimestamp();
$mang->parse_rrule();
$mang->create_events($this->event);
$records = $DB->get_records('event', ['repeatid' => $this->event->id], 'timestart ASC', 'id, repeatid, timestart');
$expecteddate = new DateTime('first Monday of September 1998');
$expecteddate = new DateTime('first Monday of this month');
// Move to the next interval's first Monday if the calculated start date is after this month's first Monday.
if ($expecteddate->getTimestamp() < $startdate->getTimestamp()) {
$expecteddate->add($interval);
$expecteddate->modify('first Monday of this month');
}
foreach ($records as $record) {
$expecteddate->add($offsetinterval);
$this->assertLessThanOrEqual($until, $record->timestart);
@@ -880,7 +920,7 @@ class core_calendar_rrule_manager_testcase extends advanced_testcase {
// Create a yearly event, until the time limit is hit.
$until = strtotime('+20 day +10 years', $this->event->timestart);
$until = date('Ymd\THis\Z', $until);
$rrule = "FREQ=YEARLY;BYMONTH=9;UNTIL=$until"; // Forever event.
$rrule = "FREQ=YEARLY;BYMONTH=9;UNTIL=$until";
$mang = new rrule_manager($rrule);
$mang->parse_rrule();
$mang->create_events($this->event);
@@ -907,18 +947,6 @@ class core_calendar_rrule_manager_testcase extends advanced_testcase {
$this->assertTrue($result);
}
$rrule = "FREQ=YEARLY;BYMONTH=9;INTERVAL=2"; // Forever event.
$mang = new rrule_manager($rrule);
$until = time() + (YEARSECS * $mang::TIME_UNLIMITED_YEARS);
$mang->parse_rrule();
$mang->create_events($this->event);
for ($i = 0, $time = $this->event->timestart; $time < $until; $i++, $yoffset = $i * 2,
$time = strtotime("+$yoffset years", $this->event->timestart)) {
$result = $DB->record_exists('event', array('repeatid' => $this->event->id,
'timestart' => ($time)));
$this->assertTrue($result);
}
$rrule = "FREQ=YEARLY;COUNT=3;BYMONTH=9;BYDAY=1MO"; // This should generate 3 events in total.
$mang = new rrule_manager($rrule);
$mang->parse_rrule();
@@ -994,12 +1022,45 @@ class core_calendar_rrule_manager_testcase extends advanced_testcase {
}
}
/**
* Test for rrule with FREQ=YEARLY and INTERVAL=2 with BYMONTH rule set, recurring forever.
*/
public function test_yearly_september_every_two_years_forever() {
global $DB;
// Change the start date for forever events to 9am on the 2nd day of September of the current year.
$this->change_event_startdate(date('Y0902\T090000'));
$rrule = "FREQ=YEARLY;BYMONTH=9;INTERVAL=2"; // Forever event.
$mang = new rrule_manager($rrule);
$untildate = new DateTime();
$untildate->add(new DateInterval('P' . $mang::TIME_UNLIMITED_YEARS . 'Y'));
$untiltimestamp = $untildate->getTimestamp();
$mang->parse_rrule();
$mang->create_events($this->event);
$records = $DB->get_records('event', ['repeatid' => $this->event->id], 'timestart ASC', 'id, repeatid, timestart');
$interval = new DateInterval('P2Y');
$expecteddate = new DateTime(date('Y0902\T090000'));
foreach ($records as $record) {
$this->assertLessThanOrEqual($untiltimestamp, $record->timestart);
$this->assertEquals($expecteddate->format('Y-m-d H:i:s'), date('Y-m-d H:i:s', $record->timestart));
// Go to the next expected date.
$expecteddate->add($interval);
}
}
/**
* Test for rrule with FREQ=YEARLY with BYMONTH and BYDAY rules set, recurring forever.
*/
public function test_yearly_bymonth_byday_forever() {
global $DB;
// Change the start date for forever events to the first day of September of the current year at 9am.
$this->change_event_startdate(date('Y0901\T090000'));
// Every 2 years on the first Monday of September.
$rrule = "FREQ=YEARLY;BYMONTH=9;INTERVAL=2;BYDAY=1MO";
$mang = new rrule_manager($rrule);
@@ -1018,9 +1079,9 @@ class core_calendar_rrule_manager_testcase extends advanced_testcase {
$offsetinterval = $startdatetime->diff($startdate, true);
$interval = new DateInterval('P2Y');
// First occurrence of this set of events is on the first Monday of September 1999.
// First occurrence of this set of events is on the first Monday of September.
$expecteddate = clone($startdatetime);
$expecteddate->modify('first Monday of September 1999');
$expecteddate->modify('first Monday of September');
$expecteddate->add($offsetinterval);
foreach ($records as $record) {
$this->assertLessThanOrEqual($untiltimestamp, $record->timestart);
@@ -1040,6 +1101,9 @@ class core_calendar_rrule_manager_testcase extends advanced_testcase {
public function test_yearly_forever() {
global $DB;
// Change the start date for forever events to 9am of the current date.
$this->change_event_startdate(date('Ymd\T090000'));
$startdatetime = new DateTime(date('Y-m-d H:i:s', $this->event->timestart));
$interval = new DateInterval('P2Y');
@@ -1137,14 +1201,19 @@ class core_calendar_rrule_manager_testcase extends advanced_testcase {
/**
* Every other day - forever:
*
* DTSTART;TZID=US-Eastern:19970902T090000
* DTSTART;TZID=US-Eastern:[Current date]T090000
* RRULE:FREQ=DAILY;INTERVAL=2
* ==> (1997 9:00 AM EDT)September2,4,6,8...24,26,28,30;October 2,4,6...20,22,24
* (1997 9:00 AM EST)October 26,28,30;November 1,3,5,7...25,27,29;Dec 1,3,...
*
* Sample results (e.g. in the year 1997):
* (1997 9:00 AM EDT)September2,4,6,8...24,26,28,30;October 2,4,6...20,22,24
* (1997 9:00 AM EST)October 26,28,30;November 1,3,5,7...25,27,29;Dec 1,3,...
*/
public function test_every_other_day_forever() {
global $DB;
// Change the start date for forever events to 9am of the current date in US/Eastern time.
$this->change_event_startdate(date('Ymd\T090000'), 'US/Eastern');
$startdatetime = new DateTime(date('Y-m-d H:i:s', $this->event->timestart));
$interval = new DateInterval('P2D');
@@ -1153,7 +1222,8 @@ class core_calendar_rrule_manager_testcase extends advanced_testcase {
$mang->parse_rrule();
$mang->create_events($this->event);
$records = $DB->get_records('event', ['repeatid' => $this->event->id], 'timestart ASC', 'id, repeatid, timestart');
// Get the first 100 samples. This should be enough to verify that we have generated the recurring events correctly.
$records = $DB->get_records('event', ['repeatid' => $this->event->id], 'timestart ASC', 'id, repeatid, timestart', 0, 100);
$untildate = new DateTime();
$untildate->add(new DateInterval('P' . $mang::TIME_UNLIMITED_YEARS . 'Y'));
@@ -1331,16 +1401,21 @@ class core_calendar_rrule_manager_testcase extends advanced_testcase {
/**
* Every other week - forever:
*
* DTSTART;TZID=US-Eastern:19970902T090000
* DTSTART;TZID=US-Eastern:[Current date]T090000
* RRULE:FREQ=WEEKLY;INTERVAL=2;WKST=SU
* ==> (1997 9:00 AM EDT)September 2,16,30;October 14
* (1997 9:00 AM EST)October 28;November 11,25;December 9,23
* (1998 9:00 AM EST)January 6,20;February
* ...
*
* Sample results (e.g. in the year 1997):
* (1997 9:00 AM EDT)September 2,16,30;October 14
* (1997 9:00 AM EST)October 28;November 11,25;December 9,23
* (1998 9:00 AM EST)January 6,20;February
* ...
*/
public function test_every_other_week_forever() {
global $DB;
// Change the start date for forever events to 9am of the current date in US/Eastern time.
$this->change_event_startdate(date('Ymd\T090000'), 'US/Eastern');
$interval = new DateInterval('P2W');
$rrule = 'FREQ=WEEKLY;INTERVAL=2;WKST=SU';
@@ -1348,7 +1423,8 @@ class core_calendar_rrule_manager_testcase extends advanced_testcase {
$mang->parse_rrule();
$mang->create_events($this->event);
$records = $DB->get_records('event', ['repeatid' => $this->event->id], 'timestart ASC', 'id, repeatid, timestart');
// Get the first 100 samples. This should be enough to verify that we have generated the recurring events correctly.
$records = $DB->get_records('event', ['repeatid' => $this->event->id], 'timestart ASC', 'id, repeatid, timestart', 0, 100);
$untildate = new DateTime();
$untildate->add(new DateInterval('P' . $mang::TIME_UNLIMITED_YEARS . 'Y'));
@@ -1694,25 +1770,28 @@ class core_calendar_rrule_manager_testcase extends advanced_testcase {
/**
* Monthly on the third to the last day of the month, forever:
*
* DTSTART;TZID=US-Eastern:19970928T090000
* DTSTART;TZID=US-Eastern:[Current year]0928T090000
* RRULE:FREQ=MONTHLY;BYMONTHDAY=-3
* ==> (1997 9:00 AM EDT)September 28
* (1997 9:00 AM EST)October 29;November 28;December 29
* (1998 9:00 AM EST)January 29;February 26
* ...
*
* Sample results (e.g. in the year 1997):
* (1997 9:00 AM EDT)September 28
* (1997 9:00 AM EST)October 29;November 28;December 29
* (1998 9:00 AM EST)January 29;February 26
* ...
*/
public function test_third_to_the_last_day_of_the_month_forever() {
global $DB;
// Change our event's date to 05-09-1997, based on the example from the RFC.
$this->change_event_startdate('19970928T090000', 'US/Eastern');
// Change our event's date to 28 September of the current year, based on the example from the RFC.
$this->change_event_startdate(date('Y0928\T090000'), 'US/Eastern');
$rrule = 'FREQ=MONTHLY;BYMONTHDAY=-3';
$mang = new rrule_manager($rrule);
$mang->parse_rrule();
$mang->create_events($this->event);
$records = $DB->get_records('event', ['repeatid' => $this->event->id], 'timestart ASC', 'id, repeatid, timestart');
// Get the first 100 samples. This should be enough to verify that we have generated the recurring events correctly.
$records = $DB->get_records('event', ['repeatid' => $this->event->id], 'timestart ASC', 'id, repeatid, timestart', 0, 100);
$untildate = new DateTime();
$untildate->add(new DateInterval('P' . $mang::TIME_UNLIMITED_YEARS . 'Y'));
@@ -1868,22 +1947,29 @@ class core_calendar_rrule_manager_testcase extends advanced_testcase {
/**
* Every Tuesday, every other month:
*
* DTSTART;TZID=US-Eastern:19970902T090000
* DTSTART;TZID=US-Eastern:[Next Tuesday]T090000
* RRULE:FREQ=MONTHLY;INTERVAL=2;BYDAY=TU
* ==> (1997 9:00 AM EDT)September 2,9,16,23,30
* (1997 9:00 AM EST)November 4,11,18,25
* (1998 9:00 AM EST)January 6,13,20,27;March 3,10,17,24,31
* ...
*
* Sample results (e.g. in the year 1997):
* (1997 9:00 AM EDT)September 2,9,16,23,30
* (1997 9:00 AM EST)November 4,11,18,25
* (1998 9:00 AM EST)January 6,13,20,27;March 3,10,17,24,31
* ...
*/
public function test_every_tuesday_every_other_month_forever() {
global $DB;
// Change the start date for forever events to 9am of the Tuesday on or before of the current date in US/Eastern time.
$nexttuesday = new DateTime('next Tuesday');
$this->change_event_startdate($nexttuesday->format('Ymd\T090000'), 'US/Eastern');
$rrule = 'FREQ=MONTHLY;INTERVAL=2;BYDAY=TU';
$mang = new rrule_manager($rrule);
$mang->parse_rrule();
$mang->create_events($this->event);
$records = $DB->get_records('event', ['repeatid' => $this->event->id], 'timestart ASC', 'id, repeatid, timestart');
// Get the first 100 samples. This should be enough to verify that we have generated the recurring events correctly.
$records = $DB->get_records('event', ['repeatid' => $this->event->id], 'timestart ASC', 'id, repeatid, timestart', 0, 100);
$untildate = new DateTime();
$untildate->add(new DateInterval('P' . $mang::TIME_UNLIMITED_YEARS . 'Y'));
@@ -2053,18 +2139,22 @@ class core_calendar_rrule_manager_testcase extends advanced_testcase {
/**
* Every 20th Monday of the year, forever:
*
* DTSTART;TZID=US-Eastern:19970519T090000
* DTSTART;TZID=US-Eastern:[20th Monday of the current year]T090000
* RRULE:FREQ=YEARLY;BYDAY=20MO
* ==> (1997 9:00 AM EDT)May 19
* (1998 9:00 AM EDT)May 18
* (1999 9:00 AM EDT)May 17
* ...
*
* Sample results (e.g. in the year 1997):
* (1997 9:00 AM EDT)May 19
* (1998 9:00 AM EDT)May 18
* (1999 9:00 AM EDT)May 17
* ...
*/
public function test_yearly_every_20th_monday_forever() {
global $DB;
// Change our event's date to 19-05-1997, based on the example from the RFC.
$startdatetime = $this->change_event_startdate('19970519T090000', 'US/Eastern');
// Change our event's date to the 20th Monday of the current year.
$twentiethmonday = new DateTime(date('Y-01-01'));
$twentiethmonday->modify('+20 Monday');
$startdatetime = $this->change_event_startdate($twentiethmonday->format('Ymd\T090000'), 'US/Eastern');
$startdate = new DateTime($startdatetime->format('Y-m-d'));
@@ -2100,18 +2190,22 @@ class core_calendar_rrule_manager_testcase extends advanced_testcase {
/**
* Monday of week number 20 (where the default start of the week is Monday), forever:
*
* DTSTART;TZID=US-Eastern:19970512T090000
* DTSTART;TZID=US-Eastern:[1st day of the 20th week this year]T090000
* RRULE:FREQ=YEARLY;BYWEEKNO=20;BYDAY=MO
* ==> (1997 9:00 AM EDT)May 12
* (1998 9:00 AM EDT)May 11
* (1999 9:00 AM EDT)May 17
* ...
*
* Sample results (e.g. in the year 1997):
* (1997 9:00 AM EDT)May 12
* (1998 9:00 AM EDT)May 11
* (1999 9:00 AM EDT)May 17
* ...
*/
public function test_yearly_byweekno_forever() {
global $DB;
// Change our event's date to 12-05-1997, based on the example from the RFC.
$startdatetime = $this->change_event_startdate('19970512T090000', 'US/Eastern');
// Change our event's date to the start of the 20th week of the current year.
$twentiethweek = new DateTime(date('Y-01-01'));
$twentiethweek->setISODate($twentiethweek->format('Y'), 20);
$startdatetime = $this->change_event_startdate($twentiethweek->format('Ymd\T090000'), 'US/Eastern');
$startdate = clone($startdatetime);
$startdate->modify($startdate->format('Y-m-d'));
@@ -2146,18 +2240,21 @@ class core_calendar_rrule_manager_testcase extends advanced_testcase {
/**
* Every Thursday in March, forever:
*
* DTSTART;TZID=US-Eastern:19970313T090000
* DTSTART;TZID=US-Eastern:[First thursday of March of the current year]T090000
* RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=TH
* ==> (1997 9:00 AM EST)March 13,20,27
* (1998 9:00 AM EST)March 5,12,19,26
* (1999 9:00 AM EST)March 4,11,18,25
* ...
*
* Sample results (e.g. in the year 1997):
* (1997 9:00 AM EST)March 13,20,27
* (1998 9:00 AM EST)March 5,12,19,26
* (1999 9:00 AM EST)March 4,11,18,25
* ...
*/
public function test_every_thursday_in_march_forever() {
global $DB;
// Change our event's date to 12-05-1997, based on the example from the RFC.
$startdatetime = $this->change_event_startdate('19970313T090000', 'US/Eastern');
// Change our event's date to the first Thursday of March of the current year at 9am US/Eastern time.
$firstthursdayofmarch = new DateTime('first Thursday of March');
$startdatetime = $this->change_event_startdate($firstthursdayofmarch->format('Ymd\T090000'), 'US/Eastern');
$interval = new DateInterval('P1Y');
@@ -2166,7 +2263,8 @@ class core_calendar_rrule_manager_testcase extends advanced_testcase {
$mang->parse_rrule();
$mang->create_events($this->event);
$records = $DB->get_records('event', ['repeatid' => $this->event->id], 'timestart ASC', 'id, repeatid, timestart');
// Get the first 100 samples. This should be enough to verify that we have generated the recurring events correctly.
$records = $DB->get_records('event', ['repeatid' => $this->event->id], 'timestart ASC', 'id, repeatid, timestart', 0, 100);
$untildate = new DateTime();
$untildate->add(new DateInterval('P' . $mang::TIME_UNLIMITED_YEARS . 'Y'));
@@ -2176,7 +2274,7 @@ class core_calendar_rrule_manager_testcase extends advanced_testcase {
$startdate = new DateTime($startdatetime->format('Y-m-d'));
$offsetinterval = $startdatetime->diff($startdate, true);
$expecteddate->setTimezone(new DateTimeZone(get_user_timezone()));
$april1st = new DateTime('1997-04-01');
$april1st = new DateTime('April 1');
foreach ($records as $record) {
$this->assertLessThanOrEqual($untiltimestamp, $record->timestart);
$this->assertEquals($expecteddate->format('Y-m-d H:i:s'), date('Y-m-d H:i:s', $record->timestart));
@@ -2201,18 +2299,21 @@ class core_calendar_rrule_manager_testcase extends advanced_testcase {
/**
* Every Thursday, but only during June, July, and August, forever:
*
* DTSTART;TZID=US-Eastern:19970605T090000
* DTSTART;TZID=US-Eastern:[First Thursday of June of the current year]T090000
* RRULE:FREQ=YEARLY;BYDAY=TH;BYMONTH=6,7,8
* ==> (1997 9:00 AM EDT)June 5,12,19,26;July 3,10,17,24,31;August 7,14,21,28
* (1998 9:00 AM EDT)June 4,11,18,25;July 2,9,16,23,30;August 6,13,20,27
* (1999 9:00 AM EDT)June 3,10,17,24;July 1,8,15,22,29;August 5,12,19,26
* ...
*
* Sample results (e.g. in the year 1997):
* (1997 9:00 AM EDT)June 5,12,19,26;July 3,10,17,24,31;August 7,14,21,28
* (1998 9:00 AM EDT)June 4,11,18,25;July 2,9,16,23,30;August 6,13,20,27
* (1999 9:00 AM EDT)June 3,10,17,24;July 1,8,15,22,29;August 5,12,19,26
* ...
*/
public function test_every_thursday_june_july_august_forever() {
global $DB;
// Change our event's date to 05-06-1997, based on the example from the RFC.
$startdatetime = $this->change_event_startdate('19970605T090000', 'US/Eastern');
// Change our event's date to the first Thursday of June in the current year at 9am US/Eastern time.
$firstthursdayofjune = new DateTime('first Thursday of June');
$startdatetime = $this->change_event_startdate($firstthursdayofjune->format('Ymd\T090000'), 'US/Eastern');
$startdate = new DateTime($startdatetime->format('Y-m-d'));
@@ -2225,14 +2326,15 @@ class core_calendar_rrule_manager_testcase extends advanced_testcase {
$mang->parse_rrule();
$mang->create_events($this->event);
$records = $DB->get_records('event', ['repeatid' => $this->event->id], 'timestart ASC', 'id, repeatid, timestart');
// Get the first 100 samples. This should be enough to verify that we have generated the recurring events correctly.
$records = $DB->get_records('event', ['repeatid' => $this->event->id], 'timestart ASC', 'id, repeatid, timestart', 0, 100);
$untildate = new DateTime();
$untildate->add(new DateInterval('P' . $mang::TIME_UNLIMITED_YEARS . 'Y'));
$untiltimestamp = $untildate->getTimestamp();
$expecteddate = new DateTime(date('Y-m-d H:i:s', $startdatetime->getTimestamp()));
$september1st = new DateTime('1997-09-01');
$september1st = new DateTime('September 1');
foreach ($records as $record) {
$this->assertLessThanOrEqual($untiltimestamp, $record->timestart);
$this->assertEquals($expecteddate->format('Y-m-d H:i:s'), date('Y-m-d H:i:s', $record->timestart));
@@ -2254,22 +2356,28 @@ class core_calendar_rrule_manager_testcase extends advanced_testcase {
/**
* Every Friday the 13th, forever:
*
* DTSTART;TZID=US-Eastern:19970902T090000
* EXDATE;TZID=US-Eastern:19970902T090000
* DTSTART;TZID=US-Eastern:[Current date]T090000
* RRULE:FREQ=MONTHLY;BYDAY=FR;BYMONTHDAY=13
* ==> (1998 9:00 AM EST)February 13;March 13;November 13
* (1999 9:00 AM EDT)August 13
* (2000 9:00 AM EDT)October 13
*
* Sample results (e.g. in the year 1997):
* (1998 9:00 AM EST)February 13;March 13;November 13
* (1999 9:00 AM EDT)August 13
* (2000 9:00 AM EDT)October 13
* ...
*/
public function test_friday_the_thirteenth_forever() {
global $DB;
// Change our event's date to the first Thursday of June in the current year at 9am US/Eastern time.
$this->change_event_startdate(date('Ymd\T090000'), 'US/Eastern');
$rrule = 'FREQ=MONTHLY;BYDAY=FR;BYMONTHDAY=13';
$mang = new rrule_manager($rrule);
$mang->parse_rrule();
$mang->create_events($this->event);
$records = $DB->get_records('event', ['repeatid' => $this->event->id], 'timestart ASC', 'id, repeatid, timestart');
// Get the first 100 samples. This should be enough to verify that we have generated the recurring events correctly.
$records = $DB->get_records('event', ['repeatid' => $this->event->id], 'timestart ASC', 'id, repeatid, timestart', 0, 100);
$untildate = new DateTime();
$untildate->add(new DateInterval('P' . $mang::TIME_UNLIMITED_YEARS . 'Y'));
@@ -2285,17 +2393,22 @@ class core_calendar_rrule_manager_testcase extends advanced_testcase {
/**
* The first Saturday that follows the first Sunday of the month, forever:
*
* DTSTART;TZID=US-Eastern:19970913T090000
* DTSTART;TZID=US-Eastern:[The Saturday after the month's first Sunday]T090000
* RRULE:FREQ=MONTHLY;BYDAY=SA;BYMONTHDAY=7,8,9,10,11,12,13
* ==> (1997 9:00 AM EDT)September 13;October 11
* (1997 9:00 AM EST)November 8;December 13
* (1998 9:00 AM EST)January 10;February 7;March 7
* (1998 9:00 AM EDT)April 11;May 9;June 13...
*
* Sample results (e.g. from 13 September 1997):
* (1997 9:00 AM EDT)September 13;October 11
* (1997 9:00 AM EST)November 8;December 13
* (1998 9:00 AM EST)January 10;February 7;March 7
* (1998 9:00 AM EDT)April 11;May 9;June 13...
*/
public function test_first_saturday_following_first_sunday_forever() {
global $DB;
$startdatetime = $this->change_event_startdate('19970913T090000', 'US/Eastern');
// Change our event's date to the next Saturday after the first Sunday of the the current month at 9am US/Eastern time.
$firstsaturdayafterfirstsunday = new DateTime('first Sunday of this month');
$firstsaturdayafterfirstsunday->modify('next Saturday');
$startdatetime = $this->change_event_startdate($firstsaturdayafterfirstsunday->format('Ymd\T090000'), 'US/Eastern');
$startdate = new DateTime($startdatetime->format('Y-m-d'));
$offset = $startdatetime->diff($startdate, true);
@@ -2304,7 +2417,8 @@ class core_calendar_rrule_manager_testcase extends advanced_testcase {
$mang->parse_rrule();
$mang->create_events($this->event);
$records = $DB->get_records('event', ['repeatid' => $this->event->id], 'timestart ASC', 'id, repeatid, timestart');
// Get the first 100 samples. This should be enough to verify that we have generated the recurring events correctly.
$records = $DB->get_records('event', ['repeatid' => $this->event->id], 'timestart ASC', 'id, repeatid, timestart', 0, 100);
$untildate = new DateTime();
$untildate->add(new DateInterval('P' . $mang::TIME_UNLIMITED_YEARS . 'Y'));
@@ -2330,17 +2444,29 @@ class core_calendar_rrule_manager_testcase extends advanced_testcase {
/**
* Every four years, the first Tuesday after a Monday in November, forever (U.S. Presidential Election day):
*
* DTSTART;TZID=US-Eastern:19961105T090000
* DTSTART;TZID=US-Eastern:[Most recent election date]T090000
* RRULE:FREQ=YEARLY;INTERVAL=4;BYMONTH=11;BYDAY=TU;BYMONTHDAY=2,3,4,5,6,7,8
* ==> (1996 9:00 AM EST)November 5
* (2000 9:00 AM EST)November 7
* (2004 9:00 AM EST)November 2
* ...
*
* Sample results (e.g. from 05 November 1996):
* (1996 9:00 AM EST)November 5
* (2000 9:00 AM EST)November 7
* (2004 9:00 AM EST)November 2
* ...
*/
public function test_every_us_presidential_election_forever() {
global $DB;
$startdatetime = $this->change_event_startdate('19961105T090000', 'US/Eastern');
// Calculate the most recent election date, starting from 1996 (e.g. today's 2017 so the most recent election was in 2016).
$currentyear = (int) date('Y');
$electionyear = 1996;
while ($electionyear + 4 < $currentyear) {
$electionyear += 4;
}
$electiondate = new DateTime('first Monday of November ' . $electionyear);
$electiondate->modify('+1 Tuesday');
// Use the most recent election date as the starting date of our recurring events.
$startdatetime = $this->change_event_startdate($electiondate->format('Ymd\T090000'), 'US/Eastern');
$startdate = new DateTime($startdatetime->format('Y-m-d'));
$offset = $startdatetime->diff($startdate, true);
@@ -2407,23 +2533,27 @@ class core_calendar_rrule_manager_testcase extends advanced_testcase {
* The 2nd to last weekday of the month:
*
* DTSTART;TZID=US-Eastern:19970929T090000
* RRULE:FREQ=MONTHLY;BYDAY=MO,TU,WE,TH,FR;BYSETPOS=-2
* RRULE:FREQ=MONTHLY;BYDAY=MO,TU,WE,TH,FR;BYSETPOS=-2;COUNT=7
* ==> (1997 9:00 AM EDT)September 29
* (1997 9:00 AM EST)October 30;November 27;December 30
* (1998 9:00 AM EST)January 29;February 26;March 30
* ...
*
* (Original RFC example is set to recur forever. But we just want to verify that the results match the dates listed from
* the RFC example. So just limit the count to 7.)
*/
public function test_second_to_the_last_weekday_of_the_month_forever() {
public function test_second_to_the_last_weekday_of_the_month() {
global $DB;
$this->change_event_startdate('19970929T090000', 'US/Eastern');
$rrule = 'FREQ=MONTHLY;BYDAY=MO,TU,WE,TH,FR;BYSETPOS=-2';
$rrule = 'FREQ=MONTHLY;BYDAY=MO,TU,WE,TH,FR;BYSETPOS=-2;COUNT=7';
$mang = new rrule_manager($rrule);
$mang->parse_rrule();
$mang->create_events($this->event);
$records = $DB->get_records('event', ['repeatid' => $this->event->id], 'timestart ASC', 'id, repeatid, timestart');
// Get the first 7 samples. This should be enough to verify that we have generated the recurring events correctly.
$records = $DB->get_records('event', ['repeatid' => $this->event->id], 'timestart ASC', 'id, repeatid, timestart', 0, 7);
$expecteddates = [
(new DateTime('1997-09-29 09:00:00 EDT'))->getTimestamp(),
@@ -2444,10 +2574,8 @@ class core_calendar_rrule_manager_testcase extends advanced_testcase {
$this->assertLessThanOrEqual($untiltimestamp, $record->timestart);
// Confirm that the first 7 records correspond to the expected dates listed above.
if ($i < 7) {
$this->assertEquals($expecteddates[$i], $record->timestart);
$i++;
}
$this->assertEquals($expecteddates[$i], $record->timestart);
$i++;
}
}
@@ -2747,13 +2875,19 @@ class core_calendar_rrule_manager_testcase extends advanced_testcase {
/**
* Change the event's timestart (DTSTART) based on the test's needs.
*
* @param string $datestr The date string. In YYYYmmddThhiiss format. e.g. 19990902T090000.
* @param string $timezonestr A valid timezone string. e.g. 'US/Eastern'.
* @param string $datestr The date string. In 'Ymd\This' format. e.g. 19990902T090000.
* @param null|string $timezonestr A valid timezone string. e.g. 'US/Eastern'.
* If not provided, the default timezone will be used.
* @return bool|DateTime
*/
protected function change_event_startdate($datestr, $timezonestr) {
$timezone = new DateTimeZone($timezonestr);
$newdatetime = DateTime::createFromFormat('Ymd\THis', $datestr, $timezone);
protected function change_event_startdate($datestr, $timezonestr = null) {
// Use default timezone if not provided.
if ($timezonestr === null) {
$newdatetime = DateTime::createFromFormat('Ymd\THis', $datestr);
} else {
$timezone = new DateTimeZone($timezonestr);
$newdatetime = DateTime::createFromFormat('Ymd\THis', $datestr, $timezone);
}
// Update the start date of the parent event.
$calevent = calendar_event::load($this->event->id);
+3 -2
View File
@@ -85,7 +85,8 @@ $url->param('time', $time);
$PAGE->set_url($url);
if ($courseid != SITEID && !empty($courseid)) {
$course = $DB->get_record('course', array('id' => $courseid));
// Course ID must be valid and existing.
$course = $DB->get_record('course', array('id' => $courseid), '*', MUST_EXIST);
$courses = array($course->id => $course);
$issite = false;
navigation_node::override_active_url(new moodle_url('/course/view.php', array('id' => $course->id)));
@@ -95,7 +96,7 @@ if ($courseid != SITEID && !empty($courseid)) {
$issite = true;
}
require_course_login($course);
require_login($course, false);
$calendar = new calendar_information(0, 0, 0, $time);
$calendar->prepare_for_view($course, $courses);
+2
View File
@@ -23,6 +23,8 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
require_once("$CFG->libdir/externallib.php");
class core_cohort_external extends external_api {
+2
View File
@@ -24,6 +24,8 @@
* @since Moodle 2.9
*/
defined('MOODLE_INTERNAL') || die();
require_once("$CFG->libdir/externallib.php");
require_once("$CFG->dirroot/comment/lib.php");
+2 -1
View File
@@ -1349,7 +1349,8 @@ class api {
JOIN {user} u
ON u.id = uc.userid
WHERE (uc.status = :waitingforreview
OR (uc.status = :inreview AND uc.reviewerid = :reviewerid))";
OR (uc.status = :inreview AND uc.reviewerid = :reviewerid))
AND u.deleted = 0";
$ordersql = " ORDER BY c.shortname ASC";
$params = array(
'inreview' => user_competency::STATUS_IN_REVIEW,
+3 -1
View File
@@ -243,7 +243,9 @@ class course_competency extends persistent {
public static function list_courses($competencyid) {
global $DB;
$results = $DB->get_records_sql('SELECT course.id, course.visible, course.shortname, course.idnumber, course.fullname
$results = $DB->get_records_sql('SELECT course.id, course.visible, course.shortname, course.idnumber,
course.fullname, course.summary, course.summaryformat, course.startdate,
course.enddate
FROM {course} course
JOIN {' . self::TABLE . '} coursecomp
ON coursecomp.courseid = course.id
@@ -243,6 +243,8 @@ class user_competency_course extends persistent {
$sql = 'SELECT COUNT(comp.id)
FROM {' . self::TABLE . '} usercoursecomp
JOIN {' . course_competency::TABLE . '} cc
ON usercoursecomp.competencyid = cc.competencyid AND cc.courseid = usercoursecomp.courseid
JOIN {' . competency::TABLE . '} comp
ON usercoursecomp.competencyid = comp.id
WHERE usercoursecomp.courseid = ? AND usercoursecomp.userid = ? AND usercoursecomp.proficiency = ?';
+15 -1
View File
@@ -4564,6 +4564,9 @@ class core_competency_api_testcase extends advanced_testcase {
}
public function test_list_user_competencies_to_review() {
global $CFG;
require_once($CFG->dirroot . '/user/lib.php');
$dg = $this->getDataGenerator();
$this->resetAfterTest();
$ccg = $dg->get_plugin_generator('core_competency');
@@ -4580,10 +4583,12 @@ class core_competency_api_testcase extends advanced_testcase {
$u1 = $dg->create_user();
$u2 = $dg->create_user();
$u3 = $dg->create_user();
$f1 = $ccg->create_framework();
$c1 = $ccg->create_competency(['competencyframeworkid' => $f1->get_id()]);
$c2 = $ccg->create_competency(['competencyframeworkid' => $f1->get_id()]);
$c3 = $ccg->create_competency(['competencyframeworkid' => $f1->get_id()]);
$c4 = $ccg->create_competency(['competencyframeworkid' => $f1->get_id()]);
$uc1a = $ccg->create_user_competency(['userid' => $u1->id, 'competencyid' => $c1->get_id(),
'status' => user_competency::STATUS_IDLE]);
$uc1b = $ccg->create_user_competency(['userid' => $u1->id, 'competencyid' => $c2->get_id(),
@@ -4596,14 +4601,23 @@ class core_competency_api_testcase extends advanced_testcase {
'status' => user_competency::STATUS_IDLE]);
$uc2c = $ccg->create_user_competency(['userid' => $u2->id, 'competencyid' => $c3->get_id(),
'status' => user_competency::STATUS_IN_REVIEW]);
$uc3a = $ccg->create_user_competency(['userid' => $u3->id, 'competencyid' => $c4->get_id(),
'status' => user_competency::STATUS_WAITING_FOR_REVIEW]);
// The reviewer can review all plans waiting for review, or in review where they are the reviewer.
$this->setUser($reviewer);
$result = api::list_user_competencies_to_review();
$this->assertEquals(3, $result['count']);
$this->assertEquals(4, $result['count']);
$this->assertEquals($uc2a->get_id(), $result['competencies'][0]->usercompetency->get_id());
$this->assertEquals($uc1b->get_id(), $result['competencies'][1]->usercompetency->get_id());
$this->assertEquals($uc1c->get_id(), $result['competencies'][2]->usercompetency->get_id());
$this->assertEquals($uc3a->get_id(), $result['competencies'][3]->usercompetency->get_id());
// Now, let's delete user 3.
// It should not be listed on user competencies to review any more.
user_delete_user($u3);
$result = api::list_user_competencies_to_review();
$this->assertEquals(3, $result['count']);
// The reviewer cannot view the plans when they do not have the permission in the user's context.
role_assign($roleprohibit, $reviewer->id, context_user::instance($u2->id)->id);

Some files were not shown because too many files have changed in this diff Show More