Compare commits

...

604 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7) 330fa046d5 Moodle release 3.3.4 2018-01-12 20:35:41 +01:00
Eloy Lafuente (stronk7) 7c9b7feb10 weekly release 3.3.3+ 2018-01-12 02:12:39 +01:00
Jake Dallimore 272467514a Merge branch 'MDL-61177-33' of git://github.com/andrewnicols/moodle into MOODLE_33_STABLE 2018-01-11 09:23:42 +08:00
Cameron Ball bbcf850b68 MDL-61143 core_files: Don't append dot when checking domain names or IP addresses.
Previously we appended a dot at the end of IP addresses and domain names in the
cURL security helper, but it causes issues with Google OAuth so this patch removes it.
2018-01-10 15:23:50 +08:00
Andrew Nicols 7bdde1a0ee MDL-61177 badges: JS pending checks in connection test 2018-01-10 08:13:58 +08:00
Adrian Greeve 5912eca97e MDL-61131 repositories: Added a key to verify incoming urls. 2018-01-09 11:34:51 +01:00
Cameron Ball 5dfceb9f52 MDL-61143 core_files: Update unit tests for curl_security_helper
Previously some of the unit tests were passing "by accident" becuase
we had the security helper letting through domains where the DNS lookup
failed. That behaviour has changed and now such domains are blocked.

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

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

This patch causes anything that Moodle does not consider to be a valid domain or IP to be blocked
by the cURL security helper.
2018-01-09 16:54:30 +08:00
Cameron Ball ef7dc1ae34 MDL-61143 core_files: Check all A records when testing blocked IPs 2018-01-09 16:54:30 +08:00
Simey Lameze 4f04ad2d19 MDL-60235 core_calendar: clean event name field 2018-01-09 16:54:30 +08:00
Juan Leyva 12b47586bb MDL-60908 mod_quiz: Return question state only when configured
The question state should be returned following the quiz review options
settings.
2018-01-09 16:54:30 +08:00
David Monllao 67240e4539 Merge branch 'wip-MDL-60742-33' of git://github.com/marinaglancy/moodle into MOODLE_33_STABLE 2018-01-09 09:53:03 +01:00
David Monllao a324b4981a Merge branch 'MDL-60079-33' of https://github.com/nashtechdev01/moodle into MOODLE_33_STABLE 2018-01-09 08:11:01 +01:00
Andrew Nicols 63401025a9 Merge branch 'wip-MDL-60415-33' of git://github.com/abgreeve/moodle into MOODLE_33_STABLE 2018-01-09 14:31:25 +08:00
David Knuplesch e32a370df2 MDL-60415 mod_lti: avoid confusing error-message 2018-01-09 14:03:00 +08:00
Thinh Pham c0f75375fe MDL-60079 User tours: leave unnecessary aria tags in the page 2018-01-09 10:12:19 +07:00
Jun Pataleta 5dc4095720 Merge branch 'MDL-61068-33' of git://github.com/andrewnicols/moodle into MOODLE_33_STABLE 2018-01-09 09:51:41 +08:00
Andrew Nicols 50114457be MDL-61068 mod_forum: Fix neighbour test dates 2018-01-09 09:49:49 +08:00
Eloy Lafuente (stronk7) 7857d77a30 Merge branch 'MDL-60943-m33' of https://github.com/sammarshallou/moodle into MOODLE_33_STABLE 2018-01-09 00:52:41 +01:00
Eloy Lafuente (stronk7) 6a8c7fd988 Merge branch 'MDL-61098-33' of git://github.com/jleyva/moodle into MOODLE_33_STABLE 2018-01-08 21:06:47 +01:00
Eloy Lafuente (stronk7) 1a7ded0892 Merge branch 'MDL-61068-33' of git://github.com/andrewnicols/moodle into MOODLE_33_STABLE 2018-01-08 19:56:42 +01:00
David Monllao 504bde6118 Merge branch 'MDL-61169-33' of git://github.com/andrewnicols/moodle into MOODLE_33_STABLE 2018-01-08 14:59:15 +01:00
Andrew Nicols a38462a3aa MDL-61169 iplookup: Change to github.com IP 2018-01-08 17:16:15 +08:00
Eloy Lafuente (stronk7) 1c6c7ac06d Merge branch 'MDL-61046-33-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_33_STABLE 2018-01-08 10:07:42 +01:00
Andrew Nicols c50907bdfd Merge branch 'MDL-57786-33' of git://github.com/zig-moodle/moodle into MOODLE_33_STABLE 2018-01-08 15:17:53 +08:00
Andrew Nicols 65be0f98d8 Merge branch 'MDL-43042-33' of git://github.com/mihailges/moodle into MOODLE_33_STABLE 2018-01-08 15:13:57 +08:00
Andrew Nicols fa13c8a8cb Merge branch 'MDL-53985-33' of git://github.com/damyon/moodle into MOODLE_33_STABLE 2018-01-08 12:52:48 +08:00
Andrew Nicols ff0edf2d12 MDL-61068 mod_forum: Round timed posts to nearest 60 seconds
This slightly reduces the effectiveness of the DB query cache, but gives
us correct results every time.
2018-01-05 16:43:56 +08:00
Mihail Geshoski ac1af59d9b MDL-43042 lesson: Confusing feedback order in multiple answer questions 2018-01-05 15:25:54 +08:00
sam marshall d51a8d2e40 MDL-60943 core_search: Improve exception for preg_replace errors 2018-01-04 17:29:56 +00:00
Helen Foster a1e72fc747 MDL-61046 lang: Merge English strings from the en_fix language pack
Significant string changes:

* pluginname_desc, enrol_category - improved explanation
* configdeleteunconfirmed, core_admin - setting applies to more than
  just email-based self-registration
2018-01-04 12:09:15 +01:00
David Monllao 591fbbe972 weekly release 3.3.3+ 2018-01-04 11:02:39 +01:00
David Monllao 41e6821e5d Merge branch 'install_33_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_33_STABLE 2018-01-04 11:02:38 +01:00
Marina Glancy 505de3307c MDL-60742 calendar: allow customisation of 12/24h time format strings 2018-01-04 15:15:58 +08:00
Jun Pataleta e326124d9e Merge branch 'MDL-40613-33-ldap' of git://github.com/andrewnicols/moodle into MOODLE_33_STABLE 2018-01-04 14:58:16 +08:00
Andrew Nicols e6f2e62275 MDL-40613 auth_ldap: Call update_user_record on create 2018-01-04 14:40:33 +08:00
Jun Pataleta c823d1c9aa Merge branch 'MDL-40613_33-fix' of git://github.com/markn86/moodle into MOODLE_33_STABLE 2018-01-04 09:58:19 +08:00
AMOS bot d3b89d98f5 Automatically generated installer lang files 2018-01-04 00:07:13 +00:00
Mark Nelson 4c29192189 MDL-40613 auth_ldap: removed usage of profile_load_custom_fields() 2018-01-03 18:08:51 +08:00
AMOS bot 33947383f7 Automatically generated installer lang files 2018-01-03 00:06:35 +00:00
Eloy Lafuente (stronk7) c2155bef19 Merge branch 'MDL-23887-33-2' of https://github.com/snake/moodle into MOODLE_33_STABLE 2018-01-03 00:25:42 +01:00
David Monllao 0829f91214 Merge branch 'MDL-57727-33' of git://github.com/mihailges/moodle into MOODLE_33_STABLE 2018-01-02 12:34:05 +01:00
Jake Dallimore 7ec58e84b0 MDL-23887 database: fix use of deprecated system tables for mssql
Catalog views are available which we should use instead.
2018-01-02 17:21:47 +08:00
Jun Pataleta ae02647dec Merge branch 'MDL-40613_33' of git://github.com/markn86/moodle into MOODLE_33_STABLE 2018-01-02 16:51:10 +08:00
David Monllao cb04f502d5 Merge branch 'MDL-61107_33' of git://github.com/timhunt/moodle into MOODLE_33_STABLE 2018-01-02 08:34:55 +01:00
Zig Tan 13c3219692 MDL-57786 mod_assign: Fix word count for online text submissions 2018-01-02 14:06:01 +08:00
David Monllao 557b880f0b weekly release 3.3.3+ 2017-12-28 12:35:15 +01:00
David Monllao 803a9fdc96 MDL-51089 mod_quiz: Hide first page last node 2017-12-28 11:47:06 +01:00
Eloy Lafuente (stronk7) 659b1ee304 Merge branch 'MDL-60363-33' of https://github.com/Kathrin84/moodle into MOODLE_33_STABLE 2017-12-27 17:57:06 +01:00
David Monllao 22a68d6fac Merge branch 'MDL-51089-33' of https://github.com/lucaboesch/moodle into MOODLE_33_STABLE 2017-12-27 17:57:05 +01:00
David Monllao 3eb97ca783 Merge branch 'MDL-58983-33' of git://github.com/damyon/moodle into MOODLE_33_STABLE 2017-12-27 17:57:05 +01:00
David Monllao 2530725163 Merge branch 'MDL-33886-33' of git://github.com/zig-moodle/moodle into MOODLE_33_STABLE 2017-12-27 17:57:04 +01:00
David Monllao 9308160bce MDL-60439 block_tags: Removing extra var assign 2017-12-27 17:57:04 +01:00
David Monllao 2667898317 Merge branch 'MDL-60439-33' of https://github.com/lucaboesch/moodle into MOODLE_33_STABLE 2017-12-27 17:57:03 +01:00
David Monllao 9525aa62a5 Merge branch 'MDL-60942-33' of git://github.com/ryanwyllie/moodle into MOODLE_33_STABLE 2017-12-27 17:57:03 +01:00
David Monllao a6cf5b5582 Merge branch 'MDL-60359-33' of https://github.com/lucaboesch/moodle into MOODLE_33_STABLE 2017-12-27 17:57:03 +01:00
Eloy Lafuente (stronk7) 02d16e76c3 Merge branch 'MDL-43827-33' of git://github.com/mihailges/moodle into MOODLE_33_STABLE 2017-12-26 00:25:48 +01:00
Tim Hunt 1926647e85 MDL-61107 quiz editing: handle invalid Maximum grade input 2017-12-22 13:36:01 +00:00
Kathrin Osswald f510295159 MDL-60363 conditional activities: Dim the icon also in student's view.
The class dimmed_text would only dim the activity's title and not the icon.
The teacher has both, icon and text, dimmed. So I added the class dimmed
to the class dimmed_text, what dims both elements for the students.
2017-12-22 13:13:00 +01:00
Luca Bösch fc86038b54 MDL-60439 blocks: Tags block title multilang 2017-12-22 09:24:16 +01:00
Luca Bösch e4fd0ad2e3 MDL-51089 quiz: "Add" menu in edit quiz more keyboard accessible 2017-12-22 09:22:55 +01:00
Luca Bösch 64b3116245 MDL-60359 theme_boost: have correct mc question check mark not overlap 2017-12-22 09:20:34 +01:00
Zig Tan 39dc526cd4 MDL-33886 backup: Add backup filename length < 255 char validation 2017-12-22 13:16:43 +08:00
Jun Pataleta f46f4ca56d weekly release 3.3.3+ 2017-12-22 14:42:01 +13:00
Jun Pataleta fd4f1fd78a Merge branch 'install_33_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_33_STABLE 2017-12-22 14:42:00 +13:00
Juan Leyva cde629d3c6 MDL-61098 repository: Retrieve correct context for repo instance
The repository instance was being retrieved without specifying a valid
context that is required in further API checks.
2017-12-21 11:35:18 +01:00
Mihail Geshoski c2ebe33f77 MDL-43827 filepicker: Multiple actions not accessible using keyboard 2017-12-21 14:10:08 +08:00
Eloy Lafuente (stronk7) e807adb913 Merge branch 'MDL-60567-33' of git://github.com/damyon/moodle into MOODLE_33_STABLE 2017-12-19 11:29:54 +01:00
David Monllao af37de609e Merge branch 'MDL-60938-33-2' of git://github.com/junpataleta/moodle into MOODLE_33_STABLE 2017-12-19 07:53:24 +01:00
Mark Nelson 01880d2a9e MDL-40613 auth_ldap: sync user profile fields 2017-12-19 14:17:10 +08:00
David Monllao adb29782e8 Merge branch 'MDL-61045_33' of git://github.com/timhunt/moodle into MOODLE_33_STABLE 2017-12-19 06:44:31 +01:00
Simey Lameze 2be626caaa MDL-57431 mod_quiz: remove unnecessary class from selector 2017-12-19 12:50:13 +08:00
Damyon Wiese 5ecd41650f Merge branch 'MDL-60767-33-3' of https://github.com/snake/moodle into MOODLE_33_STABLE 2017-12-19 11:26:34 +08:00
Damyon Wiese 7f4bc03789 Merge branch 'MDL-59999-33' of git://github.com/mihailges/moodle into MOODLE_33_STABLE 2017-12-19 10:53:07 +08:00
Jun Pataleta d77de7c873 Merge branch 'MDL-59709_33' of https://github.com/marcusfabriczy/moodle into MOODLE_33_STABLE 2017-12-19 13:28:44 +13:00
Eloy Lafuente (stronk7) 409a0ecf2a Merge branch 'MDL-59200-33' of git://github.com/damyon/moodle into MOODLE_33_STABLE 2017-12-19 01:10:50 +01:00
Eloy Lafuente (stronk7) 9fcec4530d Merge branch 'MDL-58888-33' of git://github.com/junpataleta/moodle into MOODLE_33_STABLE 2017-12-19 01:05:09 +01:00
Eloy Lafuente (stronk7) 2489235195 Merge branch 'wip-MDL-60594-33' of git://github.com/marinaglancy/moodle into MOODLE_33_STABLE 2017-12-19 00:46:16 +01:00
Jun Pataleta e16a56ccc5 Merge branch 'm33_MDL-60793_Mod_Chat_Reserved_Words_In_MySQL8p0p3_And_Above' of https://github.com/scara/moodle into MOODLE_33_STABLE 2017-12-19 12:11:41 +13:00
David Monllao 9e3b6c626c Merge branch 'MDL-60653-33' of git://github.com/rezaies/moodle into MOODLE_33_STABLE 2017-12-18 17:59:55 +01:00
David Monllao 00f88c287d Merge branch 'MDL-61042-33' of git://github.com/junpataleta/moodle into MOODLE_33_STABLE 2017-12-18 17:27:01 +01:00
David Monllao 23d7a70ef3 Merge branch 'MDL-61040-33' of git://github.com/junpataleta/moodle into MOODLE_33_STABLE 2017-12-18 17:25:18 +01:00
Eloy Lafuente (stronk7) 652948bd4b Merge branch 'wip-MDL-60161-33' of git://github.com/abgreeve/moodle into MOODLE_33_STABLE 2017-12-18 16:12:05 +01:00
Matteo Scaramuccia 70a713c3d8 MDL-60793 mod_chat: Renamed 'system' into 'issystem'
'system' is now a reserved word in MySQL 8.0.3+.
2017-12-18 15:28:23 +01:00
David Monllao e4b5f17a93 Merge branch 'MDL-31521-33' of https://github.com/lucaboesch/moodle into MOODLE_33_STABLE 2017-12-18 13:14:39 +01:00
Eloy Lafuente (stronk7) 70611182ec Merge branch 'MDL-56932-33' of git://github.com/lameze/moodle into MOODLE_33_STABLE 2017-12-18 12:16:57 +01:00
Damyon Wiese 660f2f2b70 MDL-61022 recyclebin: Verify groups are restored 2017-12-18 10:22:17 +01:00
David Monllao 847250b4d5 Merge branch 'wip-MDL-52100-33' of git://github.com/abgreeve/moodle into MOODLE_33_STABLE 2017-12-18 10:08:28 +01:00
Andrew Nicols ccd3ab300d Merge branch 'MDL-42676-33' of git://github.com/zig-moodle/moodle into MOODLE_33_STABLE 2017-12-18 15:38:21 +08:00
Adrian Greeve 304b80c734 MDL-52100 filelib: Update to unit tests for maxbytes. 2017-12-18 13:18:16 +08:00
Adrian Greeve 74798df3e9 MDL-52100 filelib: Files that are oversized are checked with user.
Files that are oversized could have been uploaded by a user who
can ignore the file size limits. These files should not be deleted
in these situations.
2017-12-18 13:18:11 +08:00
Damyon Wiese 6503626135 Merge branch 'MDL-34389-33' of https://github.com/lucaboesch/moodle into MOODLE_33_STABLE 2017-12-18 13:00:31 +08:00
Damyon Wiese b62d6b901a Merge branch 'MDL-57431-33' of git://github.com/lameze/moodle into MOODLE_33_STABLE 2017-12-18 12:54:26 +08:00
Damyon Wiese 511a150aa0 Merge branch 'MDL-54967-33' of git://github.com/zig-moodle/moodle into MOODLE_33_STABLE 2017-12-18 12:48:36 +08:00
Damyon Wiese 4fca4d4e87 Merge branch 'wip-MDL-49995-33' of git://github.com/marinaglancy/moodle into MOODLE_33_STABLE 2017-12-18 12:01:50 +08:00
Andrew Nicols 1c216b13e4 Merge branch 'MDL-57564-33-courseorder' of git://github.com/mudrd8mz/moodle into MOODLE_33_STABLE 2017-12-18 11:25:10 +08:00
Jake Dallimore d7a7ef5c44 MDL-60767 admin: fix usage of admin_write_settings
Make sure we always checks for failed validation, before redirecting.
A positive return value does not signal that all settings were able
to be written, only that at least one was - errors still need to be
checked!
2017-12-18 09:27:38 +08:00
Mihail Geshoski c426a1e2f7 MDL-59999 lesson: Boost grade essays page not indicating grade status
AMOS BEGIN
    CPY [graded,assign],[graded,lesson]
    CPY [notgraded,assign],[notgraded,lesson]
