Compare commits

...

317 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7) 22bce961b7 Moodle release 3.3.3 2017-11-11 19:29:38 +01:00
AMOS bot ec6731b117 Automatically generated installer lang files 2017-11-11 00:05:47 +00:00
David Monllao c99581ca26 weekly release 3.3.2+ 2017-11-10 15:15:25 +01:00
David Monllao 32ae0dd852 Merge branch 'install_33_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_33_STABLE 2017-11-10 15:15:23 +01:00
Jun Pataleta 3d7db9e878 Merge branch 'MDL-60771-33' of git://github.com/lameze/moodle into MOODLE_33_STABLE 2017-11-10 18:03:31 +13:00
Damyon Wiese e6b9178eaa Merge branch 'MDL-60749-33' of git://github.com/sarjona/moodle into MOODLE_33_STABLE 2017-11-10 12:06:35 +08:00
Simey Lameze 5c7be99010 MDL-60771 mod_scorm: typecast score to integer 2017-11-10 12:02:48 +08:00
Andrew Nicols 77952f9b6f Merge branch 'MDL-52838-33' of git://github.com/damyon/moodle into MOODLE_33_STABLE 2017-11-10 11:50:03 +08:00
Damyon Wiese 2fa0109fbf 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:33 +08:00
Sara Arjona f3e4a11dce MDL-60749 scorm: Remove   from files when downloading 2017-11-09 10:19:36 +01:00
Sara Arjona 038bc7f900 MDL-60550 user: Add more restrictions in keyword searches
Original patch provided by Tim Schroeder.
2017-11-09 15:50:29 +08:00
David Monllao b7abe12fb7 Merge branch 'MDL-60615-33' of git://github.com/damyon/moodle into MOODLE_33_STABLE 2017-11-09 08:49:03 +01:00
Damyon Wiese 5e06871c05 Merge branch 'MDL-60752-33' of git://github.com/andrewnicols/moodle into MOODLE_33_STABLE 2017-11-09 15:10:30 +08:00
Damyon Wiese 365a403c25 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:42 +08:00
Andrew Nicols 22baec7429 MDL-60752 lti: Compare text in types_config properly 2017-11-09 14:27:01 +08:00
AMOS bot bcfe44feb5 Automatically generated installer lang files 2017-11-09 00:05:11 +00:00
David Monllao 8526700385 Merge branch 'MDL-60720-m33' of https://github.com/sammarshallou/moodle into MOODLE_33_STABLE 2017-11-08 17:32:40 +01:00
David Monllao f47f92c0b1 Merge branch 'MDL-58699-33' of git://github.com/damyon/moodle into MOODLE_33_STABLE 2017-11-08 15:56:36 +01:00
David Monllao a43556a44f MDL-60733 oauth: Remove outdated comment 2017-11-08 12:04:55 +01:00
David Monllao 3417cf93e0 Merge branch 'MDL-60733-33' of git://github.com/damyon/moodle into MOODLE_33_STABLE 2017-11-08 12:04:47 +01:00
David Monllao 64baebd086 weekly release 3.3.2+ 2017-11-08 09:47:27 +01:00
David Monllao 45a0cd6120 Merge branch 'install_33_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_33_STABLE 2017-11-08 09:47:26 +01:00
Damyon Wiese c8e7e1c3c5 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:34 +08:00
Jun Pataleta 6493f30813 Merge branch 'MDL-60717-33-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_33_STABLE 2017-11-08 14:43:35 +13:00
AMOS bot 49ecb5e880 Automatically generated installer lang files 2017-11-08 00:05:13 +00:00
Helen Foster 3417222e0a 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:52 +01:00
sam marshall 0d982a293c 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:39:16 +00:00
Jake Dallimore ad51194713 Merge branch 'MDL-57772-33' of git://github.com/damyon/moodle into MOODLE_33_STABLE 2017-11-07 15:01:53 +08:00
Damyon Wiese d2d3a57a6b 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:22 +08:00
Damyon Wiese 7b567a1fea MDL-57772 chat: BEEP is back baby! 2017-11-07 11:25:17 +08:00
sam marshall 66fe9b5b5f 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:07:48 +08:00
David Monllao 3c171cae05 Merge branch 'MDL-60424-33' of git://github.com/jleyva/moodle into MOODLE_33_STABLE 2017-11-06 21:12:28 +01:00
Damyon Wiese b805234673 Merge branch 'MDL-59858-33' of git://github.com/junpataleta/moodle into MOODLE_33_STABLE 2017-11-06 11:14:06 +08:00
Damyon Wiese 047785fbfd Merge branch 'MDL-60437_33-multilang-html-block-titles' of https://github.com/lucaboesch/moodle into MOODLE_33_STABLE 2017-11-06 10:11:32 +08:00
Jun Pataleta 2665ad8aea MDL-59858 amd: Focus on the element that actually triggers the modal 2017-11-06 13:20:47 +13:00
AMOS bot ff78163dbd Automatically generated installer lang files 2017-11-05 00:06:04 +00:00
Luca Bösch 70de3574bb MDL-60437 blocks: HTML block title multilang 2017-11-03 16:36:41 +01:00
David Monllao 125d60d769 weekly release 3.3.2+ 2017-11-03 10:25:16 +01:00
Juan Leyva 3ae3f0e2ee 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:41:44 +01:00
Jake Dallimore e6b5450a2b Merge branch 'MDL-58047-33-fix1' of http://github.com/damyon/moodle into MOODLE_33_STABLE 2017-11-03 16:10:53 +08:00
Damyon Wiese f1e8521765 MDL-58047 assign: submission sorting
Only exclude new submission records from the sorting, draft and reopened submission are valid.
2017-11-03 15:56:03 +08:00
David Monllao e60ad856d8 Merge branch 'MDL-58047-33-sortbysubmission' of https://github.com/roperto/moodle into MOODLE_33_STABLE 2017-11-02 16:57:56 +01:00
David Monllao 9446ec2399 Merge branch 'MDL-51945-33' of git://github.com/jleyva/moodle into MOODLE_33_STABLE 2017-11-02 16:54:45 +01:00
David Monllao c191acfdd6 Merge branch 'MDL-60634-33' of git://github.com/jleyva/moodle into MOODLE_33_STABLE 2017-11-02 13:25:09 +01:00
David Monllao ffb5996060 Merge branch 'MDL-60633-33' of git://github.com/andrewnicols/moodle into MOODLE_33_STABLE 2017-11-02 12:04:20 +01:00
David Monllao b09c936c74 Merge branch 'MDL-53501-33' of git://github.com/jleyva/moodle into MOODLE_33_STABLE 2017-11-02 08:30:49 +01:00
Jake Dallimore a68cbb2812 Merge branch 'MDL-59798-33' of git://github.com/ryanwyllie/moodle into MOODLE_33_STABLE 2017-11-02 09:45:24 +08:00
Jake Dallimore 069853b01b Merge branch 'MOODLE_33_STABLE_MDL-60007' of https://github.com/CengageEng/moodle into MOODLE_33_STABLE 2017-11-02 08:51:08 +08:00
Eloy Lafuente (stronk7) f90fb8390b weekly release 3.3.2+ 2017-11-01 13:39:06 +01:00
Eloy Lafuente (stronk7) 46343f8cc2 Merge branch 'MDL-60503-33' of git://github.com/damyon/moodle into MOODLE_33_STABLE 2017-11-01 11:46:01 +01:00
Damyon Wiese bcedb11d99 MDL-60503 npm: Lock required node 8.9.x (LTS) 2017-11-01 14:54:00 +08:00
Daniel Thee Roperto 6afd56af46 MDL-58047 gradebook: fix sort by submission order. 2017-11-01 15:11:50 +11:00
Damyon Wiese 00d6486f73 Merge branch 'MDL-52037-33-fix' of https://github.com/andrewnicols/moodle into MOODLE_33_STABLE 2017-11-01 11:15:28 +08:00
Andrew Nicols f33e0d5222 MDL-52037 theme: Correct question feedback width
This relates to the cloze question answer when hovered.
2017-11-01 11:13:40 +08:00
Ryan Wyllie 7488f542d3 MDL-59798 assign: show due date calendar event for teachers 2017-11-01 01:36:34 +00:00
Vervoort, Claude 7c202963f7 MDL-60007 mod lti: allow delete without content-type 2017-10-31 09:59:47 -04:00
Juan Leyva 17e1682c4e MDL-60433 mod_data: Fix strict check for groupid 2017-10-31 13:24:13 +01:00
Juan Leyva ec8f2eb07d MDL-60634 tool_mobile: Avoid CURL request to check HTTPS 2017-10-31 12:05:06 +01:00
David Monllao d634a259a2 MDL-52037 theme: Update compiled css 2017-10-31 11:01:35 +01:00
Luca Bösch 2a4c1c7128 MDL-52037 questions: „Whether correct“-feedback marks adaptive width 2017-10-31 10:43:45 +01:00
Jake Dallimore da5d103964 Merge branch 'MDL-60607_33' of git://github.com/timhunt/moodle into MOODLE_33_STABLE 2017-10-31 12:59:00 +08:00
Jun Pataleta 73b9bccd80 Merge branch 'MDL-57560-33' of git://github.com/damyon/moodle into MOODLE_33_STABLE 2017-10-31 15:40:59 +13:00
Andrew Nicols edb84bc356 Merge branch 'MDL-60139_33' of git://github.com/timhunt/moodle into MOODLE_33_STABLE 2017-10-31 09:15:40 +08:00
Andrew Nicols f649aafd98 Merge branch 'MDL-60522-33' of https://github.com/Kathrin84/moodle into MOODLE_33_STABLE 2017-10-31 08:20:05 +08:00
Andrew Nicols 0afb1ecbec MDL-60633 core: Add pendingjs checks for inplace editable 2017-10-31 07:04:33 +08:00
Tim Hunt 9d37a6f117 MDL-60607 quiz reports: catch separate groups & user has no group case 2017-10-30 17:58:40 +00:00
Tim Hunt f74fe038a9 MDL-60607 quiz reports: move duplicate code to superclass method 2017-10-30 17:58:38 +00:00
David Monllao 3572b50b47 Merge branch 'MDL-60528-m33' of https://github.com/micaherne/moodle into MOODLE_33_STABLE 2017-10-30 17:59:09 +01:00
Juan Leyva c6a0e94bd1 MDL-51945 core_user: Prevent duplicated emails in update_users WS 2017-10-30 17:42:42 +01:00
David Monllao 355c4b8d92 Merge branch 'MDL-52037_33-cloze-whether-correct-feedback-width' of https://github.com/lucaboesch/moodle into MOODLE_33_STABLE 2017-10-30 16:05:55 +01:00
Juan Leyva 7bd64b53c5 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:29 +01:00
Michael Aherne ed73eb0dde MDL-60528 grading: Accurate class names in PHPDoc 2017-10-30 14:28:59 +00:00
Tim Hunt e8ca0ae166 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:19 +00:00
Tim Hunt 42bd1cf3be 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:17 +00:00
Tim Hunt ef78406324 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:15 +00:00
David Monllao c957f2c268 Merge branch 'MDL-60433-33' of git://github.com/jleyva/moodle into MOODLE_33_STABLE 2017-10-30 13:23:45 +01:00
Juan Leyva 2ec1b93b31 MDL-60433 mod_data: Fix groups in Web Services 2017-10-30 12:51:32 +01:00
David Monllao 20668b9a8a Merge branch 'MDL-60377-33' of git://github.com/jleyva/moodle into MOODLE_33_STABLE 2017-10-30 11:42:42 +01:00
Luca Bösch 3b59deb429 MDL-52037 questions: „Whether correct“-feedback marks adaptive width 2017-10-30 10:37:33 +00:00
Kathrin Osswald 942d43eeac 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:02:36 +01:00
Damyon Wiese 3031e3de72 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:13:30 +08:00
Jake Dallimore e789d41efc Merge branch 'MDL-59606_33' of git://github.com/timhunt/moodle into MOODLE_33_STABLE 2017-10-30 11:23:42 +08:00
Andrew Nicols 1f236c90b2 Merge branch 'MDL-60605-33' of https://github.com/dvdcastro/moodle into MOODLE_33_STABLE 2017-10-30 10:50:52 +08:00
Andrew Nicols 944520fd81 Merge branch 'MOODLE_33_STABLE_MDL-60360_enable_file_indexing_retroactively' of https://github.com/mattporritt/moodle into MOODLE_33_STABLE 2017-10-30 09:20:05 +08:00
Jun Pataleta 4f65073d33 Merge branch 'MDL-60572-33' of git://github.com/jleyva/moodle into MOODLE_33_STABLE 2017-10-30 10:25:24 +13:00
David Castro 3557004809 MDL-60605 assignment: Added some styles to fix spacing in YUI file tree 2017-10-27 11:05:53 -05:00
Tim Hunt 51b8cd794f 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:30 +01:00
David Monllao 5992720184 weekly release 3.3.2+ 2017-10-27 12:48:30 +02:00
Juan Leyva c12bfcefdd 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:41:28 +02:00
Matt Porritt bf3a3c56b1 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:52 +11:00
Jun Pataleta 75638047ae Merge branch 'MDL-60265-33' of git://github.com/jleyva/moodle into MOODLE_33_STABLE 2017-10-27 11:52:25 +13:00
David Monllao 4d415133f8 Merge branch 'wip-MDL-57055-33' of git://github.com/abgreeve/moodle into MOODLE_33_STABLE 2017-10-26 19:17:39 +02:00
David Monllao 8b395d32e5 Merge branch 'MDL-60600_33_STABLE' of https://github.com/marxjohnson/moodle into MOODLE_33_STABLE 2017-10-26 18:34:27 +02:00
Mark Johnson 8edb87a37f MDL-60600 core_output: Clear static icon system cache between unit tests 2017-10-26 15:12:06 +01:00
Jun Pataleta 2b33c0e6d4 Merge branch 'MDL-59909-33' of git://github.com/damyon/moodle into MOODLE_33_STABLE 2017-10-26 21:09:28 +13:00
Damyon Wiese cdef8f4e51 Merge branch 'MDL-60366_feedback_upgrade_33' of git://github.com/davosmith/moodle into MOODLE_33_STABLE 2017-10-26 15:40:31 +08:00
Andrew Nicols d6b67e26e3 Merge branch 'wip-MDL-60543-33' of git://github.com/marinaglancy/moodle into MOODLE_33_STABLE 2017-10-26 14:32:12 +08:00
Andrew Nicols 0a12ba0807 Merge branch 'MDL-60162_33' of git://github.com/timhunt/moodle into MOODLE_33_STABLE 2017-10-26 14:05:52 +08:00
Adrian Greeve 18ea0d75bc 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:57:15 +08:00
Andrew Nicols 6188594b52 Merge branch 'MDL-60535_33-questionbank-button-styled' of https://github.com/lucaboesch/moodle into MOODLE_33_STABLE 2017-10-26 13:18:39 +08:00
Andrew Nicols 0afcdafdbc Merge branch 'wip-MDL-60104-m33' of git://github.com/amygroshek/moodle into MOODLE_33_STABLE 2017-10-26 11:38:28 +08:00
Andrew Nicols 0de940286f Merge branch 'MOODLE_33_MDL-51892' of https://github.com/fwsl/moodle into MOODLE_33_STABLE 2017-10-26 11:30:32 +08:00
Jake Dallimore 23854442d3 Merge branch 'MDL-59686-33' of git://github.com/lameze/moodle into MOODLE_33_STABLE 2017-10-26 10:18:04 +08:00
Simey Lameze 46a05ebe6c MDL-59686 form: fix autosave support for editor field 2017-10-26 09:04:11 +08:00
Jun Pataleta 2168da18b7 Merge branch 'MDL-60571_33-manualgrading-savegotonextpage-styled' of https://github.com/lucaboesch/moodle into MOODLE_33_STABLE 2017-10-26 10:03:03 +13:00
David Monllao 8e14926847 Merge branch 'wip_MDL-60250_M33' of git://github.com/gjb2048/moodle into MOODLE_33_STABLE 2017-10-25 15:13:27 +02:00
David Monllao 32e3f25c95 Merge branch 'MDL-60538-33' of https://github.com/mihailges/moodle into MOODLE_33_STABLE 2017-10-25 15:09:41 +02:00
David Monllao 8375df3227 weekly release 3.3.2+ 2017-10-25 11:13:53 +02:00
David Monllao 92b38fa1a8 Merge branch 'install_33_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_33_STABLE 2017-10-25 11:13:52 +02:00
Damyon Wiese 0203b05f13 MDL-59909 calendar: Try hard not to fail the adhoc task.
Triggering a fatal error in an adhoc task is bad. It will be retried indefinitely.
Even though we are not sure how to get a module instance without a course module record,
it is possible and should not kill the Moodle site.
2017-10-25 15:44:00 +08:00
Andrew Nicols 82938bb562 Merge branch 'MDL-36580_33' of https://github.com/stronk7/moodle into MOODLE_33_STABLE 2017-10-25 12:18:24 +08:00
Andrew Nicols 92126f2ea8 Merge branch 'MDL-36580_33' of https://github.com/stronk7/moodle into MOODLE_33_STABLE 2017-10-25 12:18:23 +08:00
Mihail Geshoski c3ddc8e2fd MDL-60538 lesson: check if max attempts exceeded, use new lang string 2017-10-25 09:08:29 +08:00
Eloy Lafuente (stronk7) e81b7b7487 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:02:04 +02:00
Tim Hunt 1941f9ab63 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:33 +01:00
Tim Hunt 16ae053264 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:32 +01:00
AMOS bot 78ff74e0d3 Automatically generated installer lang files 2017-10-25 00:05:50 +08:00
Amy Groshek 8b0427a3a9 MDL-60104 mod_scorm: Fix scorm description display overflow 2017-10-24 10:37:02 -05:00
Luca Bösch 8c66b48b85 MDL-60535 quiz: question bank button styled 2017-10-24 16:10:03 +01:00
Luca Bösch dc3a628459 MDL-60571 quiz: Manual grading Save and go to next page button styled 2017-10-24 12:14:00 +01:00
Grzegorz Ziółek 915b7b6914 MDL-51892 logging: Proper description of login errors. 2017-10-24 10:54:48 +02:00
Davo Smith cdd6d0d240 MDL-60366 mod_feedback: fix deletion of valid anonymous duplicates 2017-10-24 09:36:14 +01:00
Andrew Nicols d30613b147 MDL-57477 session: Comment tidyup 2017-10-24 08:13:10 +08:00
Andrew Nicols 729ada251b Merge branch 'MDL-57477_33' of https://github.com/appalachianstate/moodle into MOODLE_33_STABLE 2017-10-24 08:08:27 +08:00
Fred Woolard 58235c3774 MDL-57477 core: If memcached 3.x mimic 2.2.0 lock acquisition behavior 2017-10-23 13:48:08 -04:00
David Monllao 2ea0d1ffde Merge branch 'MDL-60527_33-action-menu-links-missing-spaces-attributes' of https://github.com/lucaboesch/moodle into MOODLE_33_STABLE 2017-10-23 16:59:10 +02:00
Andrew Nicols 1938195cac MDL-60489 javascript: Add missing promise fails 2017-10-23 20:29:26 +08:00
Andrew Nicols 83a6957d2e Merge branch 'MDL-60489-33' of git://github.com/ryanwyllie/moodle into MOODLE_33_STABLE 2017-10-23 20:27:16 +08:00
Eloy Lafuente (stronk7) cb00fcc297 Merge branch 'm33_MDL-59100_MySQL8_INFORMATION_SCHEMAs_Need_Lowercasing' of https://github.com/scara/moodle into MOODLE_33_STABLE 2017-10-23 12:10:59 +02:00
Gareth J Barnard 4e2d813fb3 MDL-60250 theme_bootstrapbase: Calendar popover misplaced in RTL langs. 2017-10-23 11:08:46 +01:00
Ryan Wyllie 651f9e6c6b MDL-60489 javascript: add animations to modal setBody 2017-10-23 08:03:14 +00:00
Marina Glancy 75d54a7b9b MDL-60543 env: Moodle 3.2 and 3.3 do no support PHP7.2 2017-10-23 14:18:49 +08:00
Damyon Wiese e66e807e81 Merge branch 'MDL-52653-33' of http://github.com/damyon/moodle into MOODLE_33_STABLE 2017-10-23 13:14:49 +08:00
Damyon Wiese 2891fb44b9 Merge branch 'MDL-58605-33' of git://github.com/andrewnicols/moodle into MOODLE_33_STABLE 2017-10-23 11:16:25 +08:00
Andrew Nicols df3a27d865 MDL-58605 mod_scorm: Simplify feature
The singlescobasic_missingorg.zip file includes a modified version of
the javascript which deliberately breaks content.