AMOS END
2017-12-18 09:19:10 +08:00
AMOS bot 761e8a442f Automatically generated installer lang files 2017-12-18 00:06:29 +00:00
Tim Hunt e15be87a98 MDL-61045 quiz settings: add back missing disabledIf
This got broken in Moodle 2.1 by MDL-20636.
2017-12-15 13:15:19 +00:00
Jun Pataleta 9a2441ca48 MDL-61042 mod_lesson: Initialise pageid variable 2017-12-15 17:37:32 +13:00
Damyon Wiese 036b10b783 MDL-53985 assign: Do not remove annotations
When an assignment submission is reverted to a draft, the timemodified on
the submission should not be modified. Changing the timemodified causes the
editpdf code to assume the pdf is stale, and forces all annotations to be removed.
2017-12-15 11:52:37 +08:00
Jun Pataleta 2444915544 MDL-58888 mod_choice: Sort choice_get_my_response() results by optionid 2017-12-15 15:56:19 +13:00
Jun Pataleta a6870770c3 MDL-58888 mod_choice: Verify sorting when testing multiple selections
* Improve test_choice_get_my_response() to verify the sorting of the
  responses returned by choice_get_my_response().
* Fix correct usage of choice_get_my_response().
2017-12-15 15:56:18 +13:00
Zig Tan 6acae651b3 MDL-54967 backup: Fix IMS CC import URL decoding for XML format
HTML encoding special characters to avoid XML compatibility issues during
Course backup restoration and avoid double encoding.
2017-12-15 09:47:18 +08:00
Jun Pataleta 2d9efe5283 MDL-61040 mod_choice: Save my choice button needs some space 2017-12-15 13:07:23 +13:00
Jun Pataleta 068935011b MDL-60938 mod_choice: Fix rendering of users for choice results 2017-12-15 12:52:45 +13:00
Matteo Scaramuccia 4e00702953 MDL-60793 core_ddl: Added the new MySQL 8 reserved words 2017-12-14 23:04:11 +01:00
Luca Bösch 020fd88e2e MDL-31521 questions: Allow more than one unit with multiplier equal to 1 2017-12-14 22:33:44 +01:00
Eloy Lafuente (stronk7) fb20acf02d weekly release 3.3.3+ 2017-12-14 14:47:41 +01:00
Eloy Lafuente (stronk7) b2b940caae Merge branch 'install_33_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_33_STABLE 2017-12-14 14:47:40 +01:00
AMOS bot ab578c4b48 Automatically generated installer lang files 2017-12-14 00:06:21 +00:00
Simey Lameze b571d8b51f MDL-56932 theme_boost: fix quiz max mark input height 2017-12-13 11:49:03 +08:00
Adrian Greeve 2f81f23e3c MDL-60161 filelib: Unit test for duplicate curl headers. 2017-12-13 11:15:05 +08:00
Carson Tam d02e847c3f MDL-60161 class curl in filelib: Cleaned up doc block. 2017-12-13 11:15:00 +08:00
Carson Tam aab559c464 MDL-60161 class curl in filelib: Avoid duplicate params in http header 2017-12-13 11:14:55 +08:00
Jun Pataleta 457d29926f Merge branch 'MDL-58200-33' of git://github.com/damyon/moodle into MOODLE_33_STABLE 2017-12-12 19:13:16 +13:00
Jun Pataleta 7660a50369 Merge branch 'MDL-59970-33' of git://github.com/damyon/moodle into MOODLE_33_STABLE 2017-12-12 18:52:34 +13:00
Andrew Nicols 35b5315034 Merge branch 'M3.3-MDL-59866' of https://github.com/marcusboon/moodle into MOODLE_33_STABLE 2017-12-12 13:48:29 +08:00
Andrew Nicols 74cc4d6acb Merge branch 'wip-MDL-56864-33' of git://github.com/marinaglancy/moodle into MOODLE_33_STABLE 2017-12-12 13:40:28 +08:00
Marcus Boon 98bd6c5273 MDL-59866 session: Add retry for redis sessions
There is an edge case whereby redis will fail
to accept connections on the first try but
retrying the connection seems to make it work

Included in this commit:
* Retry functionality in the session init
2017-12-12 14:51:20 +10:00
Damyon Wiese aaa3a28e03 Merge branch 'MDL-44660-33' of https://github.com/lucaboesch/moodle into MOODLE_33_STABLE 2017-12-12 12:51:07 +08:00
Tyler Bannister 1ab916014f MDL-60653 Navigation: Fixed loose string comparison.
The previous comparison would sometimes evaluate to true when the
navigation key was not a string.
2017-12-12 12:35:07 +08:00
Damyon Wiese 6a02fd458f Merge branch 'MDL-58058-33' of git://github.com/lameze/moodle into MOODLE_33_STABLE 2017-12-12 12:15:05 +08:00
Damyon Wiese 9f35372c0c Merge branch 'MDL-60945-m33' of https://github.com/NeillM/moodle into MOODLE_33_STABLE 2017-12-12 11:36:00 +08:00
Damyon Wiese 042077dd47 Merge branch 'MDL-60965-33' of git://github.com/andrewnicols/moodle into MOODLE_33_STABLE 2017-12-12 11:16:00 +08:00
Damyon Wiese c31343bf78 Merge branch 'MDL-60969_33' of git://github.com/markn86/moodle into MOODLE_33_STABLE 2017-12-12 11:08:15 +08:00
Damyon Wiese 3baef4ab41 Merge branch 'MDL-52538-33' of git://github.com/mihailges/moodle into MOODLE_33_STABLE 2017-12-12 10:40:54 +08:00
Damyon Wiese 25666e5ff5 Merge branch 'MDL-44667-33' of https://github.com/snake/moodle into MOODLE_33_STABLE 2017-12-12 10:26:30 +08:00
Damyon Wiese ba68a016de Merge branch 'MDL-60968-33' of git://github.com/lameze/moodle into MOODLE_33_STABLE 2017-12-12 10:19:41 +08:00
Mathew May 53b2f1cf4a MDL-57431 mod_quiz: Quiz editing help icon fix 2017-12-12 09:57:37 +08:00
Matt Clarkson ec85b1eb56 MDL-60976 dml: Optimise replace_all_text()
Avoid updating fields that do not match the search string.
2017-12-12 09:57:23 +08:00
Mihail Geshoski e96e4d5a5b MDL-57727 reports: Activity completion report sorting problem 2017-12-12 09:56:00 +08:00
Jake Dallimore b01791c076 MDL-44667 database: fix incorrect usages of $DB->get_field
Some places were passing 5 params, meaning the strictness param was
lost. This fixes those usages.
2017-12-12 09:53:02 +08:00
Brendan Heywood f93839e2ca MDL-60968 auth: Allow more flexibility with mapping attributes 2017-12-12 09:38:10 +08:00
Damyon Wiese c45ca633b7 Merge branch 'MDL-60041-m33' of https://github.com/NeillM/moodle into MOODLE_33_STABLE 2017-12-12 09:22:25 +08:00
Mihail Geshoski fe94c07971 MDL-52538 lesson: Grade info displayed while ongoing score disabled 2017-12-12 09:06:59 +08:00
Zig Tan 63d3298c0b MDL-42676 mod_assign: Display message fix when using grade override
Logic fix in mod_assign locallib.php to correctly set the submissionlockedstatus,
and added associated unit test in test_grade_submission_override()
2017-12-12 09:05:45 +08:00
Damyon Wiese 318697f600 Merge branch 'MDL-54021-33' of git://github.com/mihailges/moodle into MOODLE_33_STABLE 2017-12-12 08:59:46 +08:00
Damyon Wiese c00848dbf2 Merge branch 'MDL-40790-33' of git://github.com/mihailges/moodle into MOODLE_33_STABLE
Conflicts:
	theme/boost/scss/moodle/modules.scss
2017-12-11 16:57:21 +08:00
Damyon Wiese 5fd29e79dc Merge branch 'MDL-56197-33' of git://github.com/mihailges/moodle into MOODLE_33_STABLE 2017-12-11 16:48:19 +08:00
Neill Magill 8794e3392d MDL-60041 dml: MOODLELIB sql file must have Unix line endings
If the file does not have Unix line endings then the regular expression
in oci_native_moodle_database::attempt_oci_package_install() does
not split it correctly.

This leads to an invalid package being created in Oracle.

The .gitattribute file changes for oci_native_moodle_package.sql
force it to have Unix style line endings when the branch is checked
out and the file does not already exist.

The file has been modified so that the Unix style line endings are
applied even if the file already exists, for example when pulling in
this change to an existing branch.
2017-12-11 08:44:46 +00:00
Neill Magill 3cbea698c3 MDL-60945 Web services: Too many progress records retrieved
The core_completion_get_activities_completion_status was getting the
progress for all users on the course called, and then discarding all
the records but one.

This change ensures that only progress for the user we are interested in
is retrieved from the database.

This has a side benefit of removing a full table scan from the query
finding the users inside the get_progress_all() method.
2017-12-11 08:44:14 +00:00
Mihail Geshoski 384947bab2 MDL-56197 lesson: Multichoice answers not on same line as radio button 2017-12-11 15:54:29 +08:00
Andrew Nicols 5fea116586 Merge branch 'MDL-58272-33-2' of https://github.com/snake/moodle into MOODLE_33_STABLE 2017-12-11 15:02:44 +08:00
Marina Glancy 9ce791b51e MDL-60594 xmlrpc: wrapper for buggy xmlrpc_decode 2017-12-11 14:26:55 +08:00
Damyon Wiese 9fd5ed6217 Merge branch 'wip-MDL-45500-33' of git://github.com/marinaglancy/moodle into MOODLE_33_STABLE 2017-12-11 13:14:39 +08:00
Damyon Wiese 402d910a60 Merge branch 'MDL-54106-33' of https://github.com/lucaboesch/moodle into MOODLE_33_STABLE 2017-12-11 11:38:28 +08:00
Marcus Fabriczy 78c66df3e5 MDL-59709 mod_assign: Export to portfolio button not working
Changed the button to a text link
2017-12-10 13:49:16 +10:30
Luca Bösch 7391e4a459 MDL-44660 grade: Typos @package core_grade instead of core_grades 2017-12-08 14:21:23 +01:00
Luca Bösch d1e03e531d MDL-54106 task: Deleting unconfirmed users after $CFG->deleteunconfirmed 2017-12-08 14:12:42 +01:00
Simey Lameze 3eba4443a1 MDL-58058 competency: replace other sortorder usages 2017-12-08 16:01:22 +08:00
Frederic Massart a34f98e166 MDL-58058 competency: Allow unspecified sortorder for new competencies 2017-12-08 16:01:22 +08:00
Mihail Geshoski df6bdbcd46 MDL-40790 lesson: Lesson content button runs off the edge of the page 2017-12-08 09:58:55 +08:00
Mihail Geshoski c709d42c06 MDL-54021 blocks: Course completion block lang problem 2017-12-08 09:30:28 +08:00
Jake Dallimore c13b3ca26b MDL-58272 core_files: get converters from file extension not mimetype 2017-12-08 09:10:48 +08:00
AMOS bot 88ed1a48fd Automatically generated installer lang files 2017-12-08 00:10:02 +00:00
Jun Pataleta 1402bb28bc weekly release 3.3.3+ 2017-12-08 09:10:03 +13:00
Mark Nelson ec1aa43448 MDL-60969 auth_ldap: replace hardcoded strings in config settings 2017-12-07 14:04:19 +08:00
David Mudrák 3b70d720ec MDL-57564 enrol: Fix the course ordering on the dashboard
The list of courses displayed at the user's dashboard - course overview
block, had the sorting hard-coded to order by fullname. This did not
respect the site setting "navsortmycoursessort" and led to inconsistent
behaviour with "My courses" list in the navigation.
2017-12-06 23:48:10 +01:00
Andrew Nicols 10d22c10fc Merge branch 'MDL-59159_33' of git://github.com/stronk7/moodle into MOODLE_33_STABLE 2017-12-06 10:05:22 +08:00
Jun Pataleta a65c67a7b0 Merge branch 'MDL-32350-33' of https://github.com/lucaboesch/moodle into MOODLE_33_STABLE 2017-12-06 11:30:20 +13:00
Luca Bösch 2f7ef500a4 MDL-32350 admin: Sort users by country ASC and DESC 2017-12-05 07:24:26 +01:00
Jun Pataleta 157981c24b Merge branch 'wip-MDL-60926-33' of git://github.com/marinaglancy/moodle into MOODLE_33_STABLE 2017-12-05 19:03:22 +13:00
David Herney 5cb58b2db4 MDL-60443 dataformat lib: Change a wrong variable name
The variable $type really is $dataformat. I have changed it for
prevent the error and show a correct error message.
2017-12-05 13:53:08 +08:00
Jun Pataleta 608cce8d16 Merge branch 'wip-MDL-34161-33' of git://github.com/marinaglancy/moodle into MOODLE_33_STABLE 2017-12-05 17:59:40 +13:00
Andrew Nicols b74d94b85e Merge branch 'MDL-60801_33' of https://github.com/andrewhancox/moodle into MOODLE_33_STABLE 2017-12-05 12:54:32 +08:00
Andrew Nicols fdea53a86b Merge branch 'MDL-60899-33' of git://github.com/damyon/moodle into MOODLE_33_STABLE 2017-12-05 11:55:33 +08:00
Andrew Nicols 4ff3d4e309 MDL-60965 behat: Correct strlen use 2017-12-05 11:19:30 +08:00
Andrew Nicols b448376bea Merge branch 'MDL-47114-33' of git://github.com/rezaies/moodle into MOODLE_33_STABLE 2017-12-05 09:53:33 +08:00
Andrew Nicols d6d0e0f4be Merge branch 'wip-MDL-37757-33' of git://github.com/abgreeve/moodle into MOODLE_33_STABLE 2017-12-05 09:45:36 +08:00
Damyon Wiese 9a32a6d629 Merge branch 'MDL-60219-33' of https://github.com/abias/moodle into MOODLE_33_STABLE 2017-12-04 16:29:05 +08:00
Marina Glancy 8d41ccfbe1 MDL-34161 mod_lti: backup and restore of submissions 2017-12-04 15:05:48 +08:00
Marina Glancy ac1f4d9633 MDL-34161 mod_lti: backup/restore of lti types
Only course tools are backed up, site tools and registrations
can be matched by id if they are restored to the same site only.