We need it to have different file names to not break other similar copies
of the file.
2017-10-23 07:56:40 +08:00
Luca Bösch 92be41bf98 MDL-60527 templates: missing spaces round attribute and aria-labelledby 2017-10-22 22:07:35 +01:00
Matteo Scaramuccia 3989a44cfb MDL-59100 dml: Lower the case of INFORMATION_SCHEMA.* fields. 2017-10-21 14:33:46 +02:00
Eloy Lafuente (stronk7) bcca46d630 weekly release 3.3.2+ 2017-10-20 23:55:00 +02:00
Eloy Lafuente (stronk7) c96be3bbef MDL-60485 modgrade: Change string expectation in related test 2017-10-20 18:55:40 +02:00
David Monllao 33336b560e Merge branch 'wip-MDL-60485-33' of git://github.com/abgreeve/moodle into MOODLE_33_STABLE 2017-10-20 04:43:25 +02:00
Andrew Nicols 1c6b0718be Merge branch 'MDL-60456-33' of git://github.com/damyon/moodle into MOODLE_33_STABLE 2017-10-20 10:28:45 +08:00
David Monllao d0abd8f9fc Merge branch 'MDL-60123-33' of https://github.com/snake/moodle into MOODLE_33_STABLE 2017-10-20 02:22:26 +02:00
Eloy Lafuente (stronk7) a5adcc8ad4 Merge branch 'MDL-60342-33' of https://github.com/patkira/moodle into MOODLE_33_STABLE 2017-10-19 23:24:58 +02:00
Eloy Lafuente (stronk7) c4cae28841 Merge branch 'wip-MDL-60314-33' of git://github.com/marinaglancy/moodle into MOODLE_33_STABLE 2017-10-19 23:19:07 +02:00
Eloy Lafuente (stronk7) 492e044470 Merge branch 'MDL-60449-33-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_33_STABLE 2017-10-19 22:21:22 +02:00
Helen Foster bc8665f4dd 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:17:46 +02:00
David Monllao b4d4e7885a Merge branch 'wip-MDL-58915-33' of git://github.com/marinaglancy/moodle into MOODLE_33_STABLE 2017-10-19 15:44:25 +02:00
David Monllao 2b1827a6d1 Merge branch 'MDL-60233-33' of git://github.com/jleyva/moodle into MOODLE_33_STABLE 2017-10-19 13:51:15 +02:00
Nadav Kavalerchik 8304784442 MDL-60182 Glossary: Fix print icon label in RTL mode 2017-10-19 13:36:11 +02:00
David Monllao 4b8c428047 Merge branch 'MDL-60469-33' of git://github.com/andrewnicols/moodle into MOODLE_33_STABLE 2017-10-19 10:53:26 +02:00
David Monllao fc4d0e7f8c Merge branch 'MDL-60247_33-multilang-html-glossary-block-titles' of https://github.com/lucaboesch/moodle into MOODLE_33_STABLE 2017-10-19 10:34:47 +02:00
David Monllao e940603c99 Merge branch 'MDL-60153-33' of git://github.com/junpataleta/moodle into MOODLE_33_STABLE 2017-10-19 10:19:17 +02:00
Eloy Lafuente (stronk7) 66dc42dc7a MDL-36580 backup: Apply the decrypt() method to lti "secrets" 2017-10-19 10:17:12 +02:00
Eloy Lafuente (stronk7) e76cfde358 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:17:11 +02:00
Eloy Lafuente (stronk7) 29b66bc2eb MDL-36580 backup: Use the encrypted_final_element for lti "secrets" 2017-10-19 10:17:11 +02:00
Eloy Lafuente (stronk7) d070c63237 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:17:07 +02:00
Damyon Wiese e17641e19e MDL-52653 scorm: Comment for cms.completion_status 2017-10-19 14:56:54 +08:00
Christian Lawson-Perfect 35ff3eae2d 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-19 14:56:54 +08:00
Adrian Greeve c2e9ef8d1d MDL-60485 modgrade: Update to mod settings form.
The message for changing the max grade in the module form
was inaccurate for modules that can not rescale.
2017-10-19 14:37:57 +08:00
Mark Nielsen 2cbe558754 MDL-60001 core_files: Use local file for gzopen
The gzopen method does not appear to support
file streams.
2017-10-19 13:12:50 +08:00
Damyon Wiese fe94e2bd14 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:54:00 +08:00
Andrew Nicols 6475e2cb5e Merge branch 'MDL-60319-MOODLE_33-google-converter-bug' of https://github.com/mspall/moodle into MOODLE_33_STABLE 2017-10-19 11:29:20 +08:00
Jun Pataleta f4307218e6 Merge branch 'wip-MDL-60335-33' of git://github.com/marinaglancy/moodle into MOODLE_33_STABLE 2017-10-19 15:39:36 +13:00
Andrew Nicols 0d18af4621 MDL-60469 behat: Replace I press with I click on 2017-10-19 10:39:27 +08:00
Jun Pataleta 1a58b9a5d1 Merge branch 'mdl59843-moodle33' of https://github.com/tlock/moodle into MOODLE_33_STABLE 2017-10-19 13:21:25 +13:00
Eloy Lafuente (stronk7) 6ba05a7368 weekly release 3.3.2+ 2017-10-19 00:11:11 +02:00
Eloy Lafuente (stronk7) c1a6523782 Merge branch 'install_33_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_33_STABLE 2017-10-19 00:11:09 +02:00
Pat Kira 74ee81e38e 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 14:02:07 +11:00
Marina Glancy e27dfe0fbc MDL-60335 admin: fix encoding of nonlatin site names in blocked hosts 2017-10-17 12:59:49 +08:00
Eloy Lafuente (stronk7) 2d2e3dc0eb Merge branch 'MDL-60320_33' of git://github.com/aolley/moodle into MOODLE_33_STABLE 2017-10-17 00:06:03 +02:00
David Monllao 2b5948200f Merge branch 'MDL-60373-33' of git://github.com/andrewnicols/moodle into MOODLE_33_STABLE 2017-10-16 18:28:56 +02:00
Jake Dallimore 37340fb27b Merge branch 'wip-MDL-60033-33' of git://github.com/marinaglancy/moodle into MOODLE_33_STABLE 2017-10-16 15:37:06 +08:00
Jake Dallimore 3d8e2ef988 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:44:23 +08:00
AMOS bot c078a012de Automatically generated installer lang files 2017-10-14 00:08:31 +08:00
Luca Bösch ae565b0e4d MDL-60247 blocks: Multilang in Random glossary and in HTML block titles. 2017-10-13 13:52:27 +02:00
Jake Dallimore 298c1361e8 weekly release 3.3.2+ 2017-10-13 14:33:18 +08:00
Jake Dallimore ad9e004174 Merge branch 'install_33_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_33_STABLE 2017-10-13 14:33:17 +08:00
Marina Glancy d250014ef7 MDL-58915 search_solr: connection to solr can use blocked hosts 2017-10-13 12:18:05 +08:00
Jake Dallimore 747a386ed4 Merge branch 'MDL-60357-33-fix' of https://github.com/andrewnicols/moodle into MOODLE_33_STABLE 2017-10-13 11:40:30 +08:00
Andrew Nicols d9810c83cb 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:28 +08:00
Jun Pataleta 7b4b469720 Merge branch 'MDL-59854-33' of git://github.com/junpataleta/moodle into MOODLE_33_STABLE 2017-10-12 12:27:47 +08:00
Tobias Reischmann 8db207f90f 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:49 +08:00
Eloy Lafuente (stronk7) ca3c02b188 Merge branch 'MDL-60357-m33' of https://github.com/sammarshallou/moodle into MOODLE_33_STABLE 2017-10-11 20:49:46 +02:00
Andrew Nicols 0be75ddb99 Merge branch 'MOODLE_33_STABLE_MDL-60276' of https://github.com/CengageEng/moodle into MOODLE_33_STABLE 2017-10-11 09:39:50 +08:00
Eloy Lafuente (stronk7) 795c5635e0 Merge branch 'MDL-60300-m33' of https://github.com/NeillM/moodle into MOODLE_33_STABLE 2017-10-11 01:40:04 +02:00
Eloy Lafuente (stronk7) 91bc1d0983 Merge branch 'MDL-60346-m33' of https://github.com/sammarshallou/moodle into MOODLE_33_STABLE 2017-10-11 01:13:33 +02:00
Eloy Lafuente (stronk7) 739d0e33dd Merge branch 'MDL-60364-m33' of https://github.com/NeillM/moodle into MOODLE_33_STABLE 2017-10-11 01:00:37 +02:00
Juan Leyva 0f08e89988 MDL-60377 webservice: Format correctly text returned by WS 2017-10-10 15:12:37 +02:00
Damyon Wiese 564787c47b Merge branch 'MDL-59889-33' of git://github.com/Dagefoerde/moodle into MOODLE_33_STABLE 2017-10-10 13:22:04 +08:00
Adam Olley 3ff2f2d474 MDL-60320 icons: Use PNG icons as the preview thumbnails
Without this change, Moodle fails to provide any data when requesting a
thumbnail for a non-image file as its looking to provide a SVG file that
doesn't exist.
2017-10-10 09:57:41 +10:30
Eloy Lafuente (stronk7) d83185cfae Merge branch 'm33_MDL-60318_Undefined_method_file_storage-move_to_trash' of https://github.com/scara/moodle into MOODLE_33_STABLE 2017-10-09 23:12:08 +02:00
AMOS bot 9802346b16 Automatically generated installer lang files 2017-10-10 00:12:00 +08:00
Andrew Nicols 67a4191380 Merge branch 'MDL-60317_33' of git://github.com/timhunt/moodle into MOODLE_33_STABLE 2017-10-09 14:10:08 +08:00
Andrew Nicols 0e21a039da MDL-60373 core: Do not show title if there is no title 2017-10-09 12:36:33 +08:00
Jun Pataleta 645c3bdd64 MDL-60153 course_format: Remove irrelevant CSS styles
* The styles ".course-content ul.topics li.section .right img.icon" and
".course-content ul.weeks li.section .right img.icon" are now kind of
irrelevant and are causing course section action menu items in
Bootstrapbase to be rendered without spacing between the action menu
icon and the label.
2017-10-09 10:23:24 +08:00
Tim Lock be60d9e7f7 MDL-60153 theme_bootstrapbase: Fix align of edit section menu 2017-10-09 10:23:24 +08:00
Marina Glancy 96b04bdedc MDL-60314 navigation: fix overriding variable value 2017-10-09 10:19:28 +08:00
sam marshall a685402bd8 MDL-60357 core_search: Future modified times cause serious problems 2017-10-06 14:14:25 +01:00
Jan Dageförde 2d2f32f242 MDL-59889 oauth2: Remove check for storing new refresh token 2017-10-06 14:49:23 +02:00
Neill Magill 6bc6c40f5b MDL-60300 Quiz: Offline update time not set correctly 2017-10-06 13:33:20 +01:00
Neill Magill 598c974d46 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:32:54 +01:00
sam marshall 1ba83f0d5a MDL-60346 core_search: Solr connection ignores proxy settings 2017-10-06 12:28:04 +01:00
Jake Dallimore 2ffd848807 weekly release 3.3.2+ 2017-10-06 14:34:39 +08:00
Jake Dallimore b5f9f77e4c Merge branch 'install_33_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_33_STABLE 2017-10-06 14:34:38 +08:00
Michael Spall 52d65d0970 MDL-60319 Google converter: Add html to convertible types
Add html files to the file types that Google can convert. This allows
the Google Drive converter to convert online submissions to pdf. This
fixes an issue where if online submissions is selected and the Google
Drive converter is used all conversions fail and produce a single
blank pdf. Credit to Peter Svec for the idea for this fix.
2017-10-05 08:13:34 -06:00
Jun Pataleta f46e46c174 Merge branch 'MDL-60352-33' of git://github.com/andrewnicols/moodle into MOODLE_33_STABLE 2017-10-05 16:16:47 +08:00
Andrew Nicols 3e2afb9d11 MDL-60352 calendar: Do not select original event for collection 2017-10-05 14:43:23 +08:00
Jake Dallimore 6b40b9182b Merge branch 'MDL-57228_33' of git://github.com/timhunt/moodle into MOODLE_33_STABLE 2017-10-04 13:43:27 +08:00
Eloy Lafuente (stronk7) 4a56b4efb5 Merge branch 'MDL-59882-33' of git://github.com/andrewnicols/moodle into MOODLE_33_STABLE 2017-10-03 20:52:04 +02:00
Eloy Lafuente (stronk7) e945953705 Merge branch 'MDL-60198-33' of git://github.com/jleyva/moodle into MOODLE_33_STABLE 2017-10-03 20:15:53 +02:00
AMOS bot a813ed0dd6 Automatically generated installer lang files 2017-10-04 00:10:33 +08:00
Andrew Nicols b278d32999 Merge branch 'MDL-60210-33-upgradecheck' of git://github.com/mudrd8mz/moodle into MOODLE_33_STABLE 2017-10-03 10:33:32 +08:00
Matteo Scaramuccia accc87283a MDL-60318 filestorage: Fixed undefined method move_to_trash() 2017-10-02 23:03:20 +02:00
Tim Hunt b86bb7b4df MDL-60317 quiz reports: fix regression caused by MDL-57511 2017-10-02 18:24:51 +01:00
Andrew Nicols 7129db08e7 Merge branch 'MDL-58790_33' of git://github.com/timhunt/moodle into MOODLE_33_STABLE 2017-10-02 15:40:22 +08:00
Andrew Nicols 9ae3d44588 MDL-59882 behat: Update known uses of dialogue CSS 2017-10-02 12:49:34 +08:00
Andrew Nicols 176bb9eec3 MDL-59882 behat: Add newer modal type to selectors 2017-10-02 12:46:14 +08:00
Andrew Nicols f009ad959a Merge branch 'MDL-60306-33' of git://github.com/junpataleta/moodle into MOODLE_33_STABLE 2017-10-02 10:17:25 +08:00
Jun Pataleta 5ef74b0c3d 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:19:08 +08:00
ddelblanco d68208baa1 MDL-60276 LTI Content Item: does not populate tool url when https 2017-09-28 09:53:31 -07:00
AMOS bot 03152cd95c Automatically generated installer lang files 2017-09-29 00:06:02 +08:00
Juan Leyva ff2a8c5a18 MDL-60265 tool_mobile: Return sitepolicy in tool_mobile_get_config WS 2017-09-28 10:50:54 +02:00
Jake Dallimore d7bee96561 weekly release 3.3.2+ 2017-09-28 14:27:30 +08:00
Tim Lock 41fb3ea48f MDL-59843 mod_choice: Fix horizontal display mode
This re-implements the feature in the boost and bootstrap themes.
2017-09-28 12:30:27 +10:00
Eloy Lafuente (stronk7) 1eb29f17e3 Merge branch 'MDL-60243-33' of https://github.com/snake/moodle into MOODLE_33_STABLE 2017-09-27 20:48:39 +02:00
Jake Dallimore 7d1e74c3da Merge branch 'MDL-59780-33' of git://github.com/ankitagarwal/moodle into MOODLE_33_STABLE 2017-09-27 13:43:42 +08:00
Ankit Agarwal 00479a197e MDL-59780 mathjax: Make sure mathjax url doesn't become empty 2017-09-27 09:15:16 +05:30
Jake Dallimore 91d9281330 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:23:20 +08:00
Eloy Lafuente (stronk7) 3f2082ef15 Merge branch 'MDL-59931_33_STABLE' of https://github.com/ctam/moodle into MOODLE_33_STABLE 2017-09-27 01:16:17 +02:00
Eloy Lafuente (stronk7) c953223f50 Merge branch 'MDL-59220-33' of git://github.com/damyon/moodle into MOODLE_33_STABLE 2017-09-27 00:52:11 +02:00
Juan Leyva 7135925f9e MDL-60198 webservice: Add missing MOODLE_INTERNAL checks 2017-09-26 23:04:35 +02:00
Eloy Lafuente (stronk7) 156c08723d Merge branch 'MDL-59645-33-flickr' of git://github.com/mudrd8mz/moodle into MOODLE_33_STABLE 2017-09-26 19:35:08 +02:00
Tim Hunt 2835d3c50d MDL-58790 quiz editing: translate hard-coded new heading string 2017-09-26 11:18:26 +01:00
Juan Leyva d6fee3b572 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:31 +02:00
Andrew Nicols 76ed567062 Merge branch 'MDL-60141-33' of git://github.com/jleyva/moodle into MOODLE_33_STABLE 2017-09-26 15:48:07 +08:00
Jake Dallimore 70c7be1c93 Merge branch 'MDL-60121-multi-enrol-backup-MOODLE_33_STABLE' of https://github.com/mpetrowi/moodle into MOODLE_33_STABLE 2017-09-26 15:25:04 +08:00
Juan Leyva cb511fdfb6 MDL-60141 auth_email: Fix sitepolicy field type in get_signup_settings 2017-09-26 09:11:17 +02:00
Simey Lameze 2cb5968d25 MDL-60052 theme_bootstrapbase: proper handling of large modals 2017-09-26 11:20:26 +08:00
Andrew Nicols 2c9e28d2b8 Merge branch 'MDL-60052-33' of https://github.com/xow/moodle into MOODLE_33_STABLE 2017-09-26 09:40:30 +08:00
Andrew Nicols 620a05aa6a Merge branch 'MOODLE_33_STABLE' of https://github.com/ConnorSheremeta/moodle into MOODLE_33_STABLE 2017-09-26 09:26:10 +08:00
Eloy Lafuente (stronk7) 7969d430e1 Merge branch 'MDL-59505-33-gdrive' of git://github.com/mudrd8mz/moodle into MOODLE_33_STABLE 2017-09-26 01:25:53 +02:00
Carson Tam 421a17f2a9 MDL-59931 mod_quiz: Fixing incorrect pagination count. 2017-09-25 12:49:29 -07:00
Eloy Lafuente (stronk7) abf2bf0175 Merge branch 'wip-MDL-60167-33' of git://github.com/marinaglancy/moodle into MOODLE_33_STABLE 2017-09-25 20:19:26 +02:00
Shamim Rezaie 0243d08185 MDL-57228 quiz editing: unit test for the move case 2017-09-25 12:55:01 +01:00
Tim Hunt 06a850c19e 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:00 +01:00
Marina Glancy 1ce18b558b MDL-60167 upgrade: Fix duplicate site registrations 2017-09-24 18:51:12 +08:00
Dan Poltawski 2f0bd18ad9 weekly release 3.3.2+ 2017-09-22 12:43:18 +01:00
Dan Poltawski fdf3d9bda5 Merge branch 'install_33_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_33_STABLE 2017-09-22 12:43:17 +01:00
David Mudrák a89500f81f 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:18:24 +02:00
Jun Pataleta 1a3a805c57 Merge branch 'MDL-37810-33-fix' of https://github.com/snake/moodle into MOODLE_33_STABLE 2017-09-22 10:54:51 +08:00
Ryan Wyllie aecfdf39dd MDL-60052 javascript: fix large styling for modals 2017-09-22 10:00:02 +08:00
Damyon Wiese 1595d0d44f 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:46:45 +08:00
David Mudrák d12b219aae MDL-59505 oauth2: Fix storage of access controlled links
When files are copied into the system account's drive, they are put into
folders respecting the structure of contexts. Folder names were based on
context names only and so were likely to collide (such as with users
with the same name).