For predefined course tools the secret is backed up encrypted
and can be restored on the same site only.
2017-12-04 15:05:47 +08:00
Tim Lock 4826b9d454 MDL-34161 mod_lti: Added Behat tests 2017-12-04 15:05:47 +08:00
Gregory Faller 07cb9ff078 MDL-34161 mod_lti: Add support for restoring site tool 2017-12-04 15:05:47 +08:00
Marina Glancy 3f79afbb78 MDL-60926 auth: do not map very long profile fields 2017-12-04 09:28:38 +08:00
Eloy Lafuente (stronk7) 540f98ac7e MDL-59159 environment: 3.1 (LTS) required 2017-12-04 02:04:36 +01:00
Eloy Lafuente (stronk7) d6e92ad815 MDL-59159 environment: 3.5 base information
This is a direct copy of the 3.4 branch to
have changes under control easier in next commits.
2017-12-04 02:04:36 +01:00
Jun Pataleta cc34be6fae Merge branch 'MDL-60914_33' of git://github.com/markn86/moodle into MOODLE_33_STABLE 2017-12-04 12:46:00 +13:00
Shamim Rezaie 1f05e1459a MDL-47114 core: Improved function description 2017-12-02 07:44:14 +08:00
Ryan Wyllie 2b460b0fc8 MDL-60942 filters: include filter in format_string cache key 2017-12-01 06:52:00 +00:00
Eloy Lafuente (stronk7) cb9d984b86 weekly release 3.3.3+ 2017-11-30 17:05:19 +01:00
Alexander Bias 11af3ac71d MDL-60219 lti: Replace pagelayout frametop with incourse 2017-11-29 09:55:36 +01:00
Damyon Wiese 1f446a04c2 MDL-58200 competencies: Student can view linked courses 2017-11-29 16:07:46 +08:00
Jun Pataleta 39237cf346 Merge branch 'wip-MDL-45068-33-fix' of
https://github.com/marinaglancy/moodle into MOODLE_33_STABLE
2017-11-29 16:59:54 +13:00
Marina Glancy 60770d10f9 MDL-45068 groups: corrected check for idnumber '0' 2017-11-29 11:54:31 +08:00
Eloy Lafuente (stronk7) 108411af39 Merge branch 'wip-MDL-60591-33' of git://github.com/marinaglancy/moodle into MOODLE_33_STABLE 2017-11-28 22:38:50 +01:00
Eloy Lafuente (stronk7) 3104923f6b Merge branch 'MDL-60738-33' of git://github.com/jleyva/moodle into MOODLE_33_STABLE 2017-11-28 21:00:00 +01:00
Eloy Lafuente (stronk7) 7edb9a48e0 Merge branch 'MDL-60838-m33' of https://github.com/sammarshallou/moodle into MOODLE_33_STABLE 2017-11-28 20:48:38 +01:00
Damyon Wiese d5b71904b0 MDL-58983 assign: Hide grade button if no cap
If the current user cannot grade students, don't show them the button.
2017-11-28 15:48:57 +08:00
Marina Glancy 8ac72824e1 MDL-49995 files: delete old file when overwriting 2017-11-28 15:03:40 +08:00
Damyon Wiese 7b3832899c MDL-59200 assign: add feedback when grade locked
We are including a hidden field when the grade is locked in the gradebook for a student. This field fails validation, so
the form cannot be submitted.
2017-11-28 14:37:38 +08:00
Damyon Wiese 0c4f7b3b1b MDL-60899 block_lp: no permissions - empty block
Show an empty block if the current user does not have the capability to see any plans.
2017-11-28 14:33:21 +08:00
Damyon Wiese 5dc5337f36 Merge branch 'MDL-53004-33' of https://github.com/lucaboesch/moodle into MOODLE_33_STABLE
Conflicts:
	mod/assign/styles.css
2017-11-28 12:53:00 +08:00
Marina Glancy 8b283a6cf5 MDL-45500 gradingform: allow plugin uninstall 2017-11-28 12:28:04 +08:00
Jun Pataleta b0734fa5ee Merge branch 'MDL-46768-33' of git://github.com/sarjona/moodle into MOODLE_33_STABLE 2017-11-28 17:19:13 +13:00
Damyon Wiese 9e5c6b8d3d Merge branch 'MDL-24678-MOODLE_33-chat_get_latest_message' of https://github.com/bozoh/moodle into MOODLE_33_STABLE 2017-11-28 12:15:13 +08:00
Damyon Wiese 9962da5423 Merge branch 'MDL-60669-33' of git://github.com/tobiasreischmann/moodle into MOODLE_33_STABLE 2017-11-28 12:07:15 +08:00
Mark Nelson bae7a3b909 MDL-60914 mod_lti: ensure grade_update() is defined during upgrade 2017-11-28 11:38:19 +08:00
Eloy Lafuente (stronk7) 6103daf4b0 Merge branch 'MDL-60249-33' of git://github.com/damyon/moodle into MOODLE_33_STABLE 2017-11-28 00:49:06 +01:00
Tobias Reischmann 702605b2c9 MDL-60669 forum: Added duplicate check for restoring forum subscriptions
Before MDL-59854 it was possible to have duplicate forum subscriptions.
Trying to import backups created from back then, caused a DB exception
due to unqiue key constraints. Now only one of multiple identical forum
subscritions is restored.
2017-11-27 10:53:25 +01:00
Damyon Wiese f5e3d2fe72 Merge branch 'MDL-60188-33' of git://github.com/rezaies/moodle into MOODLE_33_STABLE 2017-11-27 16:01:37 +08:00
Jun Pataleta 4965564ef4 Merge branch 'MDL-57569-33' of git://github.com/sarjona/moodle into MOODLE_33_STABLE 2017-11-27 19:44:07 +13:00
Jun Pataleta 9f65a1fb64 Merge branch 'wip-MDL-45068-33' of git://github.com/marinaglancy/moodle into MOODLE_33_STABLE 2017-11-27 19:36:24 +13:00
Marina Glancy 907832b43b MDL-60591 mod_forum: inline attachments are not displayed in plain text 2017-11-27 14:29:24 +08:00
Marina Glancy a4c2795681 MDL-45068 groups: fixes to group import
- If 'coursename' is specified in the CSV it should match the course short name - thanks Yusuf Yılmaz for the patch
- If 'idnumber' is specified but 'groupidnumber' is not, idnumber should be used for matching the course idnumber only
- If 'groupingname' is not specified, there should be no notices (regression from MDL-42514)
- If 'coursename' or 'idnumber' column is present, it can contain empty values in some/all lines
2017-11-27 14:26:06 +08:00
Shamim Rezaie 4d7d71fb37 MDL-60188 groups: cache user's groups and groupings
The function groups_get_user_groups is called too often both before rendering the page and after the page is rendered (using ajax).
The function was executing a query joining 3 tables in each call. The plementation of the function has now modified to store the
query result in a request cache.
2017-11-27 10:39:15 +08:00
Jun Pataleta 813baed84d Merge branch 'MDL-58887-33' of git://github.com/ryanwyllie/moodle into MOODLE_33_STABLE 2017-11-27 15:06:19 +13:00
Jake Dallimore 319e12ba83 Merge branch 'MDL-27230-33' of https://github.com/lucaboesch/moodle into MOODLE_33_STABLE 2017-11-27 09:44:49 +08:00
Andrew Hancox 33c67b74aa MDL-60801 tool_uploaduser: Fix issue with defaults being ignored 2017-11-25 11:40:46 +00:00
Carlos Alexandre S. da Fonseca d36fdb9657 MDL-24678 mod_chat: Fixed race condition on chat module 2017-11-24 10:30:33 -02:00
sam marshall de874ead39 MDL-60838 core_search: File upload does not honour timeout 2017-11-24 11:04:10 +00:00
Sara Arjona cab3b03540 MDL-57569 core_files: Fix to let show generated f3 image 2017-11-24 11:53:47 +01:00
Sara Arjona 462785cb74 MDL-46768 core_badges: changed badge name type from FILE to TEXT 2017-11-24 11:40:11 +01:00
Luca Bösch 2d3c247d4d MDL-34389 course: switch to subcategory w/ course:changecategory perms 2017-11-23 16:50:48 +01:00
Luca Bösch 542bd70b90 MDL-53004 assignment: Separate label and pulldown in grading (Clean) 2017-11-23 16:41:56 +01:00
Luca Bösch 29372f84cb MDL-27230 quiz: remove and update group overrides in calendar 2017-11-23 16:41:50 +01:00
David Monllao c099963697 weekly release 3.3.3+ 2017-11-23 13:35:16 +01:00
David Monllao f6a3bbe132 Merge branch 'install_33_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_33_STABLE 2017-11-23 13:35:15 +01:00
Marina Glancy 96a77cf0b1 MDL-27886 backup: When setting is unlocked set it to original value 2017-11-23 12:30:34 +08:00
Damyon Wiese cd54b73299 MDL-60249 assign: resize quickgrade textareas
The Bootstrap CSS reset prevents horizontal resizing of textareas. We want to allow it in the quickgrading ui.
2017-11-23 12:18:58 +08:00
Jake Dallimore 657cb6b451 Merge branch 'MDL-60831-33' of git://github.com/ankitagarwal/moodle into MOODLE_33_STABLE 2017-11-22 13:27:31 +01:00
Jun Pataleta 04be8aa428 Merge branch 'wip-MDL-60546-33' of git://github.com/abgreeve/moodle into MOODLE_33_STABLE 2017-11-22 13:27:31 +01:00
Jun Pataleta 2f71de8e90 Merge branch 'MDL-60526-33-fix1' of http://github.com/damyon/moodle into MOODLE_33_STABLE 2017-11-22 13:27:30 +01:00
David Monllao 6b38456cda MDL-59512 version: Following 2 digits scheme 2017-11-22 13:27:30 +01:00
Damyon Wiese 6f0e8dbaa5 MDL-60526 forms: Button elements should have type
The mform "buttons" should be of type "button", instead it's not specified so they get
the default of "submit". This is causing behat fails.
2017-11-22 13:27:30 +01:00
David Monllao 275fbca097 Merge branch 'MDL-59512-33' of git://github.com/Dagefoerde/moodle into MOODLE_33_STABLE 2017-11-22 13:27:29 +01:00
Jun Pataleta 5ef58abac3 Merge branch 'mdl58817-moodle33' of https://github.com/tlock/moodle into MOODLE_33_STABLE 2017-11-22 13:27:29 +01:00
Jun Pataleta 8854864605 Merge branch 'MDL-60637-33' of git://github.com/lameze/moodle into MOODLE_33_STABLE 2017-11-22 13:27:28 +01:00
Damyon Wiese cc37bd164f MDL-59970 competencies: performance
Remove useless get_records call in get_least_proficient_competencies_for_course function.
On big sites this would cause huge memory usage.
2017-11-22 15:37:22 +08:00
Ankit Agarwal e8605c6514 MDL-60831 search: add BS classes to block elements 2017-11-22 12:28:33 +05:30
Adrian Greeve 03c8a58b59 MDL-60546 mod_choice: Update to select all functionality. 2017-11-22 14:17:17 +08:00
Marcus Fabriczy ad95dcaccb MDL-60546 mod_choice: Fixed select all functionality
Fixed the functionality which ticks or unticks all checkboxes when
clicking the Select all or Deselect all elements when viewing the
responses.