The patch ads context instance identifiers to the name so that they can
be identified more reliably.
2017-09-21 22:15:47 +02:00
AMOS bot 205ede3084 Automatically generated installer lang files 2017-09-22 00:08:18 +08:00
AMOS bot 4b2ae7cb3f Automatically generated installer lang files 2017-09-22 00:08:18 +08:00
Jake Dallimore bf9e1794d8 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:26:18 +08:00
AMOS bot 025ce03039 Automatically generated installer lang files 2017-09-21 00:06:17 +08:00
Eloy Lafuente (stronk7) cf06189838 Merge branch 'MDL-60132-33' of git://github.com/jleyva/moodle into MOODLE_33_STABLE 2017-09-19 22:38:49 +02:00
David Mudrák 43868ab6d4 MDL-59645 flickrlib: Show debug notice when using legacy authentication 2017-09-19 14:39:43 +02:00
David Mudrák 4a821e2db0 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:39:42 +02:00
David Mudrák e674b4d4a9 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:39:42 +02:00
David Mudrák 4f7ef6fed3 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:39:42 +02:00
David Mudrák 46ca89ea8b 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:39:42 +02:00
David Mudrák 54525dd238 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:39:42 +02:00
David Mudrák fde6b9ef06 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:39:42 +02:00
Matt Petro ae8ce02b74 MDL-60121 enrol: Fix enrol plugin backup
Allow more than one enrol plugin to add backup structure.
2017-09-19 07:07:21 -04:00
Jun Pataleta cacef68723 Merge branch 'MDL-60048-33' of https://github.com/Kathrin84/moodle into MOODLE_33_STABLE 2017-09-19 17:21:25 +08:00
Dan Poltawski 843f487c22 Merge branch 'MDL-60018-33' of git://github.com/jleyva/moodle into MOODLE_33_STABLE 2017-09-19 07:28:07 +01:00
Eloy Lafuente (stronk7) eb0019a7ac Merge branch 'MDL-60105_33' of git://github.com/dmonllao/moodle into MOODLE_33_STABLE 2017-09-19 01:56:45 +02:00
Eloy Lafuente (stronk7) 84ecc2a5eb Merge branch 'MDL-52131-33' of git://github.com/andrewnicols/moodle into MOODLE_33_STABLE 2017-09-19 01:53:33 +02:00
Eloy Lafuente (stronk7) 920fe36776 Merge branch 'MDL-37810-33' of https://github.com/snake/moodle into MOODLE_33_STABLE 2017-09-19 01:48:14 +02:00
Eloy Lafuente (stronk7) aa05704599 Merge branch 'MDL-53244_33_STABLE' of git://github.com/Chocolate-lightning/moodle into MOODLE_33_STABLE 2017-09-19 01:43:25 +02:00
Jake Dallimore bbb818a6e1 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:21:07 +08:00
Jun Pataleta b5c6c217d9 Merge branch 'MDL-59994-33-v2' of git://github.com/lameze/moodle into MOODLE_33_STABLE 2017-09-18 09:10:04 +08:00
Jake Dallimore 71d5abb422 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:00:31 +08:00
Jake Dallimore a8f69dbed0 MDL-37810 roles: unit tests for get_profile_roles() 2017-09-18 09:00:31 +08:00
Jake Dallimore 12ede4f87f MDL-37810 roles: fix get_profile_roles() so it returns assignable roles 2017-09-18 09:00:31 +08:00
Simey Lameze f2fc4bccf4 MDL-59994 competency: improve user competency unit test 2017-09-18 08:33:03 +08:00
Simey Lameze 486a9a4d9b MDL-59994 competency: dont list competencies from deleted users 2017-09-18 08:33:03 +08:00
Dan Poltawski 50126511aa weekly release 3.3.2+ 2017-09-15 08:49:29 +01:00
Dan Poltawski 766a2d3364 Merge branch 'install_33_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_33_STABLE 2017-09-15 08:49:28 +01:00
Kathrin Osswald e95beb73b9 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 13:51:05 +02:00
Juan Leyva 308bf50e76 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:17:56 +02:00
Juan Segarra Montesinos 2352074dc0 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:15 +08:00
Matt Clarkson 3ee0495c62 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:29 +02:00
Matt Clarkson d2d9e5a864 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:28 +02:00
AMOS bot 6c581c9648 Automatically generated installer lang files 2017-09-13 00:06:45 +08:00
Dan Poltawski 9da6b92faf Merge branch 'MDL-60039_33' of git://github.com/dmonllao/moodle into MOODLE_33_STABLE 2017-09-12 11:24:20 +01:00
David Monllao 0d27d706c6 MDL-60039 search: Force messaging search areas to be reindexed 2017-09-12 11:59:13 +02:00
David Monllao 2e35af9cc2 MDL-60039 messaging: global search index using timeread 2017-09-12 11:57:34 +02:00
Dan Poltawski bd50f5f555 Merge branch 'MDL-59929_33' of git://github.com/timhunt/moodle into MOODLE_33_STABLE 2017-09-12 10:56:01 +01:00
Eloy Lafuente (stronk7) edb25d4f25 Merge branch 'MDL-60086-33' of https://github.com/snake/moodle into MOODLE_33_STABLE 2017-09-12 09:56:31 +02:00
David Monllao fc24fb7af0 Merge branch 'MDL-59399-33' of git://github.com/ryanwyllie/moodle into MOODLE_33_STABLE 2017-09-12 08:12:37 +02:00
David Monllao bd1e060c8f Merge branch 'MDL-59867-33' of git://github.com/damyon/moodle into MOODLE_33_STABLE 2017-09-12 07:11:03 +02:00
David Monllao e79467c0d8 Merge branch 'MDL-59879-33' of https://github.com/abias/moodle into MOODLE_33_STABLE 2017-09-12 07:04:45 +02:00
Jake Dallimore 822ccfdb31 MDL-60086 travis: Bumping the postgres version to 9.6
3.2 was bumped to 9.6, this makes the change across the board.
2017-09-12 09:35:23 +08:00
Eloy Lafuente (stronk7) f69b9181c6 Merge branch 'MDL-59478-33' of git://github.com/junpataleta/moodle into MOODLE_33_STABLE 2017-09-12 00:23:54 +02:00
Eloy Lafuente (stronk7) 9e5ae58959 Merge branch 'wip-MDL-59808-33' of git://github.com/marinaglancy/moodle into MOODLE_33_STABLE 2017-09-12 00:13:43 +02:00
Eloy Lafuente (stronk7) e3db987f32 Merge branch 'MDL-60025-33' of git://github.com/jleyva/moodle into MOODLE_33_STABLE 2017-09-11 23:50:54 +02:00
Dan Poltawski 1298a03670 Merge branch 'MDL-35849-33' of git://github.com/ankitagarwal/moodle into MOODLE_33_STABLE 2017-09-11 14:19:49 +01:00
Jun Pataleta 67d18f8804 Merge branch 'MDL-60031-33' of git://github.com/andrewnicols/moodle into MOODLE_33_STABLE 2017-09-11 13:57:10 +08:00
Jun Pataleta 5383687f30 Merge branch 'wip-MDL-55849-33' of git://github.com/abgreeve/moodle into MOODLE_33_STABLE 2017-09-11 13:27:50 +08:00
Adrian Greeve 9a1d82de52 MDL-55849 mod_assign: Behat update for group submission reopening. 2017-09-11 12:43:09 +08:00
Adrian Greeve 5a469543b0 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:43:08 +08:00
Mathew May c92f6d056a MDL-53244 login: Add error message for recaptcha 2017-09-08 13:03:49 +12:00
Damyon Wiese 1f672ef01b 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:33:09 +08:00
Marina Glancy 50464573be MDL-59808 webservice_rest: comply with restformat argument 2017-09-07 08:34:49 +08:00
Juan Leyva 2f373db92b 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:27 +02:00
Juan Leyva 0272abac15 MDL-60018 mod_chat: Fix chatmethod field type in get_chats_by_courses WS 2017-09-06 12:16:33 +02:00
Marina Glancy 65bad3744d MDL-60033 webservice_xmlrpc: extra escaping in the server URL 2017-09-06 13:44:16 +08:00
Ryan Wyllie 8c4508ffb5 MDL-59399 atto: make media plugin shortform explandable 2017-09-06 05:28:03 +00:00
Andrew Nicols 5188941881 MDL-60031 admin: Move risk longtext to pix title 2017-09-06 10:24:11 +08:00
Ankit Agarwal f8da314e59 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:14 +05:30
Connor Sheremeta 2479e3742b MDL-54540 lti: Add allowfullscreen attribute to LTI IFrames 2017-08-29 13:48:19 -06:00
Jun Pataleta 8c49ddd994 MDL-59478 mod_scorm: Fix setting of default completion rule 2017-08-25 20:06:54 +08:00
Tim Hunt abb4e64e37 MDL-59929 signup: inprove usability when duplicate email entered 2017-08-24 16:33:15 +01:00
Alexander Bias 591ff7634d MDL-59879 navigation: Add node key to competencies navigation node 2017-08-21 10:59:00 +02:00
238 changed files with 3541 additions and 876 deletions
+3 -6
View File
@@ -17,7 +17,7 @@ php:
- 5.6
addons:
postgresql: "9.3"
postgresql: "9.6"
packages:
- mysql-server-5.6
- mysql-client-core-5.6
@@ -53,12 +53,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.
@@ -95,7 +92,7 @@ install:
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.3
sudo service postgresql start 9.6
fi
- >
if [ "$TASK" = 'PHPUNIT' ];
+2
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>
@@ -183,9 +183,14 @@ abstract class core_role_capability_table_with_risks extends core_role_capabilit
public function get_risk_icon($type) {
global $OUTPUT;
$text = $OUTPUT->pix_icon('i/' . str_replace('risk', 'risk_', $type), get_string($type . 'short', 'admin'));
$alt = get_string("{$type}short", "admin");
$title = get_string($type, "admin");
$text = $OUTPUT->pix_icon('i/' . str_replace('risk', 'risk_', $type), $alt, 'moodle', [
'title' => $title,
]);
$action = new popup_action('click', $this->risksurl, 'docspopup');
$riskicon = $OUTPUT->action_link($this->risksurl, $text, $action, array('title'=>get_string($type, 'admin')));
$riskicon = $OUTPUT->action_link($this->risksurl, $text, $action);
return $riskicon;
}
+9 -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
@@ -55,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();
+10 -4
View File
@@ -128,7 +128,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,
@@ -152,10 +152,11 @@ class api {
$url = new moodle_url("/$CFG->admin/tool/mobile/launch.php");
$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);
}
@@ -210,12 +211,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);
}
}
if (empty($section) or $section == 'mobileapp') {
+1
View File
@@ -23,6 +23,7 @@
*/
namespace tool_mobile;
defined('MOODLE_INTERNAL') || die();
require_once("$CFG->libdir/externallib.php");
+1 -1
View File
@@ -24,7 +24,7 @@
$string['androidappid'] = 'Android app\'s unique identifier';
$string['androidappid_desc'] = 'This setting may be left as default unless you have a custom Android app.';
$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.';
@@ -97,11 +97,13 @@ 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['forgottenpasswordurl'] = ''; // Expect empty when it's not an URL.
if ($logourl = $OUTPUT->get_logo_url()) {
$expected['logourl'] = $logourl->out(false);
@@ -123,6 +125,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);
@@ -143,6 +149,7 @@ class tool_mobile_external_testcase extends externallib_advanced_testcase {
array('name' => 'numsections', 'value' => course_get_format($SITE)->get_last_section_number()),
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)),
array('name' => 'tool_mobile_forcelogout', 'value' => 0),
@@ -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");
+1 -1
View File
@@ -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(
+1 -1
View File
@@ -121,7 +121,7 @@ $string['didntgetusersfromldap'] = "Did not get any users from LDAP -- error? --
$string['gotcountrecordsfromldap'] = "Got {\$a} records from LDAP\n";
$string['ldapnotconfigured'] = 'The LDAP host url is currently not configured';
$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!';
+9
View File
@@ -141,6 +141,15 @@ abstract class backup implements checksumable {
* Usually same than major release zero version, mainly for informative/historic purposes.
*/
const RELEASE = '3.3';
/**
* 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;
}
/*
+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);
+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
*
+1 -1
View File
@@ -529,7 +529,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;
}
@@ -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));
}
}
+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
*/
@@ -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() {
@@ -122,12 +122,16 @@ class repeat_event_collection implements event_collection_interface {
* @param int $start Start offset.
* @return \stdClass[]
*/
protected function load_event_records($start = 1) {
protected function load_event_records($start = 0) {
global $DB;
while ($records = $DB->get_records(
while ($records = $DB->get_records_select(
'event',
['repeatid' => $this->parentid],
'',
'id <> :parentid AND repeatid = :repeatid',
[
'parentid' => $this->parentid,
'repeatid' => $this->parentid,
],
'id ASC',
'*',
$start,
self::DB_QUERY_LIMIT
+1 -1
View File
@@ -872,7 +872,7 @@ class core_calendar_rrule_manager_testcase extends advanced_testcase {
$records = $DB->get_records('event', ['repeatid' => $this->event->id], 'timestart ASC', 'id, repeatid, timestart');
$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() < $startdatetime->getTimestamp()) {
if ($expecteddate->getTimestamp() < $startdate->getTimestamp()) {
$expecteddate->add($interval);
$expecteddate->modify('first Monday of this month');
}
+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,
+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);
+4 -1
View File
@@ -59,7 +59,10 @@ class api {
if (is_object($instanceorid)) {
$instance = $instanceorid;
} else {
$instance = $DB->get_record($modulename, array('id' => $instanceorid), '*', MUST_EXIST);
$instance = $DB->get_record($modulename, array('id' => $instanceorid), '*', IGNORE_MISSING);
}
if (!$instance) {
return false;
}
$course = get_course($instance->course);
+7
View File
@@ -72,6 +72,13 @@ class core_completion_api_testcase extends advanced_testcase {
$this->assertEquals(\core_completion\api::COMPLETION_EVENT_TYPE_DATE_COMPLETION_EXPECTED, $event->eventtype);
$this->assertEquals($time, $event->timestart);
$this->assertEquals($time, $event->timesort);
require_once($CFG->dirroot . '/course/lib.php');
// Delete the module.
course_delete_module($assign->cmid);
// Check we don't get a failure when called on a deleted module.
\core_completion\api::update_completion_date_event($assign->cmid, 'assign', null, $time);
}
public function test_update_completion_date_event_update() {
+2
View File
@@ -259,6 +259,8 @@ $CFG->admin = 'admin';
// $CFG->session_memcached_prefix = 'memc.sess.key.';
// $CFG->session_memcached_acquire_lock_timeout = 120;
// $CFG->session_memcached_lock_expire = 7200; // Ignored if PECL memcached is below version 2.2.0
// $CFG->session_memcached_lock_retry_sleep = 150; // Spin-lock retry sleeptime (msec). Only effective
// // for tuning php-memcached 3.0.x (PHP 7)
//
// Redis session handler (requires redis server and redis extension):
// $CFG->session_handler_class = '\core\session\redis';
+3 -1
View File
@@ -268,8 +268,9 @@ class core_course_external extends external_api {
if (!empty($cm->showdescription) or $cm->modname == 'label') {
// We want to use the external format. However from reading get_formatted_content(), $cm->content format is always FORMAT_HTML.
$options = array('noclean' => true);
list($module['description'], $descriptionformat) = external_format_text($cm->content,
FORMAT_HTML, $modcontext->id, $cm->modname, 'intro', $cm->id);
FORMAT_HTML, $modcontext->id, $cm->modname, 'intro', $cm->id, $options);
}
//url of the module
@@ -3135,6 +3136,7 @@ class core_course_external extends external_api {
*/
public static function check_updates($courseid, $tocheck, $filter = array()) {
global $CFG, $DB;
require_once($CFG->dirroot . "/course/lib.php");
$params = self::validate_parameters(
self::check_updates_parameters(),
-4
View File
@@ -13,10 +13,6 @@
padding: 0 6px;
}
.course-content ul.topics li.section .right img.icon {
padding: 0 0 4px 0;
}
.course-content ul.topics li.section .left {
padding-top: 22px;
text-align: right;
-4
View File
@@ -13,10 +13,6 @@
padding: 0 6px;
}
.course-content ul.weeks li.section .right img.icon {
padding: 0 0 4px 0;
}
.course-content ul.weeks li.section .left {
padding-top: 22px;
text-align: right;
+6 -3
View File
@@ -1403,7 +1403,9 @@ function course_module_update_calendar_events($modulename, $instance = null, $cm
if (!isset($cm)) {
$cm = get_coursemodule_from_instance($modulename, $instance->id, $instance->course);
}
course_module_calendar_event_update_process($instance, $cm);
if (!empty($cm)) {
course_module_calendar_event_update_process($instance, $cm);
}
return true;
}
return false;
@@ -1432,8 +1434,9 @@ function course_module_bulk_update_calendar_events($modulename, $courseid = 0) {
}
foreach ($instances as $instance) {
$cm = get_coursemodule_from_instance($modulename, $instance->id, $instance->course);
course_module_calendar_event_update_process($instance, $cm);
if ($cm = get_coursemodule_from_instance($modulename, $instance->id, $instance->course)) {
course_module_calendar_event_update_process($instance, $cm);
}
}
return true;
}
@@ -47,7 +47,8 @@ class converter implements \core_files\converter_interface {
'xls' => 'application/vnd.google-apps.spreadsheet',
'xlsx' => 'application/vnd.google-apps.spreadsheet',
'ppt' => 'application/vnd.google-apps.presentation',
'pptx' => 'application/vnd.google-apps.presentation'
'pptx' => 'application/vnd.google-apps.presentation',
'html' => 'application/vnd.google-apps.document'
];
/** @var array $export List of supported export file formats */
@@ -265,6 +266,6 @@ class converter implements \core_files\converter_interface {
* @return string
*/
public function get_supported_conversions() {
return implode(', ', ['rtf', 'doc', 'xls', 'docx', 'xlsx', 'ppt', 'pptx', 'pdf']);
return implode(', ', ['rtf', 'doc', 'xls', 'docx', 'xlsx', 'ppt', 'pptx', 'pdf', 'html']);
}
}
+2
View File
@@ -24,6 +24,8 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
require_once("$CFG->libdir/externallib.php");
require_once("$CFG->libdir/filelib.php");
+12 -1
View File
@@ -138,7 +138,8 @@ MathJax.Hub.Config({
// setting. Since it is preferably to always load the secure resource.
$httpurl = get_config('filter_mathjaxloader', 'httpurl');
if ($httpurl !== 'http://cdn.mathjax.org/mathjax/2.6-latest/MathJax.js') {
if ($httpurl !== 'http://cdn.mathjax.org/mathjax/2.6-latest/MathJax.js' &&
$httpurl !== 'http://cdn.mathjax.org/mathjax/2.6.1/MathJax.js') {
// If the http setting has been changed, we make the admin choose the https setting because
// it indicates some sort of custom setup. This will be supported by the release notes.
unset_config('httpsurl', 'filter_mathjaxloader');
@@ -200,5 +201,15 @@ MathJax.Hub.Config({
// Automatically generated Moodle v3.3.0 release upgrade line.
// Put any upgrade step following this.
if ($oldversion < 2017051501) {
$httpsurl = get_config('filter_mathjaxloader', 'httpsurl');
if (empty($httpsurl)) {
// URL is empty, most likely because of bad upgrade path. See MDL-59780.
set_config('httpsurl', 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js', 'filter_mathjaxloader');
}
upgrade_plugin_savepoint(true, 2017051501, 'filter', 'mathjaxloader');
}
return true;
}
+1 -1
View File
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2017051500;
$plugin->version = 2017051501;
$plugin->requires = 2017050500; // Requires this Moodle version.
$plugin->component= 'filter_mathjaxloader';
+2 -2
View File
@@ -489,7 +489,7 @@ class grading_manager {
* Returns the given method's controller in the gradable area
*
* @param string $method the method name, eg 'rubric' (must be available)
* @return grading_controller
* @return gradingform_controller
*/
public function get_controller($method) {
global $CFG, $DB;
@@ -534,7 +534,7 @@ class grading_manager {
/**
* Returns the controller for the active method if it is available
*
* @return null|grading_controller
* @return null|gradingform_controller
*/
public function get_active_controller() {
if ($gradingmethod = $this->get_active_method()) {
+2
View File
@@ -24,6 +24,8 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
require_once("$CFG->libdir/externallib.php");
/**
+1 -1
View File
@@ -36,7 +36,7 @@ $string['chooselanguagehead'] = 'Sprache wählen';
$string['chooselanguagesub'] = 'Wählen Sie eine Sprache, die Sie während der Installation verwenden wollen. Die ausgewählte Sprache wird nach der Installation als Standardsprache der Instanz benutzt, aber Sie dürfen die Sprache jederzeit ändern.';
$string['clialreadyconfigured'] = 'Die Datei config.php existiert bereits. Bitte benutzen Sie admin/cli/install_database.php, wenn Sie diese Site installieren möchten.';
$string['clialreadyinstalled'] = 'Die Datei config.php existiert bereits. Bitte benutzen Sie admin/cli/install_database.php, wenn Sie diese Site aktualisieren möchten.';
$string['cliinstallheader'] = 'Installation von Moodle {$a} über die Kommandozeile';
$string['cliinstallheader'] = 'Installation von Moodle {$a} über die Befehlszeile';
$string['databasehost'] = 'Datenbank-Server';
$string['databasename'] = 'Datenbank-Name';
$string['databasetypehead'] = 'Datenbank-Treiber wählen';
+3 -3
View File
@@ -88,9 +88,9 @@ $string['pathsunsecuredataroot'] = 'Andmete juurkataloogi asukoht pole turvaline
$string['pathswrongadmindir'] = 'Halduskataloogi pole olemas';
$string['phpextension'] = '{$a} PHP-laiendus';
$string['phpversion'] = 'PHP versioon';
$string['phpversionhelp'] = '<p>Moodle vajab vähemalt PHP versiooni 4.1.0</p>
<p>Sinu jooksev versioon on {$a}</p>
<p>Sa pead oma PHP-d uuendama või kolima hosti, kus on uuem PHP versioon!</p>';
$string['phpversionhelp'] = '<p>Moodle vajab vähemalt PHP versiooni 5.6.5 või 7.1 (versioonil 7.0.x on mõned mootoripiirangud).</p>
<p>Teie praegune versioon on {$a}.</p>
<p>Peate uuendama oma PHP või kolima hosti, kus on uuem PHP versioon.</p>';
$string['welcomep10'] = '{$a->installername} ({$a->installerversion})';
$string['welcomep20'] = 'Teile kuvatakse see leht, kuna olete edukalt oma arvutisse installinud ja
käivitanud paketi <strong>{$a->packname} {$a->packversion}</strong>. Õnnitleme!';
+2 -2
View File
@@ -30,8 +30,8 @@
defined('MOODLE_INTERNAL') || die();
$string['cannotcreatedboninstall'] = '<p>Ezin da datu-basea sortu.<p>
<p>Zehaztutako datu-basea ez da existitzen eta adierazitako erabiltzaileak ez du baimenik datu-basea sortzeko.<p>
$string['cannotcreatedboninstall'] = '<p>Ezin da datu-basea sortu.</p>
<p>Zehaztutako datu-basea ez da existitzen eta adierazitako erabiltzaileak ez du baimenik datu-basea sortzeko.</p>
<p>Guneko kudeatzaileak datu-basearen konfigurazioa egiaztatu behar du.</p>';
$string['cannotcreatelangdir'] = 'Ezin da hizkuntza-direktorioa sortu';
$string['cannotcreatetempdir'] = 'Ezin da temp direktorioa sortu';
+1
View File
@@ -31,6 +31,7 @@
defined('MOODLE_INTERNAL') || die();
$string['language'] = 'Jezik';
$string['moodlelogo'] = 'Moodle logo';
$string['next'] = 'Nastavi';
$string['previous'] = 'Prethodni';
$string['reload'] = 'Učitaj ponovno';
+2 -2
View File
@@ -35,7 +35,7 @@ $string['availablelangs'] = '利用可能な言語パック';
$string['chooselanguagehead'] = '言語を選択してください。';
$string['chooselanguagesub'] = 'インストールにのみ使用する言語を選択してください。この言語はサイトのデフォルト言語としても使用されます。後でサイト言語を変更することができます。';
$string['clialreadyconfigured'] = '設定ファイルconfig.phpはすでに登録されています。このサイトをインストールする場合、admin/cli/install_database.phpを使用してください。';
$string['clialreadyinstalled'] = '設定ファイルconfig.phpはすでに登録されています。このサイトをアップグレードする場合、admin/cli/upgrade.phpを使用してください。';
$string['clialreadyinstalled'] = '設定ファイルconfig.phpはすでに登録されています。このサイトをアップグレードする場合、admin/cli/upgrade.phpを使用してください。';
$string['cliinstallheader'] = 'Moodle {$a} コマンドラインインストールプログラム';
$string['databasehost'] = 'データベースホスト :';
$string['databasename'] = 'データベース名 :';
@@ -57,7 +57,7 @@ $string['memorylimithelp'] = '<p>現在、サーバのPHPメモリ制限が {$a}
<ol>
<li>あなたがリコンパイル可能な場合、PHPを<i>--enable-memory-limit</i>オプションでコンパイルしてください。これにより、Moodle自身がメモリ制限を設定することが可能になります。</li>
<li>あなたがphp.iniファイルにアクセスできる場合、<b>memory_limit</b>設定を40Mのように変更することができます。php.iniファイルにアクセスできない場合、管理者に変更を依頼してください。</li>
<li>いくつかのPHPサーバでは下記の行を含む.htaccessファイルをMoodleディレクトリに作成することができます:
<li>いくつかのPHPサーバでは下記の行を含む.htaccessファイルをMoodleディレクトリに作成することができます:
<blockquote><div>php_value memory_limit 40M</div></blockquote>
<p>しかし、この設定が<b>すべての</b>PHPページの動作を妨げる場合もあります。ページ閲覧中にエラーが表示される場合、.htaccessファイルを削除してください。</p></li>
</ol>';
+1
View File
@@ -40,3 +40,4 @@ $string['cliunknowoption'] = 'Neatpažintos parinktys: {$a} naudokite --žinyno
$string['cliyesnoprompt'] = 'įveskite t (taip) arba n (ne)';
$string['environmentrequireinstall'] = 'turi būti įdiegta ir įjungta';
$string['environmentrequireversion'] = 'būtina naudoti versiją {$a->needed}, o jūs naudojate {$a->current}';
$string['upgradekeyset'] = 'Naujovinimo raktas (palikite tuščią, jei nenorite nustatyti)';
+3 -1
View File
@@ -63,7 +63,9 @@ $string['pathsunsecuredataroot'] = 'Šakninio duomenų katalogo kelias nesaugus'
$string['pathswrongadmindir'] = 'Nėra administratoriaus katalogo';
$string['phpextension'] = '{$a} PHP plėtinys';
$string['phpversion'] = 'PHP versija';
$string['phpversionhelp'] = '<p>„Moodle“ reikalauja, kad PHP versija būtų bent 4.3.0 arba 5.1.0 (5.0.x versijoje yra daug problemų).</p> <p>Dabar naudojate versiją {$a}</p> <p>Turite atnaujinti PHP versiją arba perkelti į pagrindinį kompiuterį, kuriame veikia naujesnė PHP versija!<br /> (Jei naudojate 5.0.x versiją, taip pat galite paleisti senesnę 4.4.x versiją)</p>';
$string['phpversionhelp'] = '<p>„Moodle“ reikalauja, kad PHP versija būtų ne žemesnė 5.6.5 arba 7.1 (7.0.x versijoje yra tam tikrų trūkumų).</p>
<p>Dabar naudojate versiją {$a}</p>
<p>Turite atnaujinti PHP versiją arba perkelti į pagrindinį kompiuterį, kuriame veikia naujesnė PHP versija.</p>';
$string['welcomep10'] = '{$a->installername} ({$a->installerversion})';
$string['welcomep20'] = 'Matote šį puslapį, nes į kompiuterį sėkmingai įdiegėte ir paleidote <strong>{$a->packname} {$a->packversion}</strong> paketą. Sveikiname!';
$string['welcomep30'] = 'Šiame <strong>{$a->installername}</strong> leidime yra taikomosios programos, skirtos aplinkai, kurioje veiks <strong>Moodle</strong>, sukurti:';
-1
View File
@@ -30,6 +30,5 @@
defined('MOODLE_INTERNAL') || die();
$string['parentlanguage'] = '';
$string['thisdirection'] = 'ltr';
$string['thislanguage'] = 'Lietuvių';
+34
View File
@@ -0,0 +1,34 @@
<?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/>.
/**
* Automatically generated strings for Moodle installer
*
* Do not edit this file manually! It contains just a subset of strings
* needed during the very first steps of installation. This file was
* generated automatically by export-installer.php (which is part of AMOS
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
* list of strings defined in /install/stringnames.txt.
*
* @package installer
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$string['thisdirection'] = 'ltr';
$string['thislanguage'] = 'Māori (Te Reo)';
+3
View File
@@ -37,6 +37,9 @@ $string['cliincorrectvalueerror'] = 'Грешка, погрешна вредно
$string['cliincorrectvalueretry'] = 'Неточни вредност, ве молиме обидете се повторно';
$string['clitypevalue'] = 'впишете вредност';
$string['clitypevaluedefault'] = 'впишете вредност, притиснете Enter за да го користите стандардната вредност ({$a})';
$string['cliunknowoption'] = 'Непрепознаена опција:
{$a}
Ве молиме употребете --help опција.';
$string['cliyesnoprompt'] = 'впишете y (значи да) или n (значи не)';
$string['environmentrequireinstall'] = 'потребно е да се инсталира/овозможи';
$string['environmentrequireversion'] = 'верзијата {$a->needed} е потребна, а вие извршувате {$a->current}';
+3 -3
View File
@@ -35,11 +35,11 @@ $string['cliansweryes'] = 'y';
$string['cliincorrectvalueerror'] = 'Error, valor incorrècta « {$a->value} » pel paramètre « {$a->option} »';
$string['cliincorrectvalueretry'] = 'Valor incorrècta, ensajar tornamai';
$string['clitypevalue'] = 'tipe valor';
$string['clitypevaluedefault'] = 'tipe valor, tapez Entrée per utilizar la valor per defaut ({$a})';
$string['clitypevaluedefault'] = 'tipe valor, picatz Entrada per utilizar la valor per defaut ({$a})';
$string['cliunknowoption'] = 'Options non reconegudas :
{$a}.
Utilisez l\'option --help.';
Utilizatz l\'opcion --help.';
$string['cliyesnoprompt'] = 'Picatz y (per òc) o n (per non)';
$string['environmentrequireinstall'] = 'doit èsser installat e activat';
$string['environmentrequireinstall'] = 'deu èsser installat e activat';
$string['environmentrequireversion'] = 'la version {$a->needed} es requesida ; utilizatz actualament la version {$a->current}';
$string['upgradekeyset'] = 'Metre a jorn la clau (daissar void per la definir pas)';
+1 -1
View File
@@ -31,7 +31,7 @@
defined('MOODLE_INTERNAL') || die();
$string['cannotcreatedboninstall'] = '<p>Impossible de crear la basa de donadas.</p>
<p>La banca de donadas indicada existís pas e l\'utilizaire especificat a pas las autorizacions que permeton de crear una basa de donadas.</p>.
<p>La basa de donadas indicada existís pas e l\'utilizaire especificat a pas las autorizacions que permeton de crear una basa de donadas.</p>.
<p>L\'administrator del site deu repassar la configuracion de la basa de donadas.</p>';
$string['cannotcreatelangdir'] = 'Creacion del dorsièr lang impossible';
$string['cannotcreatetempdir'] = 'Creacion del dorsièr temp impossibla';
+3 -3
View File
@@ -34,9 +34,9 @@ $string['admindirname'] = 'Dorsièr d\'administracion';
$string['availablelangs'] = 'Paquetatges de lenga disponibles';
$string['chooselanguagehead'] = 'Causissètz una lenga';
$string['cliinstallheader'] = 'Programa d\'installacion de Moodle {$a} en linha de comanda';
$string['databasehost'] = 'Servidor de banca de donadas';
$string['databasename'] = 'Nom de la banca de donadas';
$string['databasetypehead'] = 'Seleccionar un pilòt de banca de donadas';
$string['databasehost'] = 'Servidor de basa de donadas';
$string['databasename'] = 'Nom de la basa de donadas';
$string['databasetypehead'] = 'Seleccionar un pilòt de basa de donadas';
$string['dataroot'] = 'Dorsièr de donadas';
$string['dbprefix'] = 'Prefix de las taulas';
$string['dirroot'] = 'Dorsièr Moodle';
+6
View File
@@ -72,5 +72,11 @@ $string['welcomep20'] = 'Vedeți această pagină deoarece ați instalat și lan
$string['welcomep30'] = 'Lansarea <strong>{$a->installername}</strong> include aplicațiile
pentru a crea un mediu în care <strong>Moodle</strong> va funcționa, și anume:';
$string['welcomep40'] = 'Pachetul include și <strong>Moodle {$a->moodlerelease} ({$a->moodleversion})</strong>.';
$string['welcomep50'] = 'Utilizarea tuturor aplicațiilor din acest pachet este determinată de respectivele lor
licențe. Pachetul complet <strong>{$a->installername}</strong> este
<a href="http://www.opensource.org/docs/definition_plain.html">open source</a> și este distribuit sub licența <a href="http://www.gnu.org/copyleft/gpl.html">GPL</a>.';
$string['welcomep60'] = 'Următoarele pagini oferă pași ușor de urmat pentru a
configura și seta <strong>Moodle</strong> în computerul dumneavoastră. Puteți accepta setările implicite
sau, opțional, le modificați pentru a corespunde nevoilor dumneavoastră.';
$string['welcomep70'] = 'Click pe butonul "Next" de mai jos pentru a continua setarea <strong>Moodle</strong>.';
$string['wwwroot'] = 'Adresă Web';
+1
View File
@@ -31,3 +31,4 @@
defined('MOODLE_INTERNAL') || die();
$string['databasename'] = 'Databasens namn';
$string['welcomep50'] = 'Användningen av alla applikationer i detta paket regleras av sina respektive licenser. Det fullständiga paketet <strong>{$a->installername}</strong> är <a href="http://www.opensource.org/docs/definition_plain.html">Öppen källkod</a> och distribueras under <a href="http://www.gnu.org/copyleft/gpl.html">GPL</a> licensen.';
+2 -1
View File
@@ -137,7 +137,7 @@ $string['configallowblockstodock'] = 'If enabled and supported by the selected t
$string['configallowcategorythemes'] = 'If you enable this, then themes can be set at the category level. This will affect all child categories and courses unless they have specifically set their own theme. WARNING: Enabling category themes may affect performance.';
$string['configallowcoursethemes'] = 'If you enable this, then courses will be allowed to set their own themes. Course themes override all other theme choices (site, user, or session themes)';
$string['configallowedemaildomains'] = 'List email domains that are allowed to be disclosed in the "From" section of outgoing email. The default of "Empty" will use the No-reply address for all outgoing email. The use of wildcards is allowed e.g. *.example.com will allow emails sent from any subdomain of example.com, but not example.com itself. This will require separate entry.';
$string['configallowemailaddresses'] = 'If you want to restrict all new email addresses to particular domains, then list them here separated by spaces. All other domains will be rejected. To allow subdomains add the domain with a preceding \'.\'. eg <strong>ourcollege.edu.au .gov.au</strong>';
$string['configallowemailaddresses'] = 'To restrict new email addresses to particular domains, list them here separated by spaces. All other domains will be rejected. To allow subdomains, add the domain with a preceding \'.\'. To allow a root domain together with its subdomains, add the domain twice - once with a preceding \'.\' and once without e.g. .ourcollege.edu.au ourcollege.edu.au.';
$string['configallowguestmymoodle'] = 'If enabled guests can access Dashboard, otherwise guests are redirected to the site front page.';
$string['configallowobjectembed'] = 'As a default security measure, normal users are not allowed to embed multimedia (like Flash) within texts using explicit EMBED and OBJECT tags in their HTML (although it can still be done safely using the mediaplugins filter). If you wish to allow these tags then enable this option.';
$string['configallowoverride'] = 'You can allow people with the roles on the left side to override some of the column roles';
@@ -1147,6 +1147,7 @@ $string['unsupporteddbstorageengine'] = 'The database storage engine being used
$string['unsupporteddbtablerowformat'] = 'Your database has tables using Antelope as the file format. You are recommended to convert the tables to the Barracuda file format. See the documentation <a href="https://docs.moodle.org/en/cli">Administration via command line</a> for details of a tool for converting InnoDB tables to Barracuda.';
$string['unsupportedphpversion7'] = 'PHP version 7 is not supported.';
$string['unsupportedphpversion71'] = 'PHP version 7.1 is not supported.';
$string['unsupportedphpversion72'] = 'PHP version 7.2 is not supported.';
$string['unsuspenduser'] = 'Activate user account';
$string['updateaccounts'] = 'Update existing accounts';
$string['updatecomponent'] = 'Update component';
+2
View File
@@ -448,6 +448,8 @@ $string['notlocalisederrormessage'] = '{$a}';
$string['notmemberofgroup'] = 'You are not a member of this course group';
$string['notownerofkey'] = 'You are not owner of this key';
$string['nousers'] = 'No such user!';
$string['oauth1accesstoken'] = 'OAuth 1.0 error: We did not obtain the access token.';
$string['oauth1requesttoken'] = 'OAuth 1.0 error: We did not obtain the request token - the service provider may be temporarily down.';
$string['onlyadmins'] = 'Only administrators can do that';
$string['onlyeditingteachers'] = 'Only editing teachers can do that';
$string['onlyeditown'] = 'You can only edit your own information';
+1 -1
View File
@@ -59,7 +59,7 @@ $string['duplicate_usernames'] = 'We failed to create an index on the columns "m
$string['enabled_for_all'] = '(This service has been enabled for all hosts).';
$string['enterausername'] = 'Please enter a username, or a list of usernames separated by commas.';
$string['error7020'] = 'This error normally occurs if the remote site has created a record for you with the wrong wwwroot, for example, http://yoursite.com instead of http://www.yoursite.com. You should contact the administrator of the remote site with your wwwroot (as specified in config.php) asking her to update her record for your host.';
$string['error7022'] = 'The message you sent to the remote site was encrypted properly, but not signed. This is very unexpected; you should probably file a bug if this occurs (giving as much information as possible about the application versions in question, etc.';
$string['error7022'] = 'The message you sent to the remote site was encrypted properly, but not signed. This is very unexpected; you should probably file a bug if this occurs (giving as much information as possible about the application versions in question etc).';
$string['error7023'] = 'The remote site has tried to decrypt your message with all the keys it has on record for your site. They have all failed. You might be able to fix this problem by manually re-keying with the remote site. This is unlikely to occur unless you\'ve been out of communication with the remote site for a few months.';
$string['error7024'] = 'You send an unencrypted message to the remote site, but the remote site doesn\'t accept unencrypted communication from your site. This is very unexpected; you should probably file a bug if this occurs (giving as much information as possible about the application versions in question, etc.';
$string['error7026'] = 'The key that your message was signed with differs from the key that the remote host has on file for your server. Further, the remote host attempted to fetch your current key and failed to do so. Please manually re-key with the remote host and try again.';
+4 -2
View File
@@ -618,6 +618,8 @@ $string['emaildisplayyes'] = 'Allow everyone to see my email address';
$string['emailenable'] = 'This email address is enabled';
$string['emailenableclick'] = 'Click here to re-enable all email being sent to this address';
$string['emailexists'] = 'This email address is already registered.';
$string['emailexistssignuphint'] = 'Perhaps you created an account in the past? {$a}';
$string['emailexistshintlink'] = 'Recover forgotten username or password';
$string['emailformat'] = 'Email format';
$string['emailcharset'] = 'Email charset';
$string['emailmustbereal'] = 'Note: your email address must be a real one';
@@ -709,7 +711,7 @@ $string['emptydragdropregion'] = 'empty region';
$string['enable'] = 'Enable';
$string['encryptedcode'] = 'Encrypted code';
$string['enddate'] = 'Course end date';
$string['enddate_help'] = 'The course end date is only used for reports. Users can still enter the course after the end date.';
$string['enddate_help'] = 'The course end date is used for determining whether a course should be included in a user\'s list of courses. When the end date is past, the course is no longer listed in the navigation and is listed as past in the course overview. The course end date may also be used by custom reports. Users can still enter the course after the end date; in other words the date does not restrict access.';
$string['english'] = 'English';
$string['enrolmentmethods'] = 'Enrolment methods';
$string['entercourse'] = 'Click to enter this course';
@@ -978,7 +980,7 @@ $string['choosereportfilter'] = 'Choose a filter for the report';
$string['choosetheme'] = 'Choose theme';
$string['chooseuser'] = 'Choose a user';
$string['courseduration'] = 'Course duration';
$string['courseduration_desc'] = 'The course duration is used to calculate the default course end date. The course end date is only used for reports. Users can still enter the course after the end date.';
$string['courseduration_desc'] = 'The course duration is used to calculate the default course end date. The course end date is used for determining whether a course should be included in a user\'s list of courses. It may also be used by custom reports. Users can still enter the course after the end date.';
$string['eventcontentviewed'] = 'Content viewed';
$string['icqnumber'] = 'ICQ number';
$string['icon'] = 'Icon';
+1 -1
View File
@@ -350,7 +350,7 @@ $string['restore:restoretargetimport'] = 'Restore from files targeted as import'
$string['restore:rolldates'] = 'Allowed to roll activity configuration dates on restore';
$string['restore:uploadfile'] = 'Upload files to backup areas';
$string['restore:userinfo'] = 'Restore user data';
$string['restore:viewautomatedfilearea'] = 'View automated backup area';
$string['restore:viewautomatedfilearea'] = 'Restore courses from automated backups';
$string['risks'] = 'Risks';
$string['roleallowheader'] = 'Allow role:';
$string['roleallowinfo'] = 'Select a role to be added to the list of allowed roles in context "{$a->context}", capability "{$a->cap}":';
+25 -12
View File
@@ -2743,20 +2743,28 @@ function get_component_string($component, $contextlevel) {
/**
* Gets the list of roles assigned to this context and up (parents)
* from the list of roles that are visible on user profile page
* and participants page.
* from the aggregation of:
* a) the list of roles that are visible on user profile page and participants page (profileroles setting) and;
* b) if applicable, those roles that are assigned in the context.
*
* @param context $context
* @return array
*/
function get_profile_roles(context $context) {
global $CFG, $DB;
if (empty($CFG->profileroles)) {
return array();
// If the current user can assign roles, then they can see all roles on the profile and participants page,
// provided the roles are assigned to at least 1 user in the context. If not, only the policy-defined roles.
if (has_capability('moodle/role:assign', $context)) {
$rolesinscope = array_keys(get_all_roles($context));
} else {
$rolesinscope = empty($CFG->profileroles) ? [] : array_map('trim', explode(',', $CFG->profileroles));
}
list($rallowed, $params) = $DB->get_in_or_equal(explode(',', $CFG->profileroles), SQL_PARAMS_NAMED, 'a');
if (empty($rolesinscope)) {
return [];
}
list($rallowed, $params) = $DB->get_in_or_equal($rolesinscope, SQL_PARAMS_NAMED, 'a');
list($contextlist, $cparams) = $DB->get_in_or_equal($context->get_parent_context_ids(true), SQL_PARAMS_NAMED, 'p');
$params = array_merge($params, $cparams);
@@ -2815,18 +2823,23 @@ function get_roles_used_in_context(context $context) {
*/
function get_user_roles_in_course($userid, $courseid) {
global $CFG, $DB;
if (empty($CFG->profileroles)) {
return '';
}
if ($courseid == SITEID) {
$context = context_system::instance();
} else {
$context = context_course::instance($courseid);
}
// If the current user can assign roles, then they can see all roles on the profile and participants page,
// provided the roles are assigned to at least 1 user in the context. If not, only the policy-defined roles.
if (has_capability('moodle/role:assign', $context)) {
$rolesinscope = array_keys(get_all_roles($context));
} else {
$rolesinscope = empty($CFG->profileroles) ? [] : array_map('trim', explode(',', $CFG->profileroles));
}
if (empty($rolesinscope)) {
return '';
}
list($rallowed, $params) = $DB->get_in_or_equal(explode(',', $CFG->profileroles), SQL_PARAMS_NAMED, 'a');
list($rallowed, $params) = $DB->get_in_or_equal($rolesinscope, SQL_PARAMS_NAMED, 'a');
list($contextlist, $cparams) = $DB->get_in_or_equal($context->get_parent_context_ids(true), SQL_PARAMS_NAMED, 'p');
$params = array_merge($params, $cparams);
+6 -16
View File
@@ -3702,16 +3702,11 @@ class admin_setting_configmixedhostiplist extends admin_setting_configtextarea {
$entries = explode("\n", $data);
foreach ($entries as $key => $entry) {
$entry = trim($entry);
// This regex matches any string which:
// a) contains at least one non-ascii unicode character AND
// b) starts with a-zA-Z0-9 or any non-ascii unicode character AND
// c) ends with a-zA-Z0-9 or any non-ascii unicode character
// d) contains a-zA-Z0-9, hyphen, dot or any non-ascii unicode characters in the middle.
if (preg_match('/^(?=[^\x00-\x7f])([^\x00-\x7f]|[a-zA-Z0-9])([^\x00-\x7f]|[a-zA-Z0-9-.])*([^\x00-\x7f]|[a-zA-Z0-9])$/',
$entry)) {
// This regex matches any string that has non-ascii character.
if (preg_match('/[^\x00-\x7f]/', $entry)) {
// If we can convert the unicode string to an idn, do so.
// Otherwise, leave the original unicode string alone and let the validation function handle it (it will fail).
$val = idn_to_ascii($entry);
$val = idn_to_ascii($entry, IDNA_NONTRANSITIONAL_TO_ASCII, INTL_IDNA_VARIANT_UTS46);
$entries[$key] = $val ? $val : $entry;
}
}
@@ -3729,7 +3724,7 @@ class admin_setting_configmixedhostiplist extends admin_setting_configtextarea {
foreach ($entries as $key => $entry) {
$entry = trim($entry);
if (strpos($entry, 'xn--') !== false) {
$entries[$key] = idn_to_utf8($entry);
$entries[$key] = idn_to_utf8($entry, IDNA_NONTRANSITIONAL_TO_ASCII, INTL_IDNA_VARIANT_UTS46);
}
}
return implode("\n", $entries);
@@ -8746,16 +8741,11 @@ class admin_setting_enablemobileservice extends admin_setting_configcheckbox {
* @return string XHTML
*/
public function output_html($data, $query='') {
global $CFG, $OUTPUT;
global $OUTPUT;
$html = parent::output_html($data, $query);
if ((string)$data === $this->yes) {
require_once($CFG->dirroot . "/lib/filelib.php");
$curl = new curl();
$httpswwwroot = str_replace('http:', 'https:', $CFG->wwwroot); //force https url
$curl->head($httpswwwroot . "/login/index.php");
$info = $curl->get_info();
if (empty($info['http_code']) or ($info['http_code'] >= 400)) {
if (!is_https()) {
$html .= $OUTPUT->notification(get_string('nohttpsformobilewarning', 'admin'));
}
}
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1 +1 @@
define(["jquery","core/ajax","core/templates","core/notification","core/str","core/config","core/url"],function(a,b,c,d,e,f,g){return a("body").on("click keypress","[data-inplaceeditable] [data-inplaceeditablelink]",function(h){if("keypress"!==h.type||13===h.keyCode){h.stopImmediatePropagation(),h.preventDefault();var i=a(this),j=i.closest("[data-inplaceeditable]"),k=function(b){b.addClass("updating");var c=b.find("img.spinner");c.length?c.show():(c=a("<img/>").attr("src",g.imageUrl("i/loading_small")).addClass("spinner").addClass("smallicon"),b.append(c))},l=function(a){a.removeClass("updating"),a.find("img.spinner").hide()},m=function(e,f){k(e),b.call([{methodname:"core_update_inplace_editable",args:{itemid:e.attr("data-itemid"),component:e.attr("data-component"),itemtype:e.attr("data-itemtype"),value:f},done:function(b){var d=e.attr("data-value");c.render("core/inplace_editable",b).done(function(f,g){var h=a(f);c.replaceNode(e,h,g),h.find("[data-inplaceeditablelink]").focus(),h.trigger({type:"updated",ajaxreturn:b,oldvalue:d})})},fail:function(b){var c=a.Event("updatefailed",{exception:b,newvalue:f});l(e),e.trigger(c),c.isDefaultPrevented()||d.exception(b)}}],!0)},n=function(a){a.find("input").off(),a.find("select").off(),a.html(a.attr("data-oldcontent")),a.removeAttr("data-oldcontent"),a.removeClass("inplaceeditingon"),a.find("[data-inplaceeditablelink]").focus()},o=function(){a("span.inplaceeditable.inplaceeditingon").each(function(){n(a(this))})},p=function(b,c){var d,e=b;for(d=0;d<c;d++)e+=String(Math.floor(10*Math.random()));return 0===a("#"+e).length?e:p(b,c)},q=function(b){e.get_string("edittitleinstructions").done(function(c){var d=a('<span class="editinstructions">'+c+"</span>").attr("id",p("id_editinstructions_",20)),e=a('<input type="text"/>').attr("id",p("id_inplacevalue_",20)).attr("value",b.attr("data-value")).attr("aria-describedby",d.attr("id")).addClass("ignoredirty").addClass("form-control"),g=a('<label class="accesshide">'+j.attr("data-editlabel")+"</label>").attr("for",e.attr("id"));b.html("").append(d).append(g).append(e),e.focus(),e.select(),e.on("keyup keypress focusout",function(a){if(!f.behatsiterunning||"focusout"!==a.type){if("keypress"===a.type&&13===a.keyCode){var c=e.val();n(b),m(b,c)}("keyup"===a.type&&27===a.keyCode||"focusout"===a.type)&&n(b)}})})},r=function(a,b){n(a),m(a,b)},s=function(b,c){var d,e=a("<select></select>").attr("id",p("id_inplacevalue_",20)).addClass("custom-select"),g=a('<label class="accesshide">'+j.attr("data-editlabel")+"</label>").attr("for",e.attr("id"));for(d in c)e.append(a("<option>").attr("value",c[d].key).html(c[d].value));e.val(b.attr("data-value")),b.html("").append(g).append(e),e.focus(),e.select(),e.on("keyup change focusout",function(a){if(!f.behatsiterunning||"focusout"!==a.type){if("change"===a.type){var c=e.val();n(b),m(b,c)}("keyup"===a.type&&27===a.keyCode||"focusout"===a.type)&&n(b)}})},t=function(b){b.addClass("inplaceeditingon"),b.attr("data-oldcontent",b.html());var c=b.attr("data-type"),d=b.attr("data-options");"toggle"===c?r(b,d):"select"===c?s(b,a.parseJSON(d)):q(b)};o(),t(j)}}),{}});
define(["jquery","core/ajax","core/templates","core/notification","core/str","core/config","core/url"],function(a,b,c,d,e,f,g){return a("body").on("click keypress","[data-inplaceeditable] [data-inplaceeditablelink]",function(h){if("keypress"!==h.type||13===h.keyCode){h.stopImmediatePropagation(),h.preventDefault();var i=a(this),j=i.closest("[data-inplaceeditable]"),k=function(b){b.addClass("updating");var c=b.find("img.spinner");c.length?c.show():(c=a("<img/>").attr("src",g.imageUrl("i/loading_small")).addClass("spinner").addClass("smallicon"),b.append(c))},l=function(a){a.removeClass("updating"),a.find("img.spinner").hide()},m=function(e,f){var g=[e.attr("data-itemid"),e.attr("data-component"),e.attr("data-itemtype")].join("-");M.util.js_pending(g),k(e),b.call([{methodname:"core_update_inplace_editable",args:{itemid:e.attr("data-itemid"),component:e.attr("data-component"),itemtype:e.attr("data-itemtype"),value:f},done:function(b){var d=e.attr("data-value");c.render("core/inplace_editable",b).done(function(f,h){var i=a(f);c.replaceNode(e,i,h),i.find("[data-inplaceeditablelink]").focus(),i.trigger({type:"updated",ajaxreturn:b,oldvalue:d}),M.util.js_complete(g)})},fail:function(b){var c=a.Event("updatefailed",{exception:b,newvalue:f});l(e),M.util.js_complete(g),e.trigger(c),c.isDefaultPrevented()||d.exception(b)}}],!0)},n=function(a){a.find("input").off(),a.find("select").off(),a.html(a.attr("data-oldcontent")),a.removeAttr("data-oldcontent"),a.removeClass("inplaceeditingon"),a.find("[data-inplaceeditablelink]").focus()},o=function(){a("span.inplaceeditable.inplaceeditingon").each(function(){n(a(this))})},p=function(b,c){var d,e=b;for(d=0;d<c;d++)e+=String(Math.floor(10*Math.random()));return 0===a("#"+e).length?e:p(b,c)},q=function(b){e.get_string("edittitleinstructions").done(function(c){var d=a('<span class="editinstructions">'+c+"</span>").attr("id",p("id_editinstructions_",20)),e=a('<input type="text"/>').attr("id",p("id_inplacevalue_",20)).attr("value",b.attr("data-value")).attr("aria-describedby",d.attr("id")).addClass("ignoredirty").addClass("form-control"),g=a('<label class="accesshide">'+j.attr("data-editlabel")+"</label>").attr("for",e.attr("id"));b.html("").append(d).append(g).append(e),e.focus(),e.select(),e.on("keyup keypress focusout",function(a){if(!f.behatsiterunning||"focusout"!==a.type){if("keypress"===a.type&&13===a.keyCode){var c=e.val();n(b),m(b,c)}("keyup"===a.type&&27===a.keyCode||"focusout"===a.type)&&n(b)}})})},r=function(a,b){n(a),m(a,b)},s=function(b,c){var d,e=a("<select></select>").attr("id",p("id_inplacevalue_",20)).addClass("custom-select"),g=a('<label class="accesshide">'+j.attr("data-editlabel")+"</label>").attr("for",e.attr("id"));for(d in c)e.append(a("<option>").attr("value",c[d].key).html(c[d].value));e.val(b.attr("data-value")),b.html("").append(g).append(e),e.focus(),e.select(),e.on("keyup change focusout",function(a){if(!f.behatsiterunning||"focusout"!==a.type){if("change"===a.type){var c=e.val();n(b),m(b,c)}("keyup"===a.type&&27===a.keyCode||"focusout"===a.type)&&n(b)}})},t=function(b){b.addClass("inplaceeditingon"),b.attr("data-oldcontent",b.html());var c=b.attr("data-type"),d=b.attr("data-options");"toggle"===c?r(b,d):"select"===c?s(b,a.parseJSON(d)):q(b)};o(),t(j)}}),{}});
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1 +1 @@
define(["jquery","core/modal_events","core/modal_registry","core/modal","core/modal_save_cancel","core/modal_confirm","core/modal_cancel","core/templates","core/notification","core/custom_interaction_events"],function(a,b,c,d,e,f,g,h,i,j){var k={DEFAULT:"core/modal",SAVE_CANCEL:"core/modal_save_cancel",CONFIRM:"core/modal_confirm",CANCEL:"core/modal_cancel"},l={DEFAULT:"DEFAULT",SAVE_CANCEL:"SAVE_CANCEL",CONFIRM:"CONFIRM",CANCEL:"CANCEL"};c.register(l.DEFAULT,d,k.DEFAULT),c.register(l.SAVE_CANCEL,e,k.SAVE_CANCEL),c.register(l.CONFIRM,f,k.CONFIRM),c.register(l.CANCEL,g,k.CANCEL);var m=function(a,c){"undefined"!=typeof c&&(j.define(c,[j.events.activate]),c.on(j.events.activate,function(b,c){a.then(function(a){return a.show(),a}),c.originalEvent.preventDefault()}),a.then(function(a){return a.getRoot().on(b.hidden,function(){c.focus()}),a}))},n=function(b,c){c=a(c);var d=b.module,e=new d(c);return e},o=function(b,c){var d=b.template,e=h.render(d,{}).then(function(c){var d=a(c);return n(b,d)}).fail(i.exception);return m(e,c),e},p=function(a,b){var d=a.type||l.DEFAULT,e=!!a.large,f=null;return f=c.get(d),f||i.exception({message:"Unable to find modal of type: "+d}),o(f,b).then(function(b){return"undefined"!=typeof a.title&&b.setTitle(a.title),"undefined"!=typeof a.body&&b.setBody(a.body),"undefined"!=typeof a.footer&&b.setFooter(a.footer),e&&b.setLarge(),b})};return{create:p,types:l}});
define(["jquery","core/modal_events","core/modal_registry","core/modal","core/modal_save_cancel","core/modal_confirm","core/modal_cancel","core/templates","core/notification","core/custom_interaction_events"],function(a,b,c,d,e,f,g,h,i,j){var k={DEFAULT:"core/modal",SAVE_CANCEL:"core/modal_save_cancel",CONFIRM:"core/modal_confirm",CANCEL:"core/modal_cancel"},l={DEFAULT:"DEFAULT",SAVE_CANCEL:"SAVE_CANCEL",CONFIRM:"CONFIRM",CANCEL:"CANCEL"};c.register(l.DEFAULT,d,k.DEFAULT),c.register(l.SAVE_CANCEL,e,k.SAVE_CANCEL),c.register(l.CONFIRM,f,k.CONFIRM),c.register(l.CANCEL,g,k.CANCEL);var m=function(a,c){if("undefined"!=typeof c){var d=null;j.define(c,[j.events.activate]),c.on(j.events.activate,function(b,c){d=b.currentTarget,a.then(function(a){return a.show(),a}),c.originalEvent.preventDefault()}),a.then(function(a){return a.getRoot().on(b.hidden,function(){null!==d&&d.focus()}),a})}},n=function(b,c){c=a(c);var d=b.module,e=new d(c);return e},o=function(b,c){var d=b.template,e=h.render(d,{}).then(function(c){var d=a(c);return n(b,d)}).fail(i.exception);return m(e,c),e},p=function(a,b){var d=a.type||l.DEFAULT,e=!!a.large,f=null;return f=c.get(d),f||i.exception({message:"Unable to find modal of type: "+d}),o(f,b).then(function(b){return"undefined"!=typeof a.title&&b.setTitle(a.title),"undefined"!=typeof a.body&&b.setBody(a.body),"undefined"!=typeof a.footer&&b.setFooter(a.footer),e&&b.setLarge(),b})};return{create:p,types:l}});
+10 -4
View File
@@ -37,6 +37,8 @@ define(['jquery', 'core/log', 'core/str', 'core/templates', 'core/notification']
UP: 38
};
var uniqueId = $.now();
/**
* Make an item in the selection list "active".
*
@@ -774,11 +776,15 @@ define(['jquery', 'core/log', 'core/str', 'core/templates', 'core/notification']
// Find or generate some ids.
var state = {
selectId: originalSelect.attr('id'),
inputId: 'form_autocomplete_input-' + $.now(),
suggestionsId: 'form_autocomplete_suggestions-' + $.now(),
selectionId: 'form_autocomplete_selection-' + $.now(),
downArrowId: 'form_autocomplete_downarrow-' + $.now()
inputId: 'form_autocomplete_input-' + uniqueId,
suggestionsId: 'form_autocomplete_suggestions-' + uniqueId,
selectionId: 'form_autocomplete_selection-' + uniqueId,
downArrowId: 'form_autocomplete_downarrow-' + uniqueId
};
// Increment the unique counter so we don't get duplicates ever.
uniqueId++;
options.multiple = originalSelect.attr('multiple');
var originalLabel = $('[for=' + state.selectId + ']');
+9
View File
@@ -60,6 +60,13 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
};
var updateValue = function(mainelement, value) {
var pendingId = [
mainelement.attr('data-itemid'),
mainelement.attr('data-component'),
mainelement.attr('data-itemtype'),
].join('-');
M.util.js_pending(pendingId);
addSpinner(mainelement);
ajax
.call([{
@@ -77,6 +84,7 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
templates.replaceNode(mainelement, newelement, js);
newelement.find('[data-inplaceeditablelink]').focus();
newelement.trigger({type: 'updated', ajaxreturn: data, oldvalue: oldvalue});
M.util.js_complete(pendingId);
});
},
fail: function(ex) {
@@ -85,6 +93,7 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
newvalue: value
});
removeSpinner(mainelement);
M.util.js_complete(pendingId);
mainelement.trigger(e);
if (!e.isDefaultPrevented()) {
notification.exception(ex);
+105 -17
View File
@@ -50,6 +50,12 @@ define(['jquery', 'core/templates', 'core/notification', 'core/key_codes',
*/
var backdropPromise;
/**
* A counter that gets incremented for each modal created. This can be
* used to generate unique values for the modals.
*/
var modalCounter = 0;
/**
* Constructor for the Modal.
*
@@ -66,6 +72,7 @@ define(['jquery', 'core/templates', 'core/notification', 'core/key_codes',
this.isAttached = false;
this.bodyJS = null;
this.footerJS = null;
this.modalCount = modalCounter++;
if (!this.root.is(SELECTORS.CONTAINER)) {
Notification.exception({message: 'Element is not a modal container'});
@@ -212,6 +219,16 @@ define(['jquery', 'core/templates', 'core/notification', 'core/key_codes',
return this.footer;
};
/**
* Get the unique modal count.
*
* @method getModalCount
* @return {int}
*/
Modal.prototype.getModalCount = function() {
return this.modalCount;
};
/**
* Set the modal title element.
*
@@ -253,25 +270,96 @@ define(['jquery', 'core/templates', 'core/notification', 'core/key_codes',
// Just set the value if it's a string.
body.html(value);
} else {
var jsPendingId = 'amd-modal-js-pending-id-' + this.getModalCount();
M.util.js_pending(jsPendingId);
// Otherwise we assume it's a promise to be resolved with
// html and javascript.
Templates.render(TEMPLATES.LOADING, {}).done(function(html) {
body.html(html);
var contentPromise = null;
body.css('overflow', 'hidden');
value.done(function(html, js) {
if (value.state() == 'pending') {
// We're still waiting for the body promise to resolve so
// let's show a loading icon.
body.animate({height: '100px'}, 150);
body.html('');
contentPromise = Templates.render(TEMPLATES.LOADING, {})
.then(function(html) {
var loadingIcon = $(html).hide();
body.html(loadingIcon);
loadingIcon.fadeIn(150);
// We only want the loading icon to fade out
// when the content for the body has finished
// loading.
return $.when(loadingIcon.promise(), value);
})
.then(function(loadingIcon) {
// Once the content has finished loading and
// the loading icon has been shown then we can
// fade the icon away to reveal the content.
return loadingIcon.fadeOut(100).promise();
})
.then(function() {
return value;
});
} else {
// The content is already loaded so let's just display
// it to the user. No need for a loading icon.
contentPromise = value;
}
// Now we can actually display the content.
contentPromise.then(function(html, js) {
var result = null;
if (this.isVisible()) {
// If the modal is visible then we should display
// the content gracefully for the user.
body.css('opacity', 0);
var currentHeight = body.innerHeight();
body.html(html);
// We need to clear any height values we've set here
// in order to measure the height of the content being
// added. This then allows us to animate the height
// transition.
body.css('height', '');
var newHeight = body.innerHeight();
body.css('height', currentHeight + 'px');
result = body.animate(
{height: newHeight + 'px', opacity: 1},
{duration: 150, queue: false}
).promise();
} else {
// Since the modal isn't visible we can just immediately
// set the content. No need to animate it.
body.html(html);
}
if (js) {
if (this.isAttached) {
// If we're in the DOM then run the JS immediately.
Templates.runTemplateJS(js);
} else {
// Otherwise cache it to be run when we're attached.
this.bodyJS = js;
}
if (js) {
if (this.isAttached) {
// If we're in the DOM then run the JS immediately.
Templates.runTemplateJS(js);
} else {
// Otherwise cache it to be run when we're attached.
this.bodyJS = js;
}
}.bind(this));
}.bind(this));
}
return result;
}.bind(this))
.fail(Notification.exception)
.always(function() {
// When we're done displaying all of the content we need
// to clear the custom values we've set here.
body.css('height', '');
body.css('overflow', '');
body.css('opacity', '');
M.util.js_complete(jsPendingId);
return;
})
.fail(Notification.exception);
}
};
@@ -324,7 +412,7 @@ define(['jquery', 'core/templates', 'core/notification', 'core/key_codes',
return;
}
this.getRoot().addClass('large');
this.getModal().addClass('modal-lg');
};
/**
@@ -334,7 +422,7 @@ define(['jquery', 'core/templates', 'core/notification', 'core/key_codes',
* @return {bool}
*/
Modal.prototype.isLarge = function() {
return this.getRoot().hasClass('large');
return this.getModal().hasClass('modal-lg');
};
/**
@@ -347,7 +435,7 @@ define(['jquery', 'core/templates', 'core/notification', 'core/key_codes',
return;
}
this.getRoot().removeClass('large');
this.getModal().removeClass('modal-lg');
};
/**
@@ -357,7 +445,7 @@ define(['jquery', 'core/templates', 'core/notification', 'core/key_codes',
* @return {bool}
*/
Modal.prototype.isSmall = function() {
return !this.getRoot().hasClass('large');
return !this.getModal().hasClass('modal-lg');
};
/**
+7 -1
View File
@@ -60,8 +60,11 @@ define(['jquery', 'core/modal_events', 'core/modal_registry', 'core/modal',
*/
var setUpTrigger = function(modalPromise, triggerElement) {
if (typeof triggerElement != 'undefined') {
// The element that actually shows the modal.
var actualTriggerElement = null;
CustomEvents.define(triggerElement, [CustomEvents.events.activate]);
triggerElement.on(CustomEvents.events.activate, function(e, data) {
actualTriggerElement = e.currentTarget;
modalPromise.then(function(modal) {
modal.show();
@@ -72,7 +75,10 @@ define(['jquery', 'core/modal_events', 'core/modal_registry', 'core/modal',
modalPromise.then(function(modal) {
modal.getRoot().on(ModalEvents.hidden, function() {
triggerElement.focus();
// Focus on the trigger element that actually launched the modal.
if (actualTriggerElement !== null) {
actualTriggerElement.focus();
}
});
return modal;
+3 -1
View File
@@ -887,7 +887,9 @@ function signup_validate_data($data, $files) {
$errors['email'] = get_string('invalidemail');
} else if ($DB->record_exists('user', array('email' => $data['email']))) {
$errors['email'] = get_string('emailexists').' <a href="forgot_password.php">'.get_string('newpassword').'?</a>';
$errors['email'] = get_string('emailexists') . ' ' .
get_string('emailexistssignuphint', 'moodle',
html_writer::link(new moodle_url('/login/forgot_password.php'), get_string('emailexistshintlink')));
}
if (empty($data['email2'])) {
$errors['email2'] = get_string('missingemail');
@@ -131,6 +131,8 @@ XPATH
]) = %locator%] |
.//div[contains(concat(' ', normalize-space(@class), ' '), ' yui-dialog ') and
normalize-space(descendant::div[@class='hd']) = %locator%]
|
.//div[@data-region='modal' and descendant::*[@data-region='title'] = %locator%]
XPATH
, 'icon' => <<<XPATH
.//*[contains(concat(' ', normalize-space(@class), ' '), ' icon ') and ( contains(normalize-space(@title), %locator%))]
+17 -1
View File
@@ -70,7 +70,23 @@ class user_login_failed extends base {
public function get_description() {
// Note that username could be any random user input.
$username = s($this->other['username']);
return "Login failed for the username '{$username}' for the reason with id '{$this->other['reason']}'.";
$reasonid = $this->other['reason'];
$loginfailed = 'Login failed for user';
switch ($reasonid){
case 1:
return $loginfailed." '{$username}'. User does not exist (error ID '{$reasonid}').";
case 2:
return $loginfailed." '{$username}'. User is suspended (error ID '{$reasonid}').";
case 3:
return $loginfailed." '{$username}'. Most likely the password did not match (error ID '{$reasonid}').";
case 4:
return $loginfailed." '{$username}'. User is locked out (error ID '{$reasonid}').";
case 5:
return $loginfailed." '{$username}'. User is not authorised (error ID '{$reasonid}').";
default:
return $loginfailed." '{$username}', error ID '{$reasonid}'.";
}
}
/**
+3 -9
View File
@@ -215,15 +215,9 @@ class client extends \oauth2_client {
$this->store_token($accesstoken);
if (isset($r->refresh_token)) {
$userinfo = $this->get_userinfo();
if ($userinfo['email'] == $systemaccount->get('email')) {
$systemaccount->set('refreshtoken', $r->refresh_token);
$systemaccount->update();
$this->refreshtoken = $r->refresh_token;
} else {
throw new moodle_exception('Attempt to store refresh token for non-system user.');
}
$systemaccount->set('refreshtoken', $r->refresh_token);
$systemaccount->update();
$this->refreshtoken = $r->refresh_token;
}
return true;
+7
View File
@@ -145,5 +145,12 @@ abstract class icon_system {
}
return false;
}
/**
* Clears the instance cache, for use in unit tests
*/
public static function reset_caches() {
self::$instance = null;
}
}
+35 -3
View File
@@ -36,18 +36,29 @@ defined('MOODLE_INTERNAL') || die();
class memcached extends handler {
/** @var string $savepath save_path string */
protected $savepath;
/** @var array $servers list of servers parsed from save_path */
protected $servers;
/** @var string $prefix session key prefix */
protected $prefix;
/** @var int $acquiretimeout how long to wait for session lock */
protected $acquiretimeout = 120;
/**
* @var int $lockexpire how long to wait before expiring the lock so that other requests
* may continue execution, ignored if PECL memcached is below version 2.2.0.
*/
protected $lockexpire = 7200;
/**
* @var integer $lockretrysleep Used for memcached 3.x (PHP7), the amount of time to
* sleep between attempts to acquire the session lock. Mimics the deprecated config
* memcached.sess_lock_wait.
*/
protected $lockretrysleep = 150;
/**
* Create new instance of handler.
*/
@@ -79,6 +90,10 @@ class memcached extends handler {
if (!empty($CFG->session_memcached_lock_expire)) {
$this->lockexpire = (int)$CFG->session_memcached_lock_expire;
}
if (!empty($CFG->session_memcached_lock_retry_sleep)) {
$this->lockretrysleep = (int)$CFG->session_memcached_lock_retry_sleep;
}
}
/**
@@ -134,15 +149,32 @@ class memcached extends handler {
ini_set('session.save_path', $this->savepath);
ini_set('memcached.sess_prefix', $this->prefix);
ini_set('memcached.sess_locking', '1'); // Locking is required!
ini_set('memcached.sess_lock_expire', $this->lockexpire);
// Try to configure lock and expire timeouts - ignored if memcached is before version 2.2.0.
if (version_compare($version, '3.0.0-dev') >= 0) {
ini_set('memcached.sess_lock_wait_max', $this->acquiretimeout * 1000);
// With memcached 3.x (PHP 7) we configure the max retries to make and the time to sleep between each retry.
// There are two sleep config values, an initial and a max value.
// After each attempt the memcached module adjusts the sleep value to be the lesser of the configured max
// value, or 2X the previous value.
// With default memcached.ini configs (5, 1s, 2s) the result is only 5 attempts to lock over 9 sec.
// To mimic the behavior of the 2.2.x module so we get more attempts and much more frequently, config both
// sleep values to the old default value of 150 msec (making it constant) and calculate number of retries
// using the existing Moodle config $CFG->session_memcached_acquire_lock_timeout.
// Doing this so admins configure session lock attempt timeout in familiar terms, and more straight-forward
// to detect if lock attempt timeout has occurred in start().
// If _min and _max values are not equal, the actual lock acquire timeout will not be the expected
// configured value in $CFG->session_memcached_acquire_lock_timeout; this will cause session data loss when
// failure to acquire the lock is not detected.
ini_set('memcached.sess_lock_wait_min', $this->lockretrysleep);
ini_set('memcached.sess_lock_wait_max', $this->lockretrysleep);
ini_set('memcached.sess_lock_retries', (int)(($this->acquiretimeout * 1000) / $this->lockretrysleep) + 1);
} else {
// With memcached 2.2.x we configure max time to attempt lock, and accept default value (in memcached.ini)
// for sleep time between each attempt (usually 150 msec), then memcached calculates the max number of
// retries to make.
ini_set('memcached.sess_lock_max_wait', $this->acquiretimeout);
}
ini_set('memcached.sess_lock_expire', $this->lockexpire);
}
/**
@@ -44,6 +44,10 @@ class refresh_mod_calendar_events_task extends adhoc_task {
* Run the task to refresh calendar events.
*/
public function execute() {
global $CFG;
require_once($CFG->dirroot . '/course/lib.php');
// Specific list of plugins that need to be refreshed. If not set, then all mod plugins will be refreshed.
$pluginstorefresh = null;
if (isset($this->get_custom_data()->plugins)) {
+30 -1
View File
@@ -2906,7 +2906,12 @@ function xmldb_main_upgrade($oldversion) {
['hub', '%' . $DB->sql_like_escape('_' . $cleanoldhuburl)]);
foreach ($entries as $entry) {
$newname = substr($entry->name, 0, -strlen($cleanoldhuburl)) . $cleannewhuburl;
$DB->update_record('config_plugins', ['id' => $entry->id, 'name' => $newname]);
try {
$DB->update_record('config_plugins', ['id' => $entry->id, 'name' => $newname]);
} catch (dml_exception $e) {
// Entry with new name already exists, remove the one with an old name.
$DB->delete_records('config_plugins', ['id' => $entry->id]);
}
}
// Update published courses.
@@ -2932,5 +2937,29 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2017051501.09);
}
if ($oldversion < 2017051502.01) {
// Force all messages to be reindexed.
set_config('core_message_message_sent_lastindexrun', '0', 'core_search');
set_config('core_message_message_received_lastindexrun', '0', 'core_search');
// Main savepoint reached.
upgrade_main_savepoint(true, 2017051502.01);
}
if ($oldversion < 2017051502.04) {
// Remove duplicate registrations.
$newhuburl = "https://moodle.net";
$registrations = $DB->get_records('registration_hubs', ['huburl' => $newhuburl], 'confirmed DESC, id ASC');
if (count($registrations) > 1) {
$reg = array_shift($registrations);
$DB->delete_records_select('registration_hubs', 'huburl = ? AND id <> ?', [$newhuburl, $reg->id]);
}
// Main savepoint reached.
upgrade_main_savepoint(true, 2017051502.04);
}
return true;
}
+9 -1
View File
@@ -176,6 +176,8 @@ class mysqli_native_moodle_database extends moodle_database {
$result = $this->mysqli->query($sql);
$this->query_end($result);
if ($rec = $result->fetch_assoc()) {
// MySQL 8 BC: information_schema.* returns the fields in upper case.
$rec = array_change_key_case($rec, CASE_LOWER);
$engine = $rec['engine'];
}
$result->close();
@@ -248,6 +250,8 @@ class mysqli_native_moodle_database extends moodle_database {
$result = $this->mysqli->query($sql);
$this->query_end($result);
if ($rec = $result->fetch_assoc()) {
// MySQL 8 BC: information_schema.* returns the fields in upper case.
$rec = array_change_key_case($rec, CASE_LOWER);
$collation = $rec['collation_name'];
}
$result->close();
@@ -309,10 +313,12 @@ class mysqli_native_moodle_database extends moodle_database {
$result = $this->mysqli->query($sql);
$this->query_end($result);
if ($rec = $result->fetch_assoc()) {
// MySQL 8 BC: information_schema.* returns the fields in upper case.
$rec = array_change_key_case($rec, CASE_LOWER);
if (isset($table)) {
$rowformat = $rec['row_format'];
} else {
$rowformat = $rec['Value'];
$rowformat = $rec['value'];
}
}
$result->close();
@@ -691,6 +697,8 @@ class mysqli_native_moodle_database extends moodle_database {
if ($result->num_rows > 0) {
// standard table exists
while ($rawcolumn = $result->fetch_assoc()) {
// MySQL 8 BC: information_schema.* returns the fields in upper case.
$rawcolumn = array_change_key_case($rawcolumn, CASE_LOWER);
$info = (object)$this->get_column_info((object)$rawcolumn);
$structure[$info->name] = new database_column_info($info);
}
@@ -956,4 +956,4 @@ Y.namespace('M.atto_media').Button = Y.Base.create('button', Y.M.editor_atto.Edi
});
}, '@VERSION@', {"requires": ["moodle-editor_atto-plugin"]});
}, '@VERSION@', {"requires": ["moodle-editor_atto-plugin", "moodle-form-shortforms"]});
File diff suppressed because one or more lines are too long
@@ -956,4 +956,4 @@ Y.namespace('M.atto_media').Button = Y.Base.create('button', Y.M.editor_atto.Edi
});
}, '@VERSION@', {"requires": ["moodle-editor_atto-plugin"]});
}, '@VERSION@', {"requires": ["moodle-editor_atto-plugin", "moodle-form-shortforms"]});
@@ -1,7 +1,8 @@
{
"moodle-atto_media-button": {
"requires": [
"moodle-editor_atto-plugin"
"moodle-editor_atto-plugin",
"moodle-form-shortforms"
]
}
}
+11
View File
@@ -1593,3 +1593,14 @@ function restrict_php_version(&$result, $version) {
function restrict_php_version_71(&$result) {
return restrict_php_version($result, '7.1');
}
/**
* Check if the current PHP version is greater than or equal to
* PHP version 7.2.
*
* @param object $result an environment_results instance
* @return bool result of version check
*/
function restrict_php_version_72(&$result) {
return restrict_php_version($result, '7.2');
}
+1 -1
View File
@@ -2369,7 +2369,7 @@ function send_stored_file($stored_file, $lifetime=null, $filter=0, $forcedownloa
$size = 256;
}
$fileicon = file_file_icon($stored_file, $size);
send_file($CFG->dirroot.'/pix/'.$fileicon.'.svg', basename($fileicon).'.svg');
send_file($CFG->dirroot.'/pix/'.$fileicon.'.png', basename($fileicon).'.png');
} else {
// preview images have fixed cache lifetime and they ignore forced download
// (they are generated by GD and therefore they are considered reasonably safe).
+3 -3
View File
@@ -1326,7 +1326,7 @@ class file_storage {
$this->create_file($newrecord);
} catch (dml_exception $e) {
if ($newfile) {
$this->move_to_trash($newrecord->contenthash);
$this->filesystem->remove_file($newrecord->contenthash);
}
throw new stored_file_creation_exception($newrecord->contextid, $newrecord->component, $newrecord->filearea, $newrecord->itemid,
$newrecord->filepath, $newrecord->filename, $e->debuginfo);
@@ -1445,7 +1445,7 @@ class file_storage {
$this->create_file($newrecord);
} catch (dml_exception $e) {
if ($newfile) {
$this->move_to_trash($newrecord->contenthash);
$this->filesystem->remove_file($newrecord->contenthash);
}
throw new stored_file_creation_exception($newrecord->contextid, $newrecord->component, $newrecord->filearea, $newrecord->itemid,
$newrecord->filepath, $newrecord->filename, $e->debuginfo);
@@ -1580,7 +1580,7 @@ class file_storage {
$filerecord->id = $DB->insert_record('files', $filerecord);
} catch (dml_exception $e) {
if (!empty($newfile)) {
$this->move_to_trash($filerecord->contenthash);
$this->filesystem->remove_file($filerecord->contenthash);
}
throw new stored_file_creation_exception($filerecord->contextid, $filerecord->component, $filerecord->filearea, $filerecord->itemid,
$filerecord->filepath, $filerecord->filename, $e->debuginfo);
+6 -1
View File
@@ -478,7 +478,12 @@ abstract class file_system {
* @return resource file handle
*/
public function get_content_file_handle(stored_file $file, $type = stored_file::FILE_HANDLE_FOPEN) {
$path = $this->get_remote_path_from_storedfile($file);
if ($type === stored_file::FILE_HANDLE_GZOPEN) {
// Local file required for gzopen.
$path = $this->get_local_path_from_storedfile($file, true);
} else {
$path = $this->get_remote_path_from_storedfile($file);
}
return self::get_file_handle_for_path($path, $type);
}
+2 -2
View File
@@ -904,8 +904,8 @@ class core_files_file_system_testcase extends advanced_testcase {
$filecontent = 'example content';
$file = $this->get_stored_file($filecontent);
$fs = $this->get_testable_mock(['get_remote_path_from_storedfile']);
$fs->method('get_remote_path_from_storedfile')
$fs = $this->get_testable_mock(['get_local_path_from_storedfile']);
$fs->method('get_local_path_from_storedfile')
->willReturn(__DIR__ . "/fixtures/test.tgz");
// Note: We are unable to determine the mode in which the $fh was opened.
+253
View File
@@ -0,0 +1,253 @@
<?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/>.
/**
* Provides {@link flickr_client} class.
*
* @package core
* @copyright 2017 David Mudrák <david@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
require_once($CFG->libdir.'/oauthlib.php');
/**
* Simple Flickr API client implementing the features needed by Moodle
*
* @copyright 2017 David Mudrak <david@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class flickr_client extends oauth_helper {
/**
* Base URL for Flickr OAuth 1.0 API calls.
*/
const OAUTH_ROOT = 'https://www.flickr.com/services/oauth';
/**
* Base URL for Flickr REST API calls.
*/
const REST_ROOT = 'https://api.flickr.com/services/rest';
/**
* Base URL for Flickr Upload API call.
*/
const UPLOAD_ROOT = 'https://up.flickr.com/services/upload/';
/**
* Set up OAuth and initialize the client.
*
* The callback URL specified here will override the one specified in the
* auth flow defined at Flickr Services.
*
* @param string $consumerkey
* @param string $consumersecret
* @param moodle_url|string $callbackurl
*/
public function __construct($consumerkey, $consumersecret, $callbackurl = '') {
parent::__construct([
'api_root' => self::OAUTH_ROOT,
'oauth_consumer_key' => $consumerkey,
'oauth_consumer_secret' => $consumersecret,
'oauth_callback' => $callbackurl,
]);
}
/**
* Temporarily store the request token secret in the session.
*
* The request token secret is returned by the oauth request_token method.
* It needs to be stored in the session before the user is redirected to
* the Flickr to authorize the client. After redirecting back, this secret
* is used for exchanging the request token with the access token.
*
* The identifiers help to avoid collisions between multiple calls to this
* method from different plugins in the same session. They are used as the
* session cache identifiers. Provide an associative array identifying the
* particular method call. At least, the array must contain the 'caller'
* with the caller's component name. Use additional items if needed.
*
* @param array $identifiers Identification of the call
* @param string $secret
*/
public function set_request_token_secret(array $identifiers, $secret) {
if (empty($identifiers) || empty($identifiers['caller'])) {
throw new coding_exception('Invalid call identification');
}
$cache = cache::make_from_params(cache_store::MODE_SESSION, 'core', 'flickrclient', $identifiers);
$cache->set('request_token_secret', $secret);
}
/**
* Returns previously stored request token secret.
*
* See {@link self::set_request_token_secret()} for more details on the
* $identifiers argument.
*
* @param array $identifiers Identification of the call
* @return string|bool False on error, string secret otherwise.
*/
public function get_request_token_secret(array $identifiers) {
if (empty($identifiers) || empty($identifiers['caller'])) {
throw new coding_exception('Invalid call identification');
}
$cache = cache::make_from_params(cache_store::MODE_SESSION, 'core', 'flickrclient', $identifiers);
return $cache->get('request_token_secret');
}
/**
* Call a Flickr API method.
*
* @param string $function API function name like 'flickr.photos.getSizes' or just 'photos.getSizes'
* @param array $params Additional API call arguments.
* @param string $method HTTP method to use (GET or POST).
* @return object|bool Response as returned by the Flickr or false on invalid authentication
*/
public function call($function, array $params = [], $method = 'GET') {
if (strpos($function, 'flickr.') !== 0) {
$function = 'flickr.'.$function;
}
$params['method'] = $function;
$params['format'] = 'json';
$params['nojsoncallback'] = 1;
$rawresponse = $this->request($method, self::REST_ROOT, $params);
$response = json_decode($rawresponse);
if (!is_object($response) || !isset($response->stat)) {
throw new moodle_exception('flickr_api_call_failed', 'core_error', '', $rawresponse);
}
if ($response->stat === 'ok') {
return $response;
} else if ($response->stat === 'fail' && $response->code == 98) {
// Authentication failure, give the caller a chance to re-authenticate.
return false;
} else {
throw new moodle_exception('flickr_api_call_failed', 'core_error', '', $response);
}
return $response;
}
/**
* Return the URL to fetch the given photo from.
*
* Flickr photos are distributed via farm servers staticflickr.com in
* various sizes (resolutions). The method tries to find the source URL of
* the photo in the highest possible resolution. Results are cached so that
* we do not need to query the Flickr API over and over again.
*
* @param string $photoid Flickr photo identifier
* @return string URL
*/
public function get_photo_url($photoid) {
$cache = cache::make_from_params(cache_store::MODE_APPLICATION, 'core', 'flickrclient');
$url = $cache->get('photourl_'.$photoid);
if ($url === false) {
$response = $this->call('photos.getSizes', ['photo_id' => $photoid]);
// Sizes are returned from smallest to greatest.
if (!empty($response->sizes->size) && is_array($response->sizes->size)) {
while ($bestsize = array_pop($response->sizes->size)) {
if (isset($bestsize->source)) {
$url = $bestsize->source;
break;
}
}
}
}
if ($url === false) {
throw new repository_exception('cannotdownload', 'repository');
} else {
$cache->set('photourl_'.$photoid, $url);
}
return $url;
}
/**
* Upload a photo from Moodle file pool to Flickr.
*
* Optional meta information are title, description, tags, is_public,
* is_friend, is_family, safety_level, content_type and hidden.
* See {@link https://www.flickr.com/services/api/upload.api.html}.
*
* Upload can't be asynchronous because then the query would not return the
* photo ID which we need to add the photo to a photoset (album)
* eventually.
*
* @param stored_file $photo stored in Moodle file pool
* @param array $meta optional meta information
* @return int|bool photo id, false on authentication failure
*/
public function upload(stored_file $photo, array $meta = []) {
$args = [
'title' => isset($meta['title']) ? $meta['title'] : null,
'description' => isset($meta['description']) ? $meta['description'] : null,
'tags' => isset($meta['tags']) ? $meta['tags'] : null,
'is_public' => isset($meta['is_public']) ? $meta['is_public'] : 0,
'is_friend' => isset($meta['is_friend']) ? $meta['is_friend'] : 0,
'is_family' => isset($meta['is_family']) ? $meta['is_family'] : 0,
'safety_level' => isset($meta['safety_level']) ? $meta['safety_level'] : 1,
'content_type' => isset($meta['content_type']) ? $meta['content_type'] : 1,
'hidden' => isset($meta['hidden']) ? $meta['hidden'] : 2,
];
$this->sign_secret = $this->consumer_secret.'&'.$this->access_token_secret;
$params = $this->prepare_oauth_parameters(self::UPLOAD_ROOT, ['oauth_token' => $this->access_token] + $args, 'POST');
$params['photo'] = $photo;
$response = $this->http->post(self::UPLOAD_ROOT, $params);
if ($response) {
$xml = simplexml_load_string($response);
if ((string)$xml['stat'] === 'ok') {
return (int)$xml->photoid;
} else if ((string)$xml['stat'] === 'fail' && (int)$xml->err['code'] == 98) {
// Authentication failure.
return false;
} else {
throw new moodle_exception('flickr_upload_failed', 'core_error', '',
['code' => (int)$xml->err['code'], 'message' => (string)$xml->err['msg']]);
}
} else {
throw new moodle_exception('flickr_upload_error', 'core_error', '', null, $response);
}
}
}
+6
View File
@@ -25,6 +25,8 @@
* ChangeLog:
* 1. upload() method uses Moodle stored_file
* 2. upload() method supports all params provided by http://www.flickr.com/services/api/upload.api.html
* 3. auth() method shows debugging warning as this library cannot be used any
* more for calling Flickr API that requires authentication.
*
* @package moodlecore
* @subpackage 3rd-party
@@ -240,6 +242,10 @@ class phpFlickr {
function auth ($perms = "write", $remember_uri = true)
{
debugging('The flickrlib.php cannot be used for authenticated Flickr API calls.
Flickr does not support their legacy auth API any more. Use the new flickrclient.php instead.');
// Redirects to Flickr's authentication piece if there is no valid token.
// If remember_uri is set to false, the callback script (included) will
// redirect to its default page.
+1 -1
View File
@@ -58,7 +58,7 @@ class MoodleQuickForm_editor extends HTML_QuickForm_element implements templatab
/** @var array options provided to initalize filepicker */
protected $_options = array('subdirs' => 0, 'maxbytes' => 0, 'maxfiles' => 0, 'changeformat' => 0,
'areamaxbytes' => FILE_AREA_MAX_BYTES_UNLIMITED, 'context' => null, 'noclean' => 0, 'trusttext' => 0,
'return_types' => 15, 'enable_filemanagement' => true);
'return_types' => 15, 'enable_filemanagement' => true, 'autosave' => true);
// 15 is $_options['return_types'] = FILE_INTERNAL | FILE_EXTERNAL | FILE_REFERENCE | FILE_CONTROLLED_LINK.
/** @var array values for editor */
+3 -1
View File
@@ -199,8 +199,10 @@ class MoodleQuickForm_modgrade extends MoodleQuickForm_group {
// Set a message so the user knows why they can not alter the grade type or scale.
if ($this->currentgradetype == 'scale') {
$gradesexistmsg = get_string('modgradecantchangegradetyporscalemsg', 'grades');
} else {
} else if ($this->canrescale) {
$gradesexistmsg = get_string('modgradecantchangegradetypemsg', 'grades');
} else {
$gradesexistmsg = get_string('modgradecantchangegradetype', 'grades');
}
$gradesexisthtml = '<div class=\'alert\'>' . $gradesexistmsg . '</div>';
@@ -185,7 +185,7 @@ Feature: Using the activity grade form element
And I follow "Test forum name"
And I navigate to "Edit settings" in current page administration
When I expand all fieldsets
Then I should see "Some grades have already been awarded, so the grade type cannot be changed. If you wish to change the maximum grade, you must first choose whether or not to rescale existing grades."
Then I should see "You cannot change the type, as grades already exist for this item."
And I set the field "Maximum grade" to "50"
And I press "Save and display"
And I should see "You cannot change the maximum grade when grades already exist for an activity with ratings"
+13
View File
@@ -448,4 +448,17 @@ class google_oauth extends oauth2_client {
$this->header = array();
$this->response = array();
}
/**
* Make a HTTP request, we override the parents because we do not
* want to send accept headers (this was a change in the parent class and we want to keep the old behaviour).
*
* @param string $url The URL to request
* @param array $options
* @param mixed $acceptheader Not used.
* @return bool
*/
protected function request($url, $options = array(), $acceptheader = 'application/json') {
return parent::request($url, $options, false);
}
}
+4 -3
View File
@@ -2448,8 +2448,8 @@ class global_navigation extends navigation_node {
$reporttab = $usercoursenode->add(get_string('activityreports'));
$reports = get_plugin_list_with_function('report', 'extend_navigation_user', 'lib.php');
foreach ($reports as $reportfunction) {
$reportfunctions = get_plugin_list_with_function('report', 'extend_navigation_user', 'lib.php');
foreach ($reportfunctions as $reportfunction) {
$reportfunction($reporttab, $user, $usercourse);
}
@@ -2715,7 +2715,8 @@ class global_navigation extends navigation_node {
// Just a link to course competency.
$title = get_string('competencies', 'core_competency');
$path = new moodle_url("/admin/tool/lp/coursecompetencies.php", array('courseid' => $course->id));
$coursenode->add($title, $path, navigation_node::TYPE_SETTING, null, null, new pix_icon('i/competencies', ''));
$coursenode->add($title, $path, navigation_node::TYPE_SETTING, null, 'competencies',
new pix_icon('i/competencies', ''));
}
if ($navoptions->grades) {
$url = new moodle_url('/grade/report/index.php', array('id'=>$course->id));
+22 -16
View File
@@ -184,9 +184,6 @@ class oauth_helper {
$oauth_params['oauth_nonce'] = $this->get_nonce();
$oauth_params['oauth_timestamp'] = $this->get_timestamp();
$oauth_params['oauth_consumer_key'] = $this->consumer_key;
if (!empty($this->oauth_callback)) {
$oauth_params['oauth_callback'] = $this->oauth_callback->out(false);
}
$oauth_params['oauth_signature_method'] = 'HMAC-SHA1';
$oauth_params['oauth_signature'] = $this->sign($http_method, $url, $oauth_params, $this->sign_secret);
return $oauth_params;
@@ -221,23 +218,25 @@ class oauth_helper {
*/
public function request_token() {
$this->sign_secret = $this->consumer_secret.'&';
$params = $this->prepare_oauth_parameters($this->request_token_api, array(), 'GET');
if (empty($this->oauth_callback)) {
$params = [];
} else {
$params = ['oauth_callback' => $this->oauth_callback->out(false)];
}
$params = $this->prepare_oauth_parameters($this->request_token_api, $params, 'GET');
$content = $this->http->get($this->request_token_api, $params, $this->http_options);
// Including:
// oauth_token
// oauth_token_secret
$result = $this->parse_result($content);
if (empty($result['oauth_token'])) {
throw new moodle_exception('Error while requesting an oauth token');
}
// build oauth authrize url
if (!empty($this->oauth_callback)) {
// url must be rawurlencode
$result['authorize_url'] = $this->authorize_url . '?oauth_token='.$result['oauth_token'].'&oauth_callback='.rawurlencode($this->oauth_callback->out(false));
} else {
// no callback
$result['authorize_url'] = $this->authorize_url . '?oauth_token='.$result['oauth_token'];
throw new moodle_exception('oauth1requesttoken', 'core_error', '', null, $content);
}
// Build oauth authorize url.
$result['authorize_url'] = $this->authorize_url . '?oauth_token='.$result['oauth_token'];
return $result;
}
@@ -266,6 +265,11 @@ class oauth_helper {
unset($params['oauth_callback']);
$content = $this->http->post($this->access_token_api, $params, $this->http_options);
$keys = $this->parse_result($content);
if (empty($keys['oauth_token']) || empty($keys['oauth_token_secret'])) {
throw new moodle_exception('oauth1accesstoken', 'core_error', '', null, $content);
}
$this->set_access_token($keys['oauth_token'], $keys['oauth_token_secret']);
return $keys;
}
@@ -600,9 +604,10 @@ abstract class oauth2_client extends curl {
*
* @param string $url The URL to request
* @param array $options
* @param mixed $acceptheader mimetype (as string) or false to skip sending an accept header.
* @return bool
*/
protected function request($url, $options = array()) {
protected function request($url, $options = array(), $acceptheader = 'application/json') {
$murl = new moodle_url($url);
if ($this->accesstoken) {
@@ -614,8 +619,9 @@ abstract class oauth2_client extends curl {
}
}
// Force JSON format content in response.
$this->setHeader('Accept: application/json');
if ($acceptheader) {
$this->setHeader('Accept: ' . $acceptheader);
}
$response = parent::request($murl->out(false), $options);

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