Caused by deprecating checkall and checknone functions in
MDL-57490.
2017-11-22 14:17:08 +08:00
Ryan Wyllie 25bb7e4a12 MDL-58887 core: fix default title for action menu
Thanks to Michelle Melton <meltonml@appstate.edu> for the original
version of this patch.
2017-11-22 01:38:52 +00:00
AMOS bot 2ace718489 Automatically generated installer lang files 2017-11-22 00:06:05 +00:00
Marina Glancy 3eeca45c23 MDL-56864 forms: allow to remove last tag with forced standard tags 2017-11-21 15:29:08 +08:00
Marina Glancy 58394a6223 MDL-56864 forms: boost templates don't allow remove last tag 2017-11-21 15:29:08 +08:00
Simey Lameze 6c364342cf MDL-60637 core_group: fix unit tests failures 2017-11-21 11:21:50 +08:00
Simey Lameze 986e88bce3 MDL-60637 group: remove useless id number validation on web services 2017-11-21 11:21:50 +08:00
David Monllao fec3b64a4f Merge branch 'MDL-60526-33' of git://github.com/damyon/moodle into MOODLE_33_STABLE 2017-11-20 13:44:10 +01:00
David Monllao 14120d413e Merge branch 'MDL-60436-m33' of https://github.com/NeillM/moodle into MOODLE_33_STABLE 2017-11-20 13:26:17 +01:00
David Monllao 5fe7cae927 Merge branch 'MDL-56253-33' of https://github.com/lucaboesch/moodle into MOODLE_33_STABLE 2017-11-20 12:55:45 +01:00
Juan Leyva dbe472f58b MDL-60738 webservice: Clean theme and lang properly
Sometimes the "theme" and "lang" fields in the user and course tables
in the database are set to incorrect values (uninstalled or
non-existent themes and language packs).
This makes Web Services functions to fail because the WS server
validate the returned data using the validate_param function that clean
parameters.
2017-11-20 09:38:15 +01:00
Jun Pataleta 8156736712 Merge branch 'MDL-60187_33' of git://github.com/markn86/moodle into MOODLE_33_STABLE 2017-11-20 21:34:05 +13:00
Damyon Wiese 5e5283f9f3 Merge branch 'MDL-60810_33' of git://github.com/markn86/moodle into MOODLE_33_STABLE 2017-11-20 15:59:27 +08:00
Damyon Wiese ce694bbb81 Merge branch 'MDL-60809-33' of git://git.cameron1729.xyz/moodle into MOODLE_33_STABLE 2017-11-20 15:32:05 +08:00
Jakob Ackermann ff6faa59eb MDL-60187 mod_lti: Do not create a grade item when grades are disabled.
If the privacy option "Accept grades from the tool" is disabled, the
module should not appear in the gradebook when edited inline or when
recover grades is running during enrolment.
2017-11-20 14:05:02 +08:00
Luca Bösch 0cca93b3b2 MDL-56253 grade: have coursemodule name pass filters. 2017-11-20 06:38:33 +01:00
Damyon Wiese 67def8d76b Merge branch 'MDL-27886-33' of git://github.com/tobiasreischmann/moodle into MOODLE_33_STABLE 2017-11-20 13:27:03 +08:00
Jun Pataleta de935c233b Merge branch 'MOODLE_33_STABLE_MDL-60253' of https://github.com/CengageEng/moodle into MOODLE_33_STABLE 2017-11-20 13:22:07 +13:00
Jun Pataleta 0a45b8eba3 Merge branch 'MDL-55808_33' of git://github.com/juancs/moodle into MOODLE_33_STABLE 2017-11-20 10:37:31 +13:00
Neill Magill d10e946d7b MDL-60436 blocks: Unit test for dashboard block positioning 2017-11-17 14:14:24 +00:00
Neill Magill 479e718dc3 MDL-60436 blocks: Improve performance of block loading 2017-11-17 14:13:30 +00:00
yair.spielmann 0bbd7b8291 MDL-59512 tool_oauth2: add option for basic authentication 2017-11-17 10:23:19 +01:00
Damyon Wiese 68791e3d6e Merge branch 'MDL-60773-33' of https://github.com/snake/moodle into MOODLE_33_STABLE 2017-11-17 14:12:44 +08:00
Andrew Nicols 65c7d85d30 MDL-60773 core: Add pendingJS checks for autocomplete interactions 2017-11-17 14:01:02 +08:00
Adrian Greeve a48f144dc1 MDL-37757 repositories: Deleting a repository deletes files.
If the user decides to remove a repository all of the linked
files are now deleted along with file references. This was causing
problems such as the course page displaying an error with no recourse
to fix the problem.
2017-11-16 15:01:02 +08:00
Cameron Ball 1174beee83 MDL-60809 xmlrpc: Include filelib when making xmlrpc call 2017-11-16 14:48:40 +08:00
Jake Dallimore 2a626230ee weekly release 3.3.3+ 2017-11-16 11:13:09 +08:00
David Monllao ce5fe979f8 Merge branch 'MDL-60789-33' of git://github.com/sarjona/moodle into MOODLE_33_STABLE 2017-11-15 10:36:58 +01:00
Damyon Wiese be05d8c3f0 Merge branch 'wip-MDL-59876-33' of git://github.com/abgreeve/moodle into MOODLE_33_STABLE 2017-11-15 10:36:58 +01:00
Mark Nelson ad904c2827 MDL-60810 auth_db: removed rubbish content in string 2017-11-15 15:01:40 +08:00
Damyon Wiese 087b392b04 MDL-60526 forms: Prevent duplicate type attributes
The exporter for mform elements does not skip "type" (which is included as a separate value).
2017-11-15 11:54:42 +08:00
Adrian Greeve 5a6b7338c3 MDL-59876 core_user: Add required library for function.
The external service create_users has a function call to
useredit_update_user_preference() that requires editlib.php
2017-11-15 11:50:23 +08:00
Damyon Wiese d60d047a96 Merge branch 'MDL-60675-33' of git://github.com/mihailges/moodle into MOODLE_33_STABLE 2017-11-14 17:06:45 +08:00
Mihail Geshoski 30161129f5 MDL-60675 analytics: Apply strict comparison check 2017-11-14 16:33:34 +08:00
Sara Arjona edd820115e MDL-60789 workshop: Check title submission maxlength 2017-11-14 09:00:10 +01:00
Jake Dallimore c5430a26cf Merge branch 'MDL-60741_33' of git://github.com/timhunt/moodle into MOODLE_33_STABLE 2017-11-14 15:29:12 +08:00
Jun Pataleta 89401022c3 Merge branch 'm33_MDL-59099_MySQL8_InnoDB_Params_Removed' of https://github.com/scara/moodle into MOODLE_33_STABLE 2017-11-14 12:23:50 +13:00
Damyon Wiese f8cecf2031 Merge branch 'MDL-60693_33-backup-multilang-activities' of https://github.com/lucaboesch/moodle into MOODLE_33_STABLE 2017-11-13 14:38:49 +08:00
Damyon Wiese 697d94550c Merge branch 'MDL-60675-33' of git://github.com/mihailges/moodle into MOODLE_33_STABLE 2017-11-13 14:12:09 +08:00
Damyon Wiese 487b237684 Merge branch 'MDL-60355-33' of git://github.com/jleyva/moodle into MOODLE_33_STABLE 2017-11-13 13:30:42 +08:00
Juan Leyva 7444926f37 MDL-59876 webservice: Fix the user preference name field type
Web Services from user and enrol components has been updated to change
the user preference name field type from PARAM_ALPHANUMEXT to
PARAM_RAW.
The old type was not matching the core functionality.
2017-11-13 11:09:12 +08:00
Tim Lock d1c7b42f57 MDL-58817 mod_lti: cartridge: maintain custom icons 2017-11-13 10:17:10 +10:30
Luca Bösch 6e270daa1d MDL-60693 backup: Use multilang with course activities
On backup and restore, activities are shown after passing format_string,
supporting multilang.
2017-11-12 14:54:01 +01:00
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
Mihail Geshoski 6b4810bdf9 MDL-60675 analytics: Error when selecting invalid insight 2017-11-10 10:48:50 +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 &nbsp; 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
Tim Hunt b9ab4a82e5 MDL-60741 purgecaches: did not correctly setup the admin page
Note that, admin_externalpage_setup does the right capability check.
2017-11-08 14:31:48 +00: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
Tobias Reischmann e185931893 MDL-27886 backup: Decision if a setting is fixed based on level
Previously, when a during backup/restore the "Schema"-stage is loaded,
some settings are fixed if they are LOCKED_BY_HIERARCHY. However, user
data fields of activities can be locked, when the section they are
contained in has user data set to false. When this setting is changed on
the same screen, the fixed setting of the activity can not be "unfixed"
by javascript.

This patch adds a settings-level to the call of is_changeable. With this
only those dependency_settings are considered, which belong to parent
settings, which are not changeable on the current stage.
2017-11-06 12:07:57 +01:00
Tobias Reischmann 0a8086fb97 MDL-27886 backup: Enabled unlocking of backup settings
The function is_locked was changed to determine only, if the
dependency_setting want's the dependent setting to be locked.
In the previous version, is_locked did not only check, if the
dependency_setting want's the setting to be locked, but also if the
setting was already locked. A recursive call to the status of the
dependent setting leaded to problems, when unlocking locked settings.

Also the PHPDOC of the is_locked was adjusted to coincide with the current
usage in backup_ui_settings->is_changeable() and
base_setting->set_status(). In both functions all dependency_settings of
a setting are iterated to check if this setting should be or is LOCKED_BY_HIERARCHY.
The actual state of the setting was therefore either checked beforehand
or is not interesting, since the question is, if it shall be changed.
2017-11-06 12:07:57 +01:00
Tobias Reischmann 8b31cbead8 MDL-27886 backup: Added behat tests for user data settings
This new test defines different combinations of global and local user
data settings during the restore process and tests that global defaults
can be overriden.
2017-11-06 12:07:57 +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
Matteo Scaramuccia feb69eb8a5 MDL-59099 dml: MySQL8 supports only the Barracuda file format.
The following InnoDB file format configuration parameters were deprecated
in MySQL 5.7.7 and are now removed:
- innodb_file_format
- innodb_file_format_check
- innodb_file_format_max
- innodb_large_prefix

File format configuration parameters were necessary for creating tables
compatible with earlier versions of InnoDB in MySQL 5.1.
Now that MySQL 5.1 has reached the end of its product lifecycle,
the parameters are no longer required.

The FILE_FORMAT column was removed from the INNODB_SYS_TABLES and
INNODB_SYS_TABLESPACES Information Schema tables.

Ref: https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-0.html
2017-10-27 17:41:22 +02: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
Damyon Wiese ccdb33e9a8 MDL-60567 competencies: test list_competencies 2017-10-27 11:52:21 +08:00
Damyon Wiese df4dd003f7 MDL-60567 competencies: list_competencies wrong type
"validate_params" returns arrays in external functions.
2017-10-27 11:52:21 +08: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
Juan Segarra Montesinos 46b8ab729a MDL-55808 mod_glossary: Search glossary entries with ratings enabled doesn't work 2017-10-13 17:24:00 +02: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
Juan Leyva aa7f151edd MDL-60355 media_vimeo: Support restricted videos by domain in the app
As reported in MOBILE-1511, Vimeo videos restricted by domain are not
working in the app.

The reason is simple: The restriction is done by the Referer HTTP
header, when a video is embedded via an iframe in the Moodle Site,
Vimeo checks the Referer to see if it matches the specified domain.

When the video is embedded in the mobile app, the Referer is the one
provided by the app Cordova container so Vimeo won't allow playing the
video.

The solution is to add an extra iframe on top of the Vimeo embedding
one (like a proxy), the app will display an iframe pointing to a page
in the site that will include the iframe pointing to vimeo so the
restriction check will work.
2017-10-05 09:53:50 +02: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
Vervoort, Claude c76ac89f80 MDL-60253 lti: also consider securetoolurl for URL match 2017-09-27 13:25:52 -04: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
401 changed files with 6365 additions and 1501 deletions
+1
View File
@@ -1,4 +1,5 @@
**/yui/build/** -diff
**/amd/build/** -diff
lib/dml/oci_native_moodle_package.sql text eol=lf
theme/bootstrapbase/style/editor.css -diff
theme/bootstrapbase/style/moodle.css -diff
+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' ];
+6
View File
@@ -165,6 +165,12 @@ function print_auth_lock_options($auth, $user_fields, $helptext, $retrieveopts,
// If custom field then pick name from database.
$fieldshortname = str_replace('profile_field_', '', $fieldname);
$fieldname = $customfieldname[$fieldshortname]->name;
if (core_text::strlen($fieldshortname) > 67) {
// If custom profile field name is longer than 67 characters we will not be able to store the setting
// such as 'field_updateremote_profile_field_NOTSOSHORTSHORTNAME' in the database because the character
// limit for the setting name is 100.
continue;
}
} elseif ($fieldname == 'url') {
$fieldname = get_string('webpage');
} else {
+9 -7
View File
@@ -54,14 +54,16 @@ $statusmsg = '';
$errormsg = '';
if ($data = data_submitted() and confirm_sesskey()) {
if (admin_write_settings($data)) {
$statusmsg = get_string('changessaved');
}
$count = admin_write_settings($data);
if (empty($adminroot->errors)) {
switch ($return) {
case 'site': redirect("$CFG->wwwroot/");
case 'admin': redirect("$CFG->wwwroot/$CFG->admin/");
// No errors. Did we change any setting? If so, then indicate success.
if ($count) {
$statusmsg = get_string('changessaved');
} else {
switch ($return) {
case 'site': redirect("$CFG->wwwroot/");
case 'admin': redirect("$CFG->wwwroot/$CFG->admin/");
}
}
} else {
$errormsg = get_string('errorwithsettings', 'admin');
+178
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>
@@ -2257,4 +2259,180 @@
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
<MOODLE version="3.5" requires="3.1">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mariadb" version="5.5.31" />
<VENDOR name="mysql" version="5.5.31" />
<VENDOR name="postgres" version="9.3" />
<VENDOR name="mssql" version="10.0" />
<VENDOR name="oracle" version="10.2" />
</DATABASE>
<PHP version="7.0.0" level="required">
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
<ON_CHECK message="pcreunicodewarning" />
</FEEDBACK>
</PCREUNICODE>
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
<ON_ERROR message="iconvrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="optional">
<FEEDBACK>
<ON_CHECK message="mbstringrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_ERROR message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="required">
<FEEDBACK>
<ON_ERROR message="opensslrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="tokenizer" level="optional">
<FEEDBACK>
<ON_CHECK message="tokenizerrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="xmlrpc" level="optional">
<FEEDBACK>
<ON_CHECK message="xmlrpcrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="soap" level="optional">
<FEEDBACK>
<ON_CHECK message="soaprecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="ctype" level="required">
<FEEDBACK>
<ON_ERROR message="ctyperequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zip" level="required">
<FEEDBACK>
<ON_ERROR message="ziprequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zlib" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="gd" level="required">
<FEEDBACK>
<ON_ERROR message="gdrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="simplexml" level="required">
<FEEDBACK>
<ON_ERROR message="simplexmlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="spl" level="required">
<FEEDBACK>
<ON_ERROR message="splrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="pcre" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="dom" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xml" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xmlreader" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="intl" level="required">
<FEEDBACK>
<ON_ERROR message="intlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="json" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="hash" level="required"/>
<PHP_EXTENSION name="fileinfo" level="required"/>
</PHP_EXTENSIONS>
<PHP_SETTINGS>
<PHP_SETTING name="memory_limit" value="96M" level="required">
<FEEDBACK>
<ON_ERROR message="settingmemorylimit" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="file_uploads" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="settingfileuploads" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="opcache.enable" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="opcacherecommended" />
</FEEDBACK>
</PHP_SETTING>
</PHP_SETTINGS>
<CUSTOM_CHECKS>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_storage_engine" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbstorageengine" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="question/engine/upgrade/upgradelib.php" function="quiz_attempts_upgraded" level="required">
<FEEDBACK>
<ON_ERROR message="quizattemptsupgradedmessage" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_slasharguments" level="optional">
<FEEDBACK>
<ON_CHECK message="slashargumentswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_tables_row_format" level="optional">
<FEEDBACK>
<ON_CHECK message="unsupporteddbtablerowformat" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_unoconv_version" level="optional">
<FEEDBACK>
<ON_CHECK message="unoconvwarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_libcurl_version" level="optional">
<FEEDBACK>
<ON_CHECK message="libcurlwarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_format" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbfileformat" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_per_table" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbfilepertable" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_large_prefix" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddblargeprefix" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_is_https" level="optional">
<FEEDBACK>
<ON_CHECK message="ishttpswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_incomplete_unicode_support" level="optional">
<FEEDBACK>
<ON_CHECK message="incompleteunicodesupport" />
</FEEDBACK>
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
</COMPATIBILITY_MATRIX>
+3 -4
View File
@@ -29,9 +29,10 @@ require_once($CFG->libdir.'/adminlib.php');
$confirm = optional_param('confirm', 0, PARAM_BOOL);
$returnurl = optional_param('returnurl', null, PARAM_LOCALURL);
admin_externalpage_setup('purgecaches');
// If we have got here as a confirmed aciton, do it.
if ($confirm && isloggedin() && confirm_sesskey()) {
require_capability('moodle/site:config', context_system::instance());
if ($confirm && confirm_sesskey()) {
// Valid request. Purge, and redirect the user back to where they came from.
purge_all_caches();
@@ -45,8 +46,6 @@ if ($confirm && isloggedin() && confirm_sesskey()) {
}
// Otherwise, show a button to actually purge the caches.
admin_externalpage_setup('purgecaches');
$actionurl = new moodle_url('/admin/purgecaches.php', array('sesskey'=>sesskey(), 'confirm'=>1));
if ($returnurl) {
$actionurl->param('returnurl', $returnurl);
@@ -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;
}
+14 -5
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
@@ -21,15 +29,16 @@ $focus = '';
// now we'll deal with the case that the admin has submitted the form with changed settings
if ($data = data_submitted() and confirm_sesskey() and isset($data->action) and $data->action == 'save-settings') {
require_capability('moodle/site:config', $context);
if (admin_write_settings($data)) {
redirect($PAGE->url, get_string('changessaved'), null, \core\output\notification::NOTIFY_SUCCESS);
}
$count = admin_write_settings($data);
if (!empty($adminroot->errors)) {
$errormsg = get_string('errorwithsettings', 'admin');
$firsterror = reset($adminroot->errors);
$focus = $firsterror->id;
} else {
// No errors. Did we change any setting? If so, then redirect with success.
if ($count) {
redirect($PAGE->url, get_string('changessaved'), null, \core\output\notification::NOTIFY_SUCCESS);
}
redirect($PAGE->url);
}
}
@@ -55,7 +64,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();
+7 -3
View File
@@ -39,11 +39,15 @@ $statusmsg = '';
$errormsg = '';
if ($data = data_submitted() and confirm_sesskey()) {
if (admin_write_settings($data)) {
redirect($PAGE->url, get_string('changessaved'), null, \core\output\notification::NOTIFY_SUCCESS);
}
$count = admin_write_settings($data);
// Regardless of whether any setting change was written (a positive count), check validation errors for those that didn't.
if (empty($adminroot->errors)) {
// No errors. Did we change any setting? If so, then redirect with success.
if ($count) {
redirect($PAGE->url, get_string('changessaved'), null, \core\output\notification::NOTIFY_SUCCESS);
}
// We didn't change a setting.
switch ($return) {
case 'site': redirect("$CFG->wwwroot/");
case 'admin': redirect("$CFG->wwwroot/$CFG->admin/");
+1 -1
View File
@@ -398,7 +398,7 @@ function print_combined_install_output($processes) {
// Show process name in first row.
foreach ($processes as $name => $process) {
// If we don't have enough space to show full run name then show runX.
if ($lengthofprocessline < strlen($name + 2)) {
if ($lengthofprocessline < strlen($name) + 2) {
$name = substr($name, -5);
}
// One extra padding as we are adding | separator for rest of the data.
@@ -64,6 +64,7 @@
<li>
<a href="#">{{#str}}edit{{/str}}</a><b class="caret"></b>
<ul class="dropdown dropdown-menu">
{{#canmanage}}
<li class="dropdown-item">
<a href="#" data-action="edit">
{{#pix}}t/edit{{/pix}} {{#str}}edit{{/str}}
@@ -89,11 +90,13 @@
{{#pix}}t/down{{/pix}} {{#str}}movedown{{/str}}
</a>
</li>
{{/canmanage}}
<li class="dropdown-item">
<a href="#" data-action="linkedcourses">
{{#pix}}t/viewdetails{{/pix}} {{#str}}linkedcourses, tool_lp{{/str}}
</a>
</li>
{{#canmanage}}
<li class="dropdown-item">
<a href="#" data-action="relatedcompetencies">
{{#pix}}t/add{{/pix}} {{#str}}addcrossreferencedcompetency, tool_lp{{/str}}
@@ -104,6 +107,7 @@
{{#pix}}t/edit{{/pix}} {{#str}}competencyrule, tool_lp{{/str}}
</a>
</li>
{{/canmanage}}
</ul>
</li>
</ul>
@@ -112,11 +116,11 @@
<p data-region="competencyinfo">
{{#str}}nocompetencyselected, tool_lp{{/str}}
</p>
{{#canmanage}}
<div data-region="competencyactions">
{{#canmanage}}
<button class="btn btn-secondary" data-action="add">{{#pix}}t/add{{/pix}} <span data-region="term"></span></button>
{{/canmanage}}
</div>
{{/canmanage}}
</div>
</div>
</div>
+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),
@@ -78,6 +78,10 @@ class issuer extends persistent {
$mform->addRule('clientsecret', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
$mform->addHelpButton('clientsecret', 'issuerclientsecret', 'tool_oauth2');
// Use basic authentication.
$mform->addElement('checkbox', 'basicauth', get_string('usebasicauth', 'tool_oauth2'));
$mform->addHelpButton('basicauth', 'usebasicauth', 'tool_oauth2');
// Login scopes.
$mform->addElement('text', 'loginscopes', get_string('issuerloginscopes', 'tool_oauth2'));
$mform->addRule('loginscopes', null, 'required', null, 'client');
@@ -93,6 +93,8 @@ $string['systemaccountconnected_help'] = 'System accounts are used to provide ad
$string['systemaccountconnected'] = 'System account connected';
$string['systemaccountnotconnected'] = 'System account not connected';
$string['systemauthstatus'] = 'System account connected';
$string['usebasicauth'] = 'Authenticate token requests via HTTP headers';
$string['usebasicauth_help'] = 'Utilise the HTTP Basic authentication scheme when sending client ID and password with a refresh token request. Recommended by the OAuth 2 standard, but may not be available with some issuers.';
$string['userfieldexternalfield'] = 'External field name';
$string['userfieldexternalfield_help'] = 'Name of the field provided by the external OAuth system.';
$string['userfieldinternalfield_help'] = 'Name of the Moodle user field that should be mapped from the external field.';
@@ -9,6 +9,7 @@ Feature: Basic recycle bin functionality
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher@asd.com |
| student1 | Student | 1 | student@asd.com |
| student2 | Student | 2 | student2@asd.com |
And the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
@@ -16,6 +17,23 @@ Feature: Basic recycle bin functionality
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
| teacher1 | C2 | editingteacher |
| student1 | C2 | student |
| student2 | C2 | student |
And the following "groups" exist:
| name | course | idnumber |
| Group A | C2 | G1 |
| Group B | C2 | G2 |
| Group C | C2 | G3 |
And the following "group members" exist:
| user | group |
| teacher1 | G1 |
| teacher1 | G2 |
| student1 | G1 |
| student2 | G1 |
| student2 | G2 |
And the following config values are set as admin:
| coursebinenable | 1 | tool_recyclebin |
| categorybinenable | 1 | tool_recyclebin |
@@ -58,6 +76,12 @@ Feature: Basic recycle bin functionality
And I wait to be redirected
And I go to the courses management page
And I should see "Course 2" in the "#course-listing" "css_element"
And I am on "Course 2" course homepage
And I navigate to "Groups" node in "Course administration > Users"
And I follow "Overview"
And "Student 1" "text" should exist in the "Group A" "table_row"
And "Student 2" "text" should exist in the "Group A" "table_row"
And "Student 2" "text" should exist in the "Group B" "table_row"
@javascript
Scenario: Deleting a single item from the recycle bin
@@ -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
@@ -358,7 +358,7 @@ if ($formdata = $mform2->is_cancelled()) {
// add default values for remaining fields
$formdefaults = array();
if ($updatetype != UU_UPDATE_FILEOVERRIDE && $updatetype != UU_UPDATE_NOCHANGES) {
if (!$existinguser || ($updatetype != UU_UPDATE_FILEOVERRIDE && $updatetype != UU_UPDATE_NOCHANGES)) {
foreach ($STD_FIELDS as $field) {
if (isset($user->$field)) {
continue;
@@ -38,6 +38,31 @@ Feature: Upload users
And I set the field "groups" to "Section 1 (1)"
And the "members" select box should contain "Tom Jones"
@javascript
Scenario: Upload users enrolling them on courses and groups applying defaults
Given the following "courses" exist:
| fullname | shortname | category |
| Maths | math102 | 0 |
And the following "groups" exist:
| name | course | idnumber |
| Section 1 | math102 | S1 |
| Section 3 | math102 | S3 |
And I log in as "admin"
And I navigate to "Upload users" node in "Site administration > Users > Accounts"
When I upload "lib/tests/fixtures/upload_users.csv" file to "File" filemanager
And I press "Upload users"
And I set the following fields to these values:
| City/town | Brighton |
| Department | Purchasing |
And I press "Upload users"
And I press "Continue"
And I navigate to "Users > Accounts > Browse list of users" in site administration
And I should see "Tom Jones"
And I follow "Tom Jones"
And I follow "Edit profile"
And the field "City/town" matches value "Brighton"
And the field "Department" matches value "Purchasing"
@javascript
Scenario: Upload users with custom profile fields
# Create user profile field.
File diff suppressed because one or more lines are too long
+57 -21
View File
@@ -619,26 +619,43 @@ Tour.prototype.addEventHandler = function (eventName, handler) {
*/
Tour.prototype.processStepListeners = function (stepConfig) {
this.listeners.push(
// Next/Previous buttons.
{
node: this.currentStepNode,
args: ['click', '[data-role="next"]', $.proxy(this.next, this)]
}, {
node: this.currentStepNode,
args: ['click', '[data-role="previous"]', $.proxy(this.previous, this)]
},
// Next/Previous buttons.
{
node: this.currentStepNode,
args: ['click', '[data-role="next"]', $.proxy(this.next, this)]
}, {
node: this.currentStepNode,
args: ['click', '[data-role="previous"]', $.proxy(this.previous, this)]
},
// Close and end tour buttons.
{
node: this.currentStepNode,
args: ['click', '[data-role="end"]', $.proxy(this.endTour, this)]
},
// Close and end tour buttons.
{
node: this.currentStepNode,
args: ['click', '[data-role="end"]', $.proxy(this.endTour, this)]
},
// Keypresses.
{
node: $('body'),
args: ['keydown', $.proxy(this.handleKeyDown, this)]
});
// Click backdrop and hide tour.
{
node: $('[data-flexitour="backdrop"]'),
args: ['click', $.proxy(this.hide, this)]
},
// Click out and hide tour without backdrop.
{
node: $('body'),
args: ['click', $.proxy(function (e) {
// Handle click in or click out tour content,
// if click out, hide tour.
if (!this.currentStepNode.is(e.target) && $(e.target).closest('[data-role="flexitour-step"]').length === 0) {
this.hide();
}}, this)]
},
// Keypresses.
{
node: $('body'),
args: ['keydown', $.proxy(this.handleKeyDown, this)]
});
if (stepConfig.moveOnClick) {
var targetNode = this.getStepTarget(stepConfig);
@@ -904,7 +921,7 @@ Tour.prototype.announceStep = function (stepConfig) {
* @param {EventFacade} e
*/
Tour.prototype.handleKeyDown = function (e) {
var tabbableSelector = 'a[href], link[href], [draggable=true], [contenteditable=true], :input:enabled, [tabindex], button';
var tabbableSelector = 'a[href], link[href], [draggable=true], [contenteditable=true], :input:enabled, [tabindex], button:enabled';
switch (e.keyCode) {
case 27:
this.endTour();
@@ -923,8 +940,17 @@ Tour.prototype.handleKeyDown = function (e) {
var activeElement = $(document.activeElement);
var stepTarget = this.getStepTarget(this.currentStepConfig);
var tabbableNodes = $(tabbableSelector);
var dialogContainer = $('span[data-flexitour="container"]');
var currentIndex = void 0;
tabbableNodes.filter(function (index, element) {
// Filter out element which is not belong to target section or dialogue.
if (stepTarget) {
tabbableNodes = tabbableNodes.filter(function (index, element) {
return stepTarget != null && (stepTarget.has(element).length || dialogContainer.has(element).length || stepTarget.is(element) || dialogContainer.is(element));
});
}
// Find index of focusing element.
tabbableNodes.each(function (index, element) {
if (activeElement.is(element)) {
currentIndex = index;
return false;
@@ -934,7 +960,7 @@ Tour.prototype.handleKeyDown = function (e) {
var nextIndex = void 0;
var nextNode = void 0;
var focusRelevant = void 0;
if (currentIndex) {
if (currentIndex != void 0) {
var direction = 1;
if (e.shiftKey) {
direction = -1;
@@ -1090,6 +1116,16 @@ Tour.prototype.hide = function (transition) {
$(this).remove();
});
// Remove aria-describedby and tabindex attributes.
if (this.currentStepNode && this.currentStepNode.length) {
var stepId = this.currentStepNode.attr('id');
if (stepId) {
var currentStepElement = '[aria-describedby="' + stepId + '-body"]';
$(currentStepElement).removeAttr('tabindex');
$(currentStepElement).removeAttr('aria-describedby');
}
}
// Reset the listeners.
this.resetStepListeners();
@@ -57,3 +57,23 @@ Feature: Apply tour filters to a tour
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I should see "Welcome to your course tour."
@javascript
Scenario: Aria tags should not exist
Given I log in as "admin"
And I open the User tour settings page
# Turn on default tour for boost theme.
And I click on "Enable" "link" in the "Boost - administrator" "table_row"
And I am on site homepage
When I click on "Next" "button"
Then "button[aria-describedby^='tour-step-tool_usertours']" "css_element" should exist
And "button[tabindex]" "css_element" should exist
When I click on "Next" "button"
Then "button[aria-describedby^='tour-step-tool_usertours']" "css_element" should not exist
And "button[tabindex]" "css_element" should not exist
When I click on "Previous" "button"
Then "button[aria-describedby^='tour-step-tool_usertours']" "css_element" should exist
And "button[tabindex]" "css_element" should exist
When I click on "End tour" "button"
Then "button[aria-describedby^='tour-step-tool_usertours']" "css_element" should not exist
And "button[tabindex]" "css_element" should not exist
+1 -1
View File
@@ -4,7 +4,7 @@
<location>amd/src/tour.js</location>
<name>Flexitour</name>
<license>GPLv3</license>
<version>0.10.0</version>
<version>0.12.0</version>
<licenseversion>3</licenseversion>
</library>
<library>
+8 -2
View File
@@ -262,11 +262,17 @@
$users[$key]->country = $countries[$user->country];
}
}
if ($sort == "country") { // Need to resort by full country name, not code
if ($sort == "country") {
// Need to resort by full country name, not code.
foreach ($users as $user) {
$susers[$user->id] = $user->country;
}
asort($susers);
// Sort by country name, according to $dir.
if ($dir === 'DESC') {
arsort($susers);
} else {
asort($susers);
}
foreach ($susers as $key => $value) {
$nusers[] = $users[$key];
}
+1 -1
View File
@@ -45,7 +45,7 @@ $string['auth_dbname'] = 'Name of the database itself. Leave empty if using an O
$string['auth_dbname_key'] = 'DB name';
$string['auth_dbpass'] = 'Password matching the above username';
$string['auth_dbpass_key'] = 'Password';
$string['auth_dbpasstype'] = '<p>Specify the format that the password field is using. MD5 hashing is useful for connecting to other common web applications like PostNuke.</p> <p>Use \'internal\' if you want the external database to manage usernames and email addresses, but Moodle to manage passwords. If you use \'internal\', you <i>must</i> provide a populated email address field in the external database, and you must execute both admin/cron.php and auth/db/cli/sync_users.php regularly. Moodle will send an email to new users with a temporary password.</p>';
$string['auth_dbpasstype'] = '<p>Specify the format that the password field is using.</p> <p>Use \'internal\' if you want the external database to manage usernames and email addresses, but Moodle to manage passwords. If you use \'internal\', you <i>must</i> provide a populated email address field in the external database, and you must execute both admin/cron.php and auth/db/cli/sync_users.php regularly. Moodle will send an email to new users with a temporary password.</p>';
$string['auth_dbpasstype_key'] = 'Password format';
$string['auth_dbreviveduser'] = 'Revived user {$a->name} id {$a->id}';
$string['auth_dbrevivedusererror'] = 'Error reviving user {$a}';
+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(
+101 -36
View File
@@ -836,23 +836,7 @@ class auth_plugin_ldap extends auth_plugin_base {
/// User Updates - time-consuming (optional)
if ($do_updates) {
// Narrow down what fields we need to update
$all_keys = array_keys(get_object_vars($this->config));
$updatekeys = array();
foreach ($all_keys as $key) {
if (preg_match('/^field_updatelocal_(.+)$/', $key, $match)) {
// If we have a field to update it from
// and it must be updated 'onlogin' we
// update it on cron
if (!empty($this->config->{'field_map_'.$match[1]})
and $this->config->{$match[0]} === 'onlogin') {
array_push($updatekeys, $match[1]); // the actual key name
}
}
}
if ($this->config->suspended_attribute && $this->config->sync_suspended) {
$updatekeys[] = 'suspended';
}
unset($all_keys); unset($key);
$updatekeys = $this->get_profile_keys();
} else {
print_string('noupdatestobedone', 'auth_ldap');
@@ -960,6 +944,9 @@ class auth_plugin_ldap extends auth_plugin_base {
role_assign($creatorrole->id, $id, $sitecontext->id, $this->roleauth);
}
// Save custom profile fields.
$updatekeys = $this->get_profile_keys(true);
$this->update_user_record($user->username, $updatekeys, false);
}
$transaction->allow_commit();
unset($add_users); // free mem
@@ -990,6 +977,8 @@ class auth_plugin_ldap extends auth_plugin_base {
function update_user_record($username, $updatekeys = false, $triggerevent = false) {
global $CFG, $DB;
require_once($CFG->dirroot.'/user/profile/lib.php');
// Just in case check text case
$username = trim(core_text::strtolower($username));
@@ -1004,6 +993,8 @@ class auth_plugin_ldap extends auth_plugin_base {
// Protect the userid from being overwritten
$userid = $user->id;
$needsupdate = false;
if ($newinfo = $this->get_userinfo($username)) {
$newinfo = truncate_userinfo($newinfo);
@@ -1016,6 +1007,9 @@ class auth_plugin_ldap extends auth_plugin_base {
$newuser->id = $userid;
// The cast to int is a workaround for MDL-53959.
$newuser->suspended = (int)$this->is_user_suspended((object) $newinfo);
// Get all custom fields.
$profilefields = (array) profile_user_record($user->id, false);
$newprofilefields = [];
foreach ($updatekeys as $key) {
if (isset($newinfo[$key])) {
@@ -1025,18 +1019,50 @@ class auth_plugin_ldap extends auth_plugin_base {
}
if (!empty($this->config->{'field_updatelocal_' . $key})) {
// Only update if it's changed.
if ($user->{$key} != $value) {
if (preg_match('/^profile_field_(.*)$/', $key, $match)) {
// Custom field.
$field = $match[1];
$currentvalue = isset($profilefields[$field]) ? $profilefields[$field] : null;
$newprofilefields[$field] = $value;
} else {
// Standard field.
$currentvalue = isset($user->$key) ? $user->$key : null;
$newuser->$key = $value;
}
}
// Only update if it's changed.
if ($currentvalue !== $value) {
$needsupdate = true;
}
}
user_update_user($newuser, false, $triggerevent);
}
} else {
return false;
if ($needsupdate) {
user_update_user($newuser, false, $triggerevent);
// Now, save the profile fields if the user has any.
if ($fields = $DB->get_records('user_info_field')) {
foreach ($fields as $field) {
if (isset($newprofilefields[$field->shortname])) {
$conditions = array('fieldid' => $field->id, 'userid' => $newuser->id);
$id = $DB->get_field('user_info_data', 'id', $conditions);
$data = $newprofilefields[$field->shortname];
if ($id) {
$DB->set_field('user_info_data', 'data', $data, array('id' => $id));
} else {
$record = array('fieldid' => $field->id, 'userid' => $newuser->id, 'data' => $data);
$DB->insert_record('user_info_data', $record);
}
}
}
}
return $DB->get_record('user', array('id' => $userid, 'deleted' => 0));
}
}
return $DB->get_record('user', array('id'=>$userid, 'deleted'=>0));
return false;
}
/**
@@ -1186,6 +1212,14 @@ class auth_plugin_ldap extends auth_plugin_base {
return false;
}
// Load old custom fields.
$olduserprofilefields = (array) profile_user_record($olduser->id, false);
$fields = array();
foreach (profile_get_custom_fields(false) as $field) {
$fields[$field->shortname] = $field;
}
$success = true;
$user_info_result = ldap_read($ldapconnection, $user_dn, '(objectClass=*)', $search_attribs);
if ($user_info_result) {
@@ -1204,19 +1238,24 @@ class auth_plugin_ldap extends auth_plugin_base {
$user_entry = $user_entry[0];
foreach ($attrmap as $key => $ldapkeys) {
$profilefield = '';
// Only process if the moodle field ($key) has changed and we
// are set to update LDAP with it
$customprofilefield = 'profile_field_' . $key;
if (isset($olduser->$key) and isset($newuser->$key)
and ($olduser->$key !== $newuser->$key)) {
$profilefield = $key;
} else if (isset($olduser->$customprofilefield) && isset($newuser->$customprofilefield)
&& $olduser->$customprofilefield !== $newuser->$customprofilefield) {
$profilefield = $customprofilefield;
if (preg_match('/^profile_field_(.*)$/', $key, $match)) {
// Custom field.
$fieldname = $match[1];
if (isset($fields[$fieldname])) {
$class = 'profile_field_' . $fields[$fieldname]->datatype;
$formfield = new $class($fields[$fieldname]->id, $olduser->id);
$oldvalue = isset($olduserprofilefields[$fieldname]) ? $olduserprofilefields[$fieldname] : null;
} else {
$oldvalue = null;
}
$newvalue = $formfield->edit_save_data_preprocess($newuser->{$formfield->inputname}, new stdClass);
} else {
// Standard field.
$oldvalue = isset($olduser->$key) ? $olduser->$key : null;
$newvalue = isset($newuser->$key) ? $newuser->$key : null;
}
if (!empty($profilefield) && !empty($this->config->{'field_updateremote_' . $key})) {
if ($newvalue !== null and $newvalue !== $oldvalue and !empty($this->config->{'field_updateremote_' . $key})) {
// For ldap values that could be in more than one
// ldap key, we will do our best to match
// where they came from
@@ -1229,9 +1268,9 @@ class auth_plugin_ldap extends auth_plugin_base {
$ambiguous = false;
}
$nuvalue = core_text::convert($newuser->$profilefield, 'utf-8', $this->config->ldapencoding);
$nuvalue = core_text::convert($newvalue, 'utf-8', $this->config->ldapencoding);
empty($nuvalue) ? $nuvalue = array() : $nuvalue;
$ouvalue = core_text::convert($olduser->$profilefield, 'utf-8', $this->config->ldapencoding);
$ouvalue = core_text::convert($oldvalue, 'utf-8', $this->config->ldapencoding);
foreach ($ldapkeys as $ldapkey) {
$ldapkey = $ldapkey;
@@ -2151,4 +2190,30 @@ class auth_plugin_ldap extends auth_plugin_base {
echo $OUTPUT->notification(get_string('ldapnotconfigured', 'auth_ldap'), \core\output\notification::NOTIFY_INFO);
}
}
/**
* Get the list of profile fields.
*
* @param bool $fetchall Fetch all, not just those for update.
* @return array
*/
protected function get_profile_keys($fetchall = false) {
$keys = array_keys(get_object_vars($this->config));
$updatekeys = [];
foreach ($keys as $key) {
if (preg_match('/^field_updatelocal_(.+)$/', $key, $match)) {
// If we have a field to update it from and it must be updated 'onlogin' we update it on cron.
if (!empty($this->config->{'field_map_'.$match[1]})) {
if ($fetchall || $this->config->{$match[0]} === 'onlogin') {
array_push($updatekeys, $match[1]); // the actual key name
}
}
}
}
if ($this->config->suspended_attribute && $this->config->sync_suspended) {
$updatekeys[] = 'suspended';
}
return $updatekeys;
}
} // End of the class
+10 -10
View File
@@ -43,12 +43,12 @@ $string['auth_ldapdescription'] = 'This method provides authentication against a
entry in its database. This module can read user attributes from LDAP and prefill
wanted fields in Moodle. For following logins only the username and
password are checked.';
$string['auth_ldap_expiration_desc'] = 'Select No to disable expired password checking or LDAP to read passwordexpiration time directly from LDAP';
$string['auth_ldap_expiration_key'] = 'Expiration';
$string['auth_ldap_expiration_warning_desc'] = 'Number of days before password expiration warning is issued.';
$string['auth_ldap_expiration_warning_key'] = 'Expiration warning';
$string['auth_ldap_expireattr_desc'] = 'Optional: Overrides the LDAP attribute that stores password expiration time.';
$string['auth_ldap_expireattr_key'] = 'Expiration attribute';
$string['auth_ldap_expiration_desc'] = 'Select \'{$a->no}\' to disable expired password checking or \'{$a->ldapserver}\' to read the password expiry time directly from the LDAP server.';
$string['auth_ldap_expiration_key'] = 'Expiry';
$string['auth_ldap_expiration_warning_desc'] = 'Number of days before password expiry warning is issued.';
$string['auth_ldap_expiration_warning_key'] = 'Expiry warning';
$string['auth_ldap_expireattr_desc'] = 'Optional: Overrides the LDAP attribute that stores password expiry time.';
$string['auth_ldap_expireattr_key'] = 'Expiry attribute';
$string['auth_ldapextrafields'] = 'These fields are optional. You can choose to pre-fill some Moodle user fields with information from the <b>LDAP fields</b> that you specify here. <p>If you leave these fields blank, then nothing will be transferred from LDAP and Moodle defaults will be used instead.</p><p>In either case, the user will be able to edit all of these fields after they log in.</p>';
$string['auth_ldap_graceattr_desc'] = 'Optional: Overrides gracelogin attribute';
$string['auth_ldap_gracelogin_key'] = 'Grace login attribute';
@@ -77,7 +77,7 @@ $string['auth_ldap_opt_deref'] = 'Determines how aliases are handled during sear
$string['auth_ldap_opt_deref_key'] = 'Dereference aliases';
$string['auth_ldap_passtype'] = 'Specify the format of new or changed passwords in LDAP server.';
$string['auth_ldap_passtype_key'] = 'Password format';
$string['auth_ldap_passwdexpire_settings'] = 'LDAP password expiration settings';
$string['auth_ldap_passwdexpire_settings'] = 'LDAP password expiry settings';
$string['auth_ldap_preventpassindb'] = 'Select yes to prevent passwords from being stored in Moodle\'s DB.';
$string['auth_ldap_preventpassindb_key'] = 'Prevent password caching';
$string['auth_ldap_search_sub'] = 'Search users from subcontexts.';
@@ -91,7 +91,7 @@ $string['auth_ldap_suspended_attribute'] = 'Optional: When provided this attribu
$string['auth_ldap_suspended_attribute_key'] = 'Suspended attribute';
$string['auth_ldap_user_exists'] = 'LDAP username already exists.';
$string['auth_ldap_user_settings'] = 'User lookup settings';
$string['auth_ldap_user_type'] = 'Select how users are stored in LDAP. This setting also specifies how login expiration, grace logins and user creation will work.';
$string['auth_ldap_user_type'] = 'Select how users are stored in LDAP. This setting also specifies how login expiry, grace logins and user creation will work.';
$string['auth_ldap_user_type_key'] = 'User type';
$string['auth_ldap_usertypeundefined'] = 'config.user_type not defined or function ldap_expirationtime2unix does not support selected type!';
$string['auth_ldap_usertypeundefined2'] = 'config.user_type not defined or function ldap_unixi2expirationtime does not support selected type!';
@@ -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!';
@@ -147,7 +147,7 @@ $string['start_tls_key'] = 'Use TLS';
$string['updateremfail'] = 'Error updating LDAP record. Error code: {$a->errno}; Error string: {$a->errstring}<br/>Key ({$a->key}) - old moodle value: \'{$a->ouvalue}\' new value: \'{$a->nuvalue}\'';
$string['updateremfailamb'] = 'Failed to update LDAP with ambiguous field {$a->key}; old moodle value: \'{$a->ouvalue}\', new value: \'{$a->nuvalue}\'';
$string['updatepasserror'] = 'Error in user_update_password(). Error code: {$a->errno}; Error string: {$a->errstring}';
$string['updatepasserrorexpire'] = 'Error in user_update_password() when reading password expiration time. Error code: {$a->errno}; Error string: {$a->errstring}';
$string['updatepasserrorexpire'] = 'Error in user_update_password() when reading password expiry time. Error code: {$a->errno}; Error string: {$a->errstring}';
$string['updatepasserrorexpiregrace'] = 'Error in user_update_password() when modifying expirationtime and/or gracelogins. Error code: {$a->errno}; Error string: {$a->errstring}';
$string['updateusernotfound'] = 'Could not find user while updating externally. Details follow: search base: \'{$a->userdn}\'; search filter: \'(objectClass=*)\'; search attributes: {$a->attribs}';
$string['user_activatenotsupportusertype'] = 'auth: ldap user_activate() does not support selected usertype: {$a}';
+15 -3
View File
@@ -185,12 +185,24 @@ if ($ADMIN->fulltree) {
new lang_string('auth_ldap_passwdexpire_settings', 'auth_ldap'), ''));
// Password Expiration.
// Create the description lang_string object.
$strno = get_string('no');
$strldapserver = get_string('pluginname', 'auth_ldap');
$langobject = new stdClass();
$langobject->no = $strno;
$langobject->ldapserver = $strldapserver;
$description = new lang_string('auth_ldap_expiration_desc', 'auth_ldap', $langobject);
// Now create the options.
$expiration = array();
$expiration['0'] = 'no';
$expiration['1'] = 'LDAP';
$expiration['0'] = $strno;
$expiration['1'] = $strldapserver;
// Add the setting.
$settings->add(new admin_setting_configselect('auth_ldap/expiration',
new lang_string('auth_ldap_expiration_key', 'auth_ldap'),
new lang_string('auth_ldap_expiration_desc', 'auth_ldap'), 0 , $expiration));
$description, 0 , $expiration));
// Password Expiration warning.
$settings->add(new admin_setting_configtext('auth_ldap/expiration_warning',
+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);
+1 -1
View File
@@ -99,7 +99,7 @@ class cc11_resource extends entities11 {
$link = 'http://invalidurldetected/';
}
} else {
$link = $rawlink;
$link = htmlspecialchars(trim($rawlink), ENT_COMPAT, 'UTF-8', false);
}
}
}
+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
*/
@@ -65,6 +65,7 @@ abstract class base_setting {
protected $name; // name of the setting
protected $value; // value of the setting
protected $unlockedvalue; // Value to set after the setting is unlocked.
protected $vtype; // type of value (setting_base::IS_BOOLEAN/setting_base::IS_INTEGER...)
protected $visibility; // visibility of the setting (setting_base::VISIBLE/setting_base::HIDDEN)
@@ -118,6 +119,7 @@ abstract class base_setting {
$this->value = $value;
$this->visibility = $visibility;
$this->status = $status;
$this->unlockedvalue = $this->value;
// Generate a default ui
$this->uisetting = new base_setting_ui($this);
@@ -225,6 +227,11 @@ abstract class base_setting {
$this->status = $status;
if ($status !== $oldstatus) { // Status has changed, let's inform dependencies
$this->inform_dependencies(self::CHANGED_STATUS, $oldstatus);
if ($status == base_setting::NOT_LOCKED) {
// When setting gets unlocked set it to the original value.
$this->set_value($this->unlockedvalue);
}
}
}
@@ -153,7 +153,7 @@ abstract class setting_dependency {
*/
abstract public function get_moodleform_properties();
/**
* Returns true if the dependent setting is locked.
* Returns true if the dependent setting is locked by this setting_dependency.
* @return bool
*/
abstract public function is_locked();
@@ -185,7 +185,7 @@ class setting_dependency_disabledif_equals extends setting_dependency {
$this->value = ($value)?(string)$value:0;
}
/**
* Returns true if the dependent setting is locked.
* Returns true if the dependent setting is locked by this setting_dependency.
* @return bool
*/
public function is_locked() {
@@ -193,8 +193,8 @@ class setting_dependency_disabledif_equals extends setting_dependency {
if ($this->setting->get_status() !== base_setting::NOT_LOCKED || $this->setting->get_value() == $this->value) {
return true;
}
// Else return based upon the dependent settings status
return ($this->dependentsetting->get_status() !== base_setting::NOT_LOCKED);
// Else the dependent setting is not locked by this setting_dependency.
return false;
}
/**
* Processes a value change in the primary setting
@@ -343,7 +343,7 @@ class setting_dependency_disabledif_equals2 extends setting_dependency {
$this->value = $value;
}
/**
* Returns true if the dependent setting is locked.
* Returns true if the dependent setting is locked by this setting_dependency.
* @return bool
*/
public function is_locked() {
@@ -351,8 +351,8 @@ class setting_dependency_disabledif_equals2 extends setting_dependency {
if ($this->setting->get_status() !== base_setting::NOT_LOCKED || in_array($this->setting->get_value(), $this->value)) {
return true;
}
// Else return based upon the dependent settings status
return ($this->dependentsetting->get_status() !== base_setting::NOT_LOCKED);
// Else the dependent setting is not locked by this setting_dependency.
return false;
}
/**
* Processes a value change in the primary setting
@@ -537,7 +537,7 @@ class setting_dependency_disabledif_not_empty extends setting_dependency_disable
}
/**
* Returns true if the dependent setting is locked.
* Returns true if the dependent setting is locked by this setting_dependency.
* @return bool
*/
public function is_locked() {
@@ -545,8 +545,8 @@ class setting_dependency_disabledif_not_empty extends setting_dependency_disable
if ($this->setting->get_status() !== base_setting::NOT_LOCKED || !empty($value)) {
return true;
}
// Else return based upon the dependent settings status
return ($this->dependentsetting->get_status() !== base_setting::NOT_LOCKED);
// Else the dependent setting is not locked by this setting_dependency.
return false;
}
}
@@ -601,7 +601,7 @@ class setting_dependency_disabledif_empty extends setting_dependency_disabledif_
return ($prevalue != $this->dependentsetting->get_value());
}
/**
* Returns true if the dependent setting is locked.
* Returns true if the dependent setting is locked by this setting_dependency.
* @return bool
*/
public function is_locked() {
@@ -609,7 +609,7 @@ class setting_dependency_disabledif_empty extends setting_dependency_disabledif_
if ($this->setting->get_status() !== base_setting::NOT_LOCKED || empty($value)) {
return true;
}
// Else return based upon the dependent settings status
return ($this->dependentsetting->get_status() !== base_setting::NOT_LOCKED);
// Else the dependent setting is not locked by this setting_dependency.
return false;
}
}
@@ -122,6 +122,8 @@ class backup_confirmation_form extends backup_moodleform {
if (!array_key_exists('setting_root_filename', $errors)) {
if (trim($data['setting_root_filename']) == '') {
$errors['setting_root_filename'] = get_string('errorfilenamerequired', 'backup');
} else if (strlen(trim($data['setting_root_filename'])) > 255) {
$errors['setting_root_filename'] = get_string('errorfilenametoolong', 'backup');
} else if (!preg_match('#\.mbz$#i', $data['setting_root_filename'])) {
$errors['setting_root_filename'] = get_string('errorfilenamemustbezip', 'backup');
}
+25 -10
View File
@@ -307,10 +307,12 @@ abstract class backup_setting_ui extends base_setting_ui {
* 2. The setting is locked but only by settings that are of the same level (same page)
*
* Condition 2 is really why we have this function
*
* @param int $level Optional, if provided only depedency_settings below or equal to this level are considered,
* when checking if the ui_setting is changeable. Although dependencies might cause a lock on this setting,
* they could be changeable in the same view.
* @return bool
*/
public function is_changeable() {
public function is_changeable($level = null) {
if ($this->setting->get_status() === backup_setting::NOT_LOCKED) {
// Its not locked so its chanegable.
return true;
@@ -319,6 +321,9 @@ abstract class backup_setting_ui extends base_setting_ui {
return false;
} else if ($this->setting->has_dependencies_on_settings()) {
foreach ($this->setting->get_settings_depended_on() as $dependency) {
if ($level && $dependency->get_setting()->get_level() >= $level) {
continue;
}
if ($dependency->is_locked() && $dependency->get_setting()->get_level() !== $this->setting->get_level()) {
// Its not changeable because one or more dependancies arn't changeable.
return false;
@@ -355,7 +360,8 @@ class backup_setting_ui_text extends backup_setting_ui {
*/
public function get_element_properties(base_task $task = null, renderer_base $output = null) {
$icon = $this->get_icon();
$label = $this->get_label($task);
$context = context_course::instance($task->get_courseid());
$label = format_string($this->get_label($task), true, array('context' => $context));
if (!empty($icon)) {
$label .= $output->render($icon);
}
@@ -418,7 +424,8 @@ class backup_setting_ui_checkbox extends backup_setting_ui {
public function get_element_properties(base_task $task = null, renderer_base $output = null) {
// Name, label, text, attributes.
$icon = $this->get_icon();
$label = $this->get_label($task);
$context = context_course::instance($task->get_courseid());
$label = format_string($this->get_label($task), true, array('context' => $context));
if (!empty($icon)) {
$label .= $output->render($icon);
}
@@ -456,13 +463,16 @@ class backup_setting_ui_checkbox extends backup_setting_ui {
/**
* Returns true if the setting is changeable
* @param int $level Optional, if provided only depedency_settings below or equal to this level are considered,
* when checking if the ui_setting is changeable. Although dependencies might cause a lock on this setting,
* they could be changeable in the same view.
* @return bool
*/
public function is_changeable() {
public function is_changeable($level = null) {
if ($this->changeable === false) {
return false;
} else {
return parent::is_changeable();
return parent::is_changeable($level);
}
}
@@ -525,7 +535,8 @@ class backup_setting_ui_radio extends backup_setting_ui {
*/
public function get_element_properties(base_task $task = null, renderer_base $output = null) {
$icon = $this->get_icon();
$label = $this->get_label($task);
$context = context_course::instance($task->get_courseid());
$label = format_string($this->get_label($task), true, array('context' => $context));
if (!empty($icon)) {
$label .= $output->render($icon);
}
@@ -602,7 +613,8 @@ class backup_setting_ui_select extends backup_setting_ui {
*/
public function get_element_properties(base_task $task = null, renderer_base $output = null) {
$icon = $this->get_icon();
$label = $this->get_label($task);
$context = context_course::instance($task->get_courseid());
$label = format_string($this->get_label($task), true, array('context' => $context));
if (!empty($icon)) {
$label .= $output->render($icon);
}
@@ -635,13 +647,16 @@ class backup_setting_ui_select extends backup_setting_ui {
/**
* Returns true if the setting is changeable, false otherwise
*
* @param int $level Optional, if provided only depedency_settings below or equal to this level are considered,
* when checking if the ui_setting is changeable. Although dependencies might cause a lock on this setting,
* they could be changeable in the same view.
* @return bool
*/
public function is_changeable() {
public function is_changeable($level = null) {
if (count($this->values) == 1) {
return false;
} else {
return parent::is_changeable();
return parent::is_changeable($level);
}
}
+14 -2
View File
@@ -183,11 +183,22 @@ abstract class base_moodleform extends moodleform {
public function add_settings(array $settingstasks) {
global $OUTPUT;
// Determine highest setting level, which is displayed in this stage. This is relevant for considering only
// locks of dependency settings for parent settings, which are not displayed in this stage.
$highestlevel = backup_setting::ACTIVITY_LEVEL;
foreach ($settingstasks as $st) {
list($setting, $task) = $st;
if ($setting->get_level() < $highestlevel) {
$highestlevel = $setting->get_level();
}
}
$defaults = array();
foreach ($settingstasks as $st) {
list($setting, $task) = $st;
// If the setting cant be changed or isn't visible then add it as a fixed setting.
if (!$setting->get_ui()->is_changeable() || $setting->get_visibility() != backup_setting::VISIBLE) {
if (!$setting->get_ui()->is_changeable($highestlevel) ||
$setting->get_visibility() != backup_setting::VISIBLE) {
$this->add_fixed_setting($setting, $task);
continue;
}
@@ -302,7 +313,8 @@ abstract class base_moodleform extends moodleform {
$icon = '';
break;
}
$label = $settingui->get_label($task);
$context = context_course::instance($task->get_courseid());
$label = format_string($settingui->get_label($task), true, array('context' => $context));
$labelicon = $settingui->get_icon();
if (!empty($labelicon)) {
$label .= '&nbsp;'.$OUTPUT->render($labelicon);
@@ -0,0 +1,125 @@
@core @core_backup
Feature: Restore Moodle 2 course backups with different user data settings
In order to decide upon including user data during backup and restore of courses
As a teacher and an admin
I need to be able to set and override backup and restore settings
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | Student | 1 | student1@example.com |
| teacher1 | Teacher | 1 | teacher1@example.com |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activities" exist:
| activity | name | intro | course | idnumber |
| data | Test database name | n | C1 | data1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I add a "Text input" field to "Test database name" database and I fill the form with:
| Field name | Test field name |
| Field description | Test field description |
And I follow "Templates"
And I wait until the page is ready
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I add an entry to "Test database name" database with:
| Test field name | Student entry |
And I press "Save and view"
And I log out
And I log in as "admin"
And I backup "Course 1" course using this options:
| Initial | Include enrolled users | 1 |
| Confirmation | Filename | test_backup.mbz |
@javascript
Scenario: Restore a backup with user data
# "User data" marks the user data field for the section
# "-" marks the user data field for the data activity
When I restore "test_backup.mbz" backup into a new course using this options:
| Settings | Include enrolled users | 1 |
| Schema | User data | 1 |
| Schema | - | 1 |
Then I should see "Test database name"
When I follow "Test database name"
Then I should see "Student entry"
@javascript
Scenario: Restore a backup without user data for data activity
# "User data" marks the user data field for the section
# "-" marks the user data field for the data activity
When I restore "test_backup.mbz" backup into a new course using this options:
| Settings | Include enrolled users | 1 |
| Schema | User data | 1 |
| Schema | - | 0 |
Then I should see "Test database name"
When I follow "Test database name"
Then I should not see "Student entry"
@javascript
Scenario: Restore a backup without user data for section and data activity
# "User data" marks the user data field for the section
# "-" marks the user data field for the data activity
When I restore "test_backup.mbz" backup into a new course using this options:
| Settings | Include enrolled users | 1 |
| Schema | User data | 0 |
| Schema | - | 0 |
Then I should see "Test database name"
When I follow "Test database name"
Then I should not see "Student entry"
@javascript
Scenario: Restore a backup without user data for section
# "User data" marks the user data field for the section
# "-" marks the user data field for the data activity
When I restore "test_backup.mbz" backup into a new course using this options:
| Settings | Include enrolled users | 1 |
| Schema | - | 1 |
| Schema | User data | 0 |
Then I should see "Test database name"
When I follow "Test database name"
Then I should not see "Student entry"
@javascript
Scenario: Restore a backup with user data with local config for including users set to 0
And I restore "test_backup.mbz" backup into a new course using this options:
| Settings | Include enrolled users | 0 |
Then I should see "Test database name"
When I follow "Test database name"
Then I should not see "Student entry"
@javascript
Scenario: Restore a backup with user data with site config for including users set to 0
Given I navigate to "General restore defaults" node in "Site administration > Courses > Backups"
And I set the field "s_restore_restore_general_users" to ""
And I press "Save changes"
And I am on "Course 1" course homepage
And I navigate to "Restore" node in "Course administration"
# "User data" marks the user data field for the section
# "-" marks the user data field for the data activity
And I restore "test_backup.mbz" backup into a new course using this options:
| Settings | Include enrolled users | 1 |
| Schema | User data | 1 |
| Schema | - | 1 |
Then I should see "Test database name"
When I follow "Test database name"
Then I should see "Student entry"
@javascript
Scenario: Restore a backup with user data with local and site config config for including users set to 0
Given I navigate to "General restore defaults" node in "Site administration > Courses > Backups"
And I set the field "s_restore_restore_general_users" to ""
And I press "Save changes"
And I am on "Course 1" course homepage
And I navigate to "Restore" node in "Course administration"
When I restore "test_backup.mbz" backup into a new course using this options:
| Settings | Include enrolled users | 0 |
Then I should see "Test database name"
When I follow "Test database name"
Then I should not see "Student entry"
+12 -8
View File
@@ -27,18 +27,22 @@ function check_site_access() {
var callback = {
method: "GET",
on: {
success: function(id, o, args) {
var data = Y.JSON.parse(o.responseText);
if (data.code == 'http-unreachable') {
add.setHTML(data.response);
add.removeClass('hide');
}
},
failure: function(o) { }
success: function(id, o) {
var data = Y.JSON.parse(o.responseText);
if (data.code == 'http-unreachable') {
add.setHTML(data.response);
add.removeClass('hide');
}
M.util.js_complete('badge/backpack::check_site_access');
},
failure: function() {
M.util.js_complete('badge/backpack::check_site_access');
}
}
};
Y.use('io-base', function(Y) {
M.util.js_pending('badge/backpack::check_site_access');
Y.io('ajax.php', callback);
});
+2 -2
View File
@@ -48,8 +48,8 @@ class edit_details_form extends moodleform {
$mform->addElement('header', 'badgedetails', get_string('badgedetails', 'badges'));
$mform->addElement('text', 'name', get_string('name'), array('size' => '70'));
// Using PARAM_FILE to avoid problems later when downloading badge files.
$mform->setType('name', PARAM_FILE);
// When downloading badge, it will be necessary to clean the name as PARAM_FILE.
$mform->setType('name', PARAM_TEXT);
$mform->addRule('name', null, 'required');
$mform->addRule('name', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
+1
View File
@@ -72,6 +72,7 @@ if ($hide) {
require_sesskey();
$badge = new badge($download);
$name = str_replace(' ', '_', $badge->name) . '.png';
$name = clean_param($name, PARAM_FILE);
$filehash = badges_bake($hash, $download, $USER->id, true);
$fs = get_file_storage();
$file = $fs->get_file_by_hash($filehash);
+3 -2
View File
@@ -74,12 +74,13 @@ class block_globalsearch extends block_base {
// Input.
$this->content->text .= html_writer::tag('label', get_string('search', 'search'),
array('for' => 'searchform_search', 'class' => 'accesshide'));
$inputoptions = array('id' => 'searchform_search', 'name' => 'q', 'type' => 'text', 'size' => '15');
$inputoptions = array('id' => 'searchform_search', 'name' => 'q', 'class' => 'form-control',
'type' => 'text', 'size' => '15');
$this->content->text .= html_writer::empty_tag('input', $inputoptions);
// Search button.
$this->content->text .= html_writer::tag('button', get_string('search', 'search'),
array('id' => 'searchform_button', 'type' => 'submit', 'title' => 'globalsearch'));
array('id' => 'searchform_button', 'type' => 'submit', 'title' => 'globalsearch', 'class' => 'btn btn-secondary'));
$this->content->text .= html_writer::end_tag('fieldset');
$this->content->text .= html_writer::end_tag('form');
$this->content->text .= html_writer::end_tag('div');
@@ -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() {
+6 -1
View File
@@ -35,6 +35,7 @@ use core_competency\url;
use renderable;
use renderer_base;
use templatable;
use required_capability_exception;
/**
* Summary renderable class.
@@ -68,7 +69,11 @@ class summary implements renderable, templatable {
$this->user = $user;
// Get the plans.
$this->plans = api::list_user_plans($this->user->id);
try {
$this->plans = api::list_user_plans($this->user->id);
} catch (required_capability_exception $e) {
$this->plans = [];
}
// Get the competencies to review.
$this->compstoreview = api::list_user_competencies_to_review(0, 3);
+8 -2
View File
@@ -61,9 +61,15 @@ class main implements renderable, templatable {
* @return stdClass
*/
public function export_for_template(renderer_base $output) {
global $USER;
global $CFG, $USER;
$courses = enrol_get_my_courses('*', 'fullname ASC');
if (empty($CFG->navsortmycoursessort)) {
$sort = 'visible DESC, sortorder ASC';
} else {
$sort = 'visible DESC, '.$CFG->navsortmycoursessort.' ASC';
}
$courses = enrol_get_my_courses('*', $sort);
$coursesprogress = [];
foreach ($courses as $course) {
+1 -1
View File
@@ -45,7 +45,7 @@ class block_tags extends block_base {
if (empty($this->config->title)) {
$this->title = get_string('pluginname', 'block_tags');
} else {
$this->title = $this->config->title;
$this->title = format_string($this->config->title, true, ['context' => $this->context]);
}
}
@@ -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
+8 -1
View File
@@ -1457,7 +1457,7 @@ function calendar_get_mini($courses, $groups, $users, $calmonth = false, $calyea
$name = format_string($event->name, true);
}
}
$popupcontent .= \html_writer::link($dayhref, $name);
$popupcontent .= \html_writer::link($dayhref, clean_text($name));
$popupcontent .= \html_writer::end_tag('div');
}
@@ -2116,6 +2116,13 @@ function calendar_time_representation($time) {
$timeformat = get_config(null, 'calendar_site_timeformat');
}
// Allow language customization of selected time format.
if ($timeformat === CALENDAR_TF_12) {
$timeformat = get_string('strftimetime12', 'langconfig');
} else if ($timeformat === CALENDAR_TF_24) {
$timeformat = get_string('strftimetime24', 'langconfig');
}
return userdate($time, empty($timeformat) ? $langtimeformat : $timeformat);
}
+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");
+3 -2
View File
@@ -165,7 +165,7 @@ class api {
require_capability('moodle/competency:competencymanage', $competency->get_context());
// Reset the sortorder, use reorder instead.
$competency->set('sortorder', null);
$competency->set('sortorder', 0);
$competency->create();
\core\event\competency_created::create_from_competency($competency)->trigger();
@@ -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,
+1 -1
View File
@@ -76,7 +76,7 @@ class competency extends persistent {
'default' => FORMAT_HTML
),
'sortorder' => array(
'default' => null,
'default' => 0,
'type' => PARAM_INT
),
'parentid' => array(
+2 -2
View File
@@ -841,10 +841,10 @@ class external extends external_api {
$validcolumns = array('id', 'shortname', 'description', 'sortorder', 'idnumber',
'parentid', 'competencyframeworkid');
foreach ($params['filters'] as $filter) {
if (!in_array($filter->column, $validcolumns)) {
if (!in_array($filter['column'], $validcolumns)) {
throw new invalid_parameter_exception('Filter column was invalid');
}
$safefilters[$filter->column] = $filter->value;
$safefilters[$filter['column']] = $filter['value'];
}
$context = null;
+1 -1
View File
@@ -53,7 +53,7 @@ class template_competency extends persistent {
),
'sortorder' => array(
'type' => PARAM_INT,
'default' => null,
'default' => 0,
),
);
}
@@ -282,7 +282,6 @@ class user_competency_course extends persistent {
ORDER BY p.timesproficient ASC, c.id DESC';
$results = $DB->get_records_sql($sql, $params, $skip, $limit);
$a = $DB->get_records_sql('SELECT * from {' . self::TABLE . '}');
$comps = array();
foreach ($results as $r) {
+1 -1
View File
@@ -66,7 +66,7 @@ class user_competency_plan extends persistent {
),
'sortorder' => array(
'type' => PARAM_INT,
'default' => null,
'default' => 0,
),
);
}
+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);
+41 -4
View File
@@ -281,8 +281,7 @@ class core_competency_external_testcase extends externallib_advanced_testcase {
'idnumber' => 'idnumber' . $number,
'description' => 'description' . $number,
'descriptionformat' => FORMAT_HTML,
'competencyframeworkid' => $frameworkid,
'sortorder' => 0
'competencyframeworkid' => $frameworkid
);
$result = external::create_competency($competency);
return (object) external_api::clean_returnvalue(external::create_competency_returns(), $result);
@@ -294,8 +293,7 @@ class core_competency_external_testcase extends externallib_advanced_testcase {
'shortname' => 'shortname' . $number,
'idnumber' => 'idnumber' . $number,
'description' => 'description' . $number,
'descriptionformat' => FORMAT_HTML,
'sortorder' => 0
'descriptionformat' => FORMAT_HTML
);
$result = external::update_competency($competency);
return external_api::clean_returnvalue(external::update_competency_returns(), $result);
@@ -2803,4 +2801,43 @@ class core_competency_external_testcase extends externallib_advanced_testcase {
$result = external::update_course_competency_settings($course->id, array('pushratingstouserplans' => true));
}
/**
* Test that we can list competencies with a filter.
*
* @return void
*/
public function test_list_competencies_with_filter() {
$this->resetAfterTest(true);
$this->setAdminUser();
$dg = $this->getDataGenerator();
$lpg = $this->getDataGenerator()->get_plugin_generator('core_competency');
$framework = $lpg->create_framework();
$c1 = $lpg->create_competency(array('competencyframeworkid' => $framework->get('id')));
$c2 = $lpg->create_competency(array('competencyframeworkid' => $framework->get('id')));
$c3 = $lpg->create_competency(array('competencyframeworkid' => $framework->get('id')));
$c4 = $lpg->create_competency(array('competencyframeworkid' => $framework->get('id')));
$c5 = $lpg->create_competency(array('competencyframeworkid' => $framework->get('id')));
// Test if removing competency from plan don't create sortorder holes.
$filters = [];
$sort = 'id';
$order = 'ASC';
$skip = 0;
$limit = 0;
$result = external::list_competencies($filters, $sort, $order, $skip, $limit);
$this->assertCount(5, $result);
$result = external::list_competencies($filters, $sort, $order, 2, $limit);
$this->assertCount(3, $result);
$result = external::list_competencies($filters, $sort, $order, 2, 2);
$this->assertCount(2, $result);
$filter = $result[0]->shortname;
$filters[0] = ['column' => 'shortname', 'value' => $filter];
$result = external::list_competencies($filters, $sort, $order, $skip, $limit);
$this->assertCount(1, $result);
$this->assertEquals($filter, $result[0]->shortname);
}
}
+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);
+1 -1
View File
@@ -169,7 +169,7 @@ class core_completion_external extends external_api {
$completion = new completion_info($course);
$activities = $completion->get_activities();
$progresses = $completion->get_progress_all();
$progresses = $completion->get_progress_all('u.id = :uid', ['uid' => $params['userid']]);
$userprogress = $progresses[$user->id];
$results = array();
@@ -279,7 +279,8 @@ class completion_criteria_activity extends completion_criteria {
$details['requirement'][] = get_string('markingyourselfcomplete', 'completion');
} elseif ($cm->completion == COMPLETION_TRACKING_AUTOMATIC) {
if ($cm->completionview) {
$details['requirement'][] = get_string('viewingactivity', 'completion', $this->module);
$modulename = core_text::strtolower(get_string('modulename', $this->module));
$details['requirement'][] = get_string('viewingactivity', 'completion', $modulename);
}
if (!is_null($cm->completiongradeitemnumber)) {
+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';
+1 -1
View File
@@ -88,7 +88,7 @@ class course_edit_form extends moodleform {
}
} else {
if (has_capability('moodle/course:changecategory', $coursecontext)) {
$displaylist = coursecat::make_categories_list('moodle/course:create');
$displaylist = coursecat::make_categories_list('moodle/course:changecategory');
if (!isset($displaylist[$course->category])) {
//always keep current
$displaylist[$course->category] = coursecat::get($course->category, MUST_EXIST, true)->get_formatted_name();
+14 -4
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
@@ -503,10 +504,10 @@ class core_course_external extends external_api {
$courseinfo['groupmode'] = $course->groupmode;
$courseinfo['groupmodeforce'] = $course->groupmodeforce;
$courseinfo['defaultgroupingid'] = $course->defaultgroupingid;
$courseinfo['lang'] = $course->lang;
$courseinfo['lang'] = clean_param($course->lang, PARAM_LANG);
$courseinfo['timecreated'] = $course->timecreated;
$courseinfo['timemodified'] = $course->timemodified;
$courseinfo['forcetheme'] = $course->theme;
$courseinfo['forcetheme'] = clean_param($course->theme, PARAM_THEME);
$courseinfo['enablecompletion'] = $course->enablecompletion;
$courseinfo['completionnotify'] = $course->completionnotify;
$courseinfo['courseformatoptions'] = array();
@@ -1725,7 +1726,7 @@ class core_course_external extends external_api {
$categoryinfo['visible'] = $category->visible;
$categoryinfo['visibleold'] = $category->visibleold;
$categoryinfo['timemodified'] = $category->timemodified;
$categoryinfo['theme'] = $category->theme;
$categoryinfo['theme'] = clean_param($category->theme, PARAM_THEME);
}
$categoriesinfo[] = $categoryinfo;
@@ -3067,6 +3068,14 @@ class core_course_external extends external_api {
foreach ($coursefields as $field) {
$coursesdata[$course->id][$field] = $course->{$field};
}
// Clean lang and auth fields for external functions (it may content uninstalled themes or language packs).
if (isset($coursesdata[$course->id]['theme'])) {
$coursesdata[$course->id]['theme'] = clean_param($coursesdata[$course->id]['theme'], PARAM_THEME);
}
if (isset($coursesdata[$course->id]['lang'])) {
$coursesdata[$course->id]['lang'] = clean_param($coursesdata[$course->id]['lang'], PARAM_LANG);
}
}
return array(
@@ -3135,6 +3144,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;
}
+1 -1
View File
@@ -636,7 +636,7 @@ class core_course_renderer extends plugin_renderer_base {
}
} else {
$linkclasses .= ' dimmed';
$textclasses .= ' dimmed_text';
$textclasses .= ' dimmed dimmed_text';
}
return array($linkclasses, $textclasses);
}
+15
View File
@@ -2209,6 +2209,21 @@ class core_course_externallib_testcase extends externallib_advanced_testcase {
$this->assertCount(0, $result['courses']);
}
/**
* Test get_courses_by_field_invalid_theme_and_lang
*/
public function test_get_courses_by_field_invalid_theme_and_lang() {
$this->resetAfterTest(true);
$this->setAdminUser();
$course = self::getDataGenerator()->create_course(array('theme' => 'kkt', 'lang' => 'kkl'));
$result = core_course_external::get_courses_by_field('id', $course->id);
$result = external_api::clean_returnvalue(core_course_external::get_courses_by_field_returns(), $result);
$this->assertEmpty($result['courses']['0']['theme']);
$this->assertEmpty($result['courses']['0']['lang']);
}
public function test_check_updates() {
global $DB;
$this->resetAfterTest(true);
+1 -1
View File
@@ -25,4 +25,4 @@
$string['category:config'] = 'Configure category enrol instances';
$string['category:synchronised'] = 'Role assignments synchronised to course enrolment';
$string['pluginname'] = 'Category enrolments';
$string['pluginname_desc'] = 'Category enrolment plugin is a legacy solution for enrolments at the course category level via role assignments. It is recommended to use cohort synchronisation instead.';
$string['pluginname_desc'] = 'The category enrolments plugin synchronises any role assignments in the category context for roles with the capability enrol/category:synchronised allowed.';
+3 -3
View File
@@ -253,7 +253,7 @@ class core_enrol_external extends external_api {
'preferences' => new external_multiple_structure(
new external_single_structure(
array(
'name' => new external_value(PARAM_ALPHANUMEXT, 'The name of the preferences'),
'name' => new external_value(PARAM_RAW, 'The name of the preferences'),
'value' => new external_value(PARAM_RAW, 'The value of the custom field'),
)
), 'User preferences', VALUE_OPTIONAL),
@@ -342,7 +342,7 @@ class core_enrol_external extends external_api {
'summaryformat' => $course->summaryformat,
'format' => $course->format,
'showgrades' => $course->showgrades,
'lang' => $course->lang,
'lang' => clean_param($course->lang, PARAM_LANG),
'enablecompletion' => $course->enablecompletion,
'category' => $course->category,
'progress' => $progress,
@@ -634,7 +634,7 @@ class core_enrol_external extends external_api {
'preferences' => new external_multiple_structure(
new external_single_structure(
array(
'name' => new external_value(PARAM_ALPHANUMEXT, 'The name of the preferences'),
'name' => new external_value(PARAM_RAW, 'The name of the preferences'),
'value' => new external_value(PARAM_RAW, 'The value of the custom field'),
)
), 'User preferences', VALUE_OPTIONAL),
@@ -206,7 +206,7 @@ class enrol_imsenterprise_testcase extends advanced_testcase {
$this->set_xml_file(array($imsuser));
$this->imsplugin->cron();
$this->assertEquals(1, $DB->get_field('user', 'deleted', array('id' => $user->id), '*', MUST_EXIST));
$this->assertEquals(1, $DB->get_field('user', 'deleted', array('id' => $user->id), MUST_EXIST));
}
/**
@@ -227,7 +227,7 @@ class enrol_imsenterprise_testcase extends advanced_testcase {
$this->set_xml_file(array($imsuser));
$this->imsplugin->cron();
$this->assertEquals(0, $DB->get_field('user', 'deleted', array('id' => $user->id), '*', MUST_EXIST));
$this->assertEquals(0, $DB->get_field('user', 'deleted', array('id' => $user->id), MUST_EXIST));
}
/**
+8 -1
View File
@@ -376,8 +376,12 @@ class core_enrol_externallib_testcase extends externallib_advanced_testcase {
'enddate' => $timenow + WEEKSECS
);
$coursedata2 = array(
'lang' => 'kk', // Check invalid language pack.
);
$course1 = self::getDataGenerator()->create_course($coursedata1);
$course2 = self::getDataGenerator()->create_course();
$course2 = self::getDataGenerator()->create_course($coursedata2);
$courses = array($course1, $course2);
// Enrol $USER in the courses.
@@ -414,6 +418,9 @@ class core_enrol_externallib_testcase extends externallib_advanced_testcase {
foreach ($coursedata1 as $fieldname => $value) {
$this->assertEquals($courseenrol[$fieldname], $course1->$fieldname);
}
} else {
// Check language pack. Should be empty since an incorrect one was used when creating the course.
$this->assertEmpty($courseenrol['lang']);
}
}
}
+3 -3
View File
@@ -127,7 +127,7 @@ class converter {
if ($status === conversion::STATUS_PENDING || $status === conversion::STATUS_FAILED) {
// The current status is either pending or failed.
// Attempt to pick up a new converter and convert the document.
$from = \core_filetypes::get_file_extension($file->get_mimetype());
$from = pathinfo($file->get_filename(), PATHINFO_EXTENSION);
$converters = $this->get_document_converter_classes($from, $format);
$currentconverter = $this->get_next_converter($converters, $conversion->get('converter'));
@@ -225,9 +225,9 @@ class converter {
return false;
}
$from = \core_filetypes::get_file_extension($file->get_mimetype());
$from = pathinfo($file->get_filename(), PATHINFO_EXTENSION);
if (!$from) {
// No mime type could be found. Unable to determine converter.
// No file extension could be found. Unable to determine converter.
return false;
}
@@ -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");
+2 -3
View File
@@ -341,7 +341,7 @@ class core_files_converter_testcase extends advanced_testcase {
}
/**
* Test the can_convert_storedfile_to function with a file with indistinguished mimetype.
* Test the can_convert_storedfile_to function with a file with a known mimetype and extension.
*/
public function test_can_convert_storedfile_to_docx() {
$returnvalue = (object) [];
@@ -352,8 +352,7 @@ class core_files_converter_testcase extends advanced_testcase {
$types = \core_filetypes::get_types();
// A file with filename '.' is a directory.
$file = $this->get_stored_file('example content', 'example', [
$file = $this->get_stored_file('example content', 'example.docx', [
'mimetype' => $types['docx']['type'],
]);
+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';
+4 -4
View File
@@ -185,8 +185,8 @@ class grading_manager {
} else if ($this->get_context()->contextlevel >= CONTEXT_COURSE) {
list($context, $course, $cm) = get_context_info_array($this->get_context()->id);
if (strval($cm->name) !== '') {
$title = $cm->name;
if ($cm && strval($cm->name) !== '') {
$title = format_string($cm->name, true, array('context' => $context));
} else {
debugging('Gradable areas are currently supported at the course module level only', DEBUG_DEVELOPER);
$title = $this->get_component();
@@ -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()) {
+1 -1
View File
@@ -17,7 +17,7 @@
/**
* Unit tests for grade/edit/tree/lib.php.
*
* @pacakge core_grade
* @package core_grades
* @category phpunit
* @author Andrew Davis
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
+1 -1
View File
@@ -17,7 +17,7 @@
/**
* Unit tests for grade/import/lib.php.
*
* @package core_grade
* @package core_grades
* @category phpunit
* @copyright 2015 Adrian Greeve <adrian@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
+1 -1
View File
@@ -17,7 +17,7 @@
/**
* Unit tests for grade quering
*
* @pacakge core_grade
* @package core_grades
* @category phpunit
* @copyright 2011 Petr Skoda {@link http://skodak.org}
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
+1 -1
View File
@@ -17,7 +17,7 @@
/**
* Unit tests for grade/report/user/lib.php.
*
* @package core_grade
* @package core_grades
* @category phpunit
* @copyright 2012 Andrew Davis
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
+1 -1
View File
@@ -17,7 +17,7 @@
/**
* Unit tests for grade/report/lib.php.
*
* @pacakge core_grade
* @package core_grades
* @category phpunit
* @author Andrew Davis
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License

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