Compare commits

..

539 Commits

Author SHA1 Message Date
Andrew Nicols 2288e60615 Moodle release 3.5.10 2020-01-10 13:03:30 +08:00
Andrew Nicols f951911682 Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2020-01-10 13:03:27 +08:00
AMOS bot ad262b981f Automatically generated installer lang files 2020-01-10 00:12:37 +00:00
Sara Arjona da4ffac0c9 weekly release 3.5.9+ 2020-01-09 15:42:57 +01:00
Eloy Lafuente (stronk7) 702c4b4781 Merge branch 'MDL-67469-35' of git://github.com/junpataleta/moodle into MOODLE_35_STABLE 2020-01-07 23:00:29 +01:00
Jake Dallimore fedba1fcc4 weekly release 3.5.9+ 2020-01-03 11:25:21 +08:00
Jake Dallimore de96ddee74 Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2020-01-03 11:25:18 +08:00
AMOS bot 7b6a902ccd Automatically generated installer lang files 2020-01-03 00:12:31 +00:00
Adrian Greeve a0a03baad8 Merge branch 'MDL-67599-35' of https://github.com/snake/moodle into MOODLE_35_STABLE 2020-01-02 15:19:39 +08:00
Jake Dallimore e37073a24b MDL-67599 behat: fix behat tests assuming Jan 2020 is a future date 2020-01-02 13:56:16 +08:00
AMOS bot 9f59264afa Automatically generated installer lang files 2020-01-02 00:10:44 +00:00
Eloy Lafuente (stronk7) 7f4be41ed2 Merge branch 'MDL-67593-35' of https://github.com/snake/moodle into MOODLE_35_STABLE 2019-12-31 10:51:22 +01:00
Jake Dallimore 3dec6b78ce MDL-67593 core_iplookup: update lang string describing download process
Let users know they need to register on maxmind before granted download
access.
2019-12-31 15:59:41 +08:00
Jake Dallimore e3e41170fe MDL-67593 core_iplookup: use MaxMind test database in unit tests
Instead of downloading a live database (now not available publicly)
use a local test database.
2019-12-31 15:58:27 +08:00
Jun Pataleta 7c6be5b319 Merge branch 'MDL-63996-35' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2019-12-31 15:18:41 +08:00
Adrian Greeve 0613e56e69 Merge branch 'MDL-65809-35-onlyenv' of git://github.com/sarjona/moodle into MOODLE_35_STABLE 2019-12-24 14:58:52 +08:00
AMOS bot a3065e8220 Automatically generated installer lang files 2019-12-21 00:11:20 +00:00
Andrew Nicols f496b55189 MDL-63996 core/tags: Pending JS for all tag code 2019-12-18 12:02:54 +08:00
Andrew Nicols 135461b4a9 MDL-63996 behat: Fix multi-tag autocomplete usage 2019-12-18 10:25:57 +08:00
AMOS bot 8253f41405 Automatically generated installer lang files 2019-12-14 00:11:15 +00:00
AMOS bot cf0b79a80f Automatically generated installer lang files 2019-12-13 00:11:32 +00:00
AMOS bot 1a8dc02878 Automatically generated installer lang files 2019-12-11 13:50:31 +00:00
Jun Pataleta 5b3ec84495 MDL-67469 tool_dataprivacy: Put back missing test code
This patch simply brings back the missing test code for
\tool_dataprivacy_api_testcase::test_approve_data_request_non_dpo_user()
2019-12-06 16:11:38 +08:00
AMOS bot 0608b35a7b Automatically generated installer lang files 2019-12-06 00:10:04 +00:00
Sara Arjona abb5f229b1 MDL-65809 environment: mbstring extension required 2019-12-05 14:02:15 +01:00
Sara Arjona e2fd22fadd MDL-65809 environment: PHP 7.2 required 2019-12-05 14:02:15 +01:00
Sara Arjona 18c824af1f MDL-65809 environment: postgres requirement up to 9.5 2019-12-05 14:02:15 +01:00
Sara Arjona 37ce725987 MDL-65809 environment: mariadb requirement up to 10.2 2019-12-05 14:02:15 +01:00
Sara Arjona 8ac6793716 MDL-65809 environment: 3.5 (LTS) required 2019-12-05 14:02:15 +01:00
Sara Arjona 6022706b47 MDL-65809 environment: 3.9 base information
This is a direct copy of the 3.8 branch to have changes
under control easier in next commits.
2019-12-05 14:02:15 +01:00
Eloy Lafuente (stronk7) 250ea6a145 weekly release 3.5.9+ 2019-11-22 00:17:00 +01:00
Andrew Nicols 039096d1b1 Merge branch 'MDL-48024_35' of https://github.com/stronk7/moodle into MOODLE_35_STABLE 2019-11-21 19:45:47 +08:00
Eloy Lafuente (stronk7) 0ca3442925 MDL-48024 quiz: return void is only php >= 71
this branch supports php 70, so taking rid of it
2019-11-21 12:34:50 +01:00
Tim Hunt 1a4626d9fa MDL-48024 behat: allow plugins to have data generators
This extends the step
Given the following "users" exist:
to also support things like
Given the following "mod_quiz > user overrides" exist:

Instructions are on the behat_data_generators and
behat_generator_base classes.
2019-11-21 09:38:37 +08:00
Eloy Lafuente (stronk7) fa0b5768cc Moodle release 3.5.9 2019-11-09 11:57:38 +01:00
Sara Arjona 7b33c5e9ec weekly release 3.5.8+ 2019-11-08 15:39:52 +01:00
Sara Arjona d394a22ee6 Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2019-11-08 15:39:50 +01:00
Adrian Greeve 83fe3c44c0 Merge branch 'MDL-67169_35' of https://github.com/stronk7/moodle into MOODLE_35_STABLE 2019-11-08 10:46:34 +08:00
Sara Arjona 282c4224da Merge branch 'MDL-66683-35' of git://github.com/cescobedo/moodle into MOODLE_35_STABLE 2019-11-07 17:41:53 +01:00
cescobedo 1312197a82 MDL-66683 core: Revert MDL-66181 because created regressions
This reverts commit ed080a580f.
This issue reverts the behaviour modified in MDL-66181, as that change
negatively impacted course-creation workflows. As this appears to be
the intended functionality, the Security team has agreed to revert
this change.
2019-11-07 17:31:25 +01:00
Jake Dallimore 5dc6fd3b23 MDL-66257 tool_cohortroles: unit test for users in multiple cohorts 2019-11-07 23:48:43 +08:00
cescobedo b49b76f397 MDL-66257 tool_cohortroles: Unassign the role on removal cohortroles. 2019-11-07 23:48:43 +08:00
Eloy Lafuente (stronk7) a4f4656110 MDL-67169 phpunit: fix clear flaw in unit test provider
Basically the provider is ignoring the CRLF to LF normalization
results and loading the original file again.

This doesn't have any impact normally, because all moodle
files are LF ones and people using other systems have their
git configurations set to work that way (not modify or force LF).

But there may be checkouts out there (for example travis) where
the git configuration by defult is to convert to the OS, causing
windows runs to fail badly there. See the issue for more info
and links.
2019-11-07 13:42:35 +01:00
Jun Pataleta 83bdb872dc MDL-66598 auth_oauth2: OAuth2 upgrade step
This basically does two things:
1. Updates all non-Facebook/Google/Microsoft issuers and sets their
'requireconfirmation' field to 1 so that future OAuth2 logins on these
issuers will always have an email confirmation sent to them.
2. Deletes the linked logins of users with non-Facebook/Google/Microsoft
OAuth2 issuers.
2019-11-07 18:46:05 +08:00
Jun Pataleta 39a83aa250 MDL-66598 auth_oauth2: Add warning messages in confirm emails 2019-11-07 18:46:05 +08:00
Jun Pataleta e70853386d MDL-66598 tool_oauth2: Make account confirmation required by default
* Only Facebook, Google, and Microsoft issuers can optionally offer to
require account confirmation via email. We will require email
confirmation for the rest of the issuers.
2019-11-07 18:46:05 +08:00
AMOS bot 451d514d84 Automatically generated installer lang files 2019-11-06 00:16:53 +00:00
Michael Hawkins 72f5a6e119 MDL-66161 output: Escaping fatal error message and URL strings 2019-11-05 13:51:42 +01:00
Paul Holden 7f624852e4 MDL-66228 mod_lesson: ensure return URL parameters are always local. 2019-11-05 13:51:42 +01:00
Eloy Lafuente (stronk7) 8abe8980d6 weekly release 3.5.8+ 2019-11-05 13:34:17 +01:00
Eloy Lafuente (stronk7) 431c7ba150 Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2019-11-05 13:34:14 +01:00
Jake Dallimore 9b632e17d8 Merge branch 'MDL-67009_35' of https://github.com/stronk7/moodle into MOODLE_35_STABLE 2019-11-04 14:57:19 +08:00
AMOS bot b731ea9798 Automatically generated installer lang files 2019-11-02 00:09:46 +00:00
Eloy Lafuente (stronk7) 472b1b095e weekly release 3.5.8+ 2019-10-29 21:01:29 +01:00
Eloy Lafuente (stronk7) 2cddf32f7e Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2019-10-29 21:01:22 +01:00
Jake Dallimore 9b898bf8b4 Merge branch 'MDL-66945_35' of git://github.com/stronk7/moodle into MOODLE_35_STABLE 2019-10-29 14:57:04 +08:00
Andrew Nicols a87d3a64bb MDL-66945 composer: Update behat extension
(using php70 for this branch)

This uses a new version of the moodlehq-behat-extension which ensures
that a node is visible and in the view port before it is clicked on.

This resolves an issue with Firefox on Ubuntu 18.04 whereby the node is
only brought into the viewport instead of clicked on.
2019-10-28 13:44:27 +01:00
AMOS bot 55cd43d397 Automatically generated installer lang files 2019-10-28 00:09:34 +00:00
AMOS bot 9c1462ecfe Automatically generated installer lang files 2019-10-27 00:09:31 +00:00
Eloy Lafuente (stronk7) e22aba78ca weekly release 3.5.8+ 2019-10-25 15:29:30 +02:00
Eloy Lafuente (stronk7) d952f227d0 Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2019-10-25 15:29:26 +02:00
Jake Dallimore d80cec9c2b Merge branch 'MOODLE_35_MDL-66973' of https://github.com/golenkovm/moodle into MOODLE_35_STABLE 2019-10-25 11:11:16 +08:00
Eloy Lafuente (stronk7) 77fe56108a MDL-67009 behat: get rid of invalid void type hinting for php70 2019-10-24 10:50:30 +02:00
AMOS bot 03550b7b8f Automatically generated installer lang files 2019-10-24 00:09:42 +00:00
Mikhail Golenkov 274ccc948b MDL-66973 search: Reset Content writer after test. 2019-10-22 09:41:46 +11:00
AMOS bot bc8d5da483 Automatically generated installer lang files 2019-10-19 00:09:35 +00:00
Eloy Lafuente (stronk7) 94bf3e9c78 weekly release 3.5.8+ 2019-10-18 10:31:16 +02:00
Andrew Nicols e92bd648db Merge branch 'MDL-66919_35' of https://github.com/stronk7/moodle into MOODLE_35_STABLE 2019-10-18 08:29:48 +08:00
Eloy Lafuente (stronk7) e4bb1cc603 MDL-66919 behat: fix typo in error message
Also fix a couple of phpdocs that were incorrect.
2019-10-16 00:49:32 +02:00
Eloy Lafuente (stronk7) c2f12aa742 weekly release 3.5.8+ 2019-10-15 22:59:44 +02:00
Jun Pataleta 454af7cf52 Merge branch 'MDL-66821_35' of https://github.com/timhunt/moodle into MOODLE_35_STABLE 2019-10-15 07:35:57 +08:00
Andrew Nicols f73e64f166 Merge branch 'MDL-66335_35' of https://github.com/stronk7/moodle into MOODLE_35_STABLE 2019-10-15 07:32:17 +08:00
Eloy Lafuente (stronk7) 18a738f88f MDL-66335 behat: Avoid double processing the page type
resolve_page_instance_helper() already processes the type, returning
the correct context that should be processing the navigation URL.

With that extra call to parse_page_name() the 2nd call always returns
"core", ultimately leading to tons of behat failures because "core" is
not aware of those (plugin, quiz for now) pages typology.
2019-10-15 00:04:54 +02:00
Eloy Lafuente (stronk7) 493a30cdc2 Merge branch 'MDL-66335_35' of https://github.com/timhunt/moodle into MOODLE_35_STABLE 2019-10-14 19:22:28 +02:00
Eloy Lafuente (stronk7) 65edc59a51 Merge branch 'MDL-66559-35' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2019-10-14 16:41:29 +02:00
Tim Hunt 28b9209af5 MDL-66335 quiz behat: using the new generic navigation steps
This converts all the navigation to quiz pages when that is not
the thing under test. Also, I decided that the Quiz settings form
belonged to the course, so did not do that here.
2019-10-14 13:20:29 +01:00
Tim Hunt 8b2c91e627 MDL-66335 behat: new step to log in and go straight to a particular page
I did not think thought through if this new URL parameter would be a
potential security hole. The simple cop-out option is to make it only
work on Behat sites for now.
2019-10-14 13:17:11 +01:00
Tim Hunt 8256d18453 MDL-66335 behat: generic step for navigating direct to specific pages 2019-10-14 13:15:27 +01:00
Tim Hunt ab11164395 MDL-66821 question behat: new step for acting on question in the bank
There is a proposed change MDL-66816 which will change the question
bank UI. This will break any Behat tests which uses low-level steps
like

    When I click on "Duplicate" "link" in the "Test question" "table_row"

to perform an action on a question in the question bank. This commit
introduces a new step:

    When I "Duplicate" the "Test question" question in the question bank

This commit also converts all core Behat tests to use the new step.
2019-10-14 12:02:42 +01:00
Andrew Nicols 29933a945f MDL-66559 behat: Register component selectors earlier 2019-10-14 14:24:05 +08:00
Andrew Nicols c7b384ce66 MDL-66559 behat: Update running suite 2019-10-14 14:17:47 +08:00
Jake Dallimore 665e256961 Merge branch 'MDL-66559-35' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2019-10-14 11:10:56 +08:00
Andrew Nicols 879532b41f MDL-66779 phpunit: Correct component name for core_grades 2019-10-13 02:34:16 +02:00
Eloy Lafuente (stronk7) 4e83a79cd5 weekly release 3.5.8+ 2019-10-11 22:43:20 +02:00
Eloy Lafuente (stronk7) 3ecba892e3 Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2019-10-11 22:43:07 +02:00
Tim Hunt b92f4ba9f1 MDL-66559 behat: Documentation for component selectors 2019-10-11 12:58:16 +08:00
Andrew Nicols 6a3a83af93 MDL-66559 behat: Allow per-component selectors and replacements 2019-10-11 12:58:16 +08:00
AMOS bot 6e3a070030 Automatically generated installer lang files 2019-10-11 00:11:51 +00:00
Tim Hunt 5d701a706c MDL-66815 behat: question category generator must find right parent id
This is implemented in a bit of a hacky way, because the only other
alternative would be a large rewrite of the whole class, which is
not feasible for me right now. Note that many other types of thing
that can be generated suffer from the same issue. (E.g. if you ever
wanted to generate two groups with the same name in two different
courses and then add group memebers.)

It is worth doing a special-case fix for question categories, because
way Moodle works, it is inevitable that we end up with many categories
called 'top' in the database.
2019-10-11 00:51:39 +02:00
AMOS bot 612e4d9d02 Automatically generated installer lang files 2019-10-10 00:09:44 +00:00
Jun Pataleta df6f010a86 Merge branch 'MDL-66835_35' of https://github.com/timhunt/moodle into MOODLE_35_STABLE 2019-10-09 20:44:17 +08:00
Tim Hunt bf4904c32b MDL-66835 behat: steps for setting/checking fields in containers 2019-10-09 13:24:03 +01:00
Jun Pataleta 2821f78e6c weekly release 3.5.8+ 2019-09-27 11:12:16 +08:00
Jun Pataleta f904215fa7 Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2019-09-27 11:12:15 +08:00
Jun Pataleta 635b605eab Merge branch 'MDL-66262_35' of git://github.com/stronk7/moodle into MOODLE_35_STABLE 2019-09-26 11:34:26 +08:00
Eloy Lafuente (stronk7) 08dd41b304 Merge branch 'MDL-66675-35' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2019-09-25 20:06:38 +02:00
AMOS bot 04cd0cb2ca Automatically generated installer lang files 2019-09-22 00:09:35 +00:00
Andrew Nicols 5cacda33bb MDL-66675 behat: Fix typo in step function name 2019-09-19 07:30:56 +08:00
Andrew Nicols 864ef22534 MDL-66675 behat: Add option to pause on behat failures 2019-09-19 07:30:55 +08:00
Andrew Nicols f008a03c60 MDL-66675 CLI: Add ANSI formatting options 2019-09-19 07:30:54 +08:00
Eloy Lafuente (stronk7) 8831cc14c7 MDL-66262 env: Moodle 3.6.x and 3.7.x do not support PHP 7.4 2019-09-13 17:44:58 +02:00
Jake Dallimore ebb87a1e63 weekly release 3.5.8+ 2019-09-13 11:30:14 +08:00
Jake Dallimore 93d9b19607 Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2019-09-13 11:30:13 +08:00
Eloy Lafuente (stronk7) 92d04a7913 Merge branch 'MDL-66550-35-2' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2019-09-12 15:32:14 +02:00
Andrew Nicols a5cdde3c79 MDL-66550 admin: The execute wrapper MUST be used in behat 2019-09-12 15:46:04 +08:00
Andrew Nicols d073f5daf0 MDL-66550 theme: Wrap JS calls in pendingJS 2019-09-12 14:59:03 +08:00
AMOS bot 3972ef0a32 Automatically generated installer lang files 2019-09-12 00:09:38 +00:00
Jake Dallimore 01b63287ef Merge branch 'MDL-66550-35-2' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2019-09-11 10:42:07 +08:00
Andrew Nicols b3259b51bb MDL-66550 forum: Target fields in a fieldset for behat test 2019-09-10 21:24:20 +08:00
Andrew Nicols b683a48f69 MDL-66550 behat: Transform fields to search in a fieldset 2019-09-10 21:24:20 +08:00
Andrew Nicols 944888a509 MDL-66550 behat: Standardise finding in core functionality 2019-09-10 21:24:20 +08:00
Andrew Nicols 21ac04e12e MDL-66550 behat: Add ability to transform a specific selector 2019-09-10 21:24:15 +08:00
Andrew Nicols ab9b65b6a7 MDL-66550 behat: Normalise selectors better 2019-09-10 21:24:07 +08:00
Jake Dallimore 4a852e8467 Moodle release 3.5.8 2019-09-06 11:50:39 +08:00
Eloy Lafuente (stronk7) 9c211250ed weekly release 3.5.7+ 2019-09-05 17:14:30 +02:00
Eloy Lafuente (stronk7) a4eb84f12f Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2019-09-05 17:14:27 +02:00
AMOS bot 1e3da12a5f Automatically generated installer lang files 2019-09-05 00:12:14 +00:00
Ryan Wyllie d5ac2c69cf MDL-62284 javascript: prevent nested JS mustache handler calls
Prevent the JS mustache helper from being executed from within
the render call of another mustache helper because it can allow
users to inject JS into the page.
2019-09-04 11:24:34 +08:00
Ryan Wyllie 3cf2cce110 MDL-62284 output: prevent nested JS mustache handler calls
Prevent the JS mustache helper from being executed from within
the render call of another mustache helper because it can allow
users to inject JS into the page.
2019-09-04 11:24:34 +08:00
Jake Dallimore 1df418416b Merge branch 'MDL-66265-35' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2019-09-04 11:07:44 +08:00
Andrew Nicols fdee2f256c MDL-66265 javascript: More specific overrides in eslintrc 2019-09-04 10:49:17 +08:00
Eloy Lafuente (stronk7) 15974729df Merge branch 'MDL-66265-35' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2019-09-04 02:15:49 +02:00
Eloy Lafuente (stronk7) 99f8dea24b Merge branch 'MDL-66532-35' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2019-09-04 02:01:46 +02:00
Andrew Nicols 27829f24e1 MDL-66265 javascript: Add jshint ignore for ES6 files in root dir 2019-09-04 06:53:54 +08:00
Andrew Nicols 6fd3764d99 MDL-66265 javascript: Add basic jshint ignores 2019-09-04 06:53:53 +08:00
Andrew Nicols 8563f23446 MDL-66265 javascript: Bump jshint version 2019-09-04 06:53:52 +08:00
Andrew Nicols 033afe1028 MDL-66532 javascript: Lock NPM version for NVM 2019-09-04 06:53:52 +08:00
Andrew Nicols c21f3b540b MDL-66532 javascript: Lock NPM version for NVM 2019-09-04 06:45:51 +08:00
AMOS bot 9fa3c6756e Automatically generated installer lang files 2019-09-03 00:11:49 +00:00
Eloy Lafuente (stronk7) d543802d90 Merge branch 'MDL-66457-35' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2019-09-03 00:55:14 +02:00
Juan Leyva 374d0b4702 MDL-66501 tool_mobile: Prevent URLs in custom scheme 2019-09-02 15:30:19 +08:00
Andrew Nicols 043da28910 MDL-66457 behat: simplify selector search 2019-08-30 15:13:07 +08:00
Jun Pataleta b35de2fdf0 MDL-66187 format_singleactivity: Make sure available types is not empty 2019-08-30 07:21:39 +02:00
Andrew Nicols 2b1b27dfbd MDL-66187 course: Respect :addinstance in single activity format 2019-08-30 07:21:39 +02:00
Simey Lameze bd370cda69 MDL-65749 lib: fix phpmailer file handling 2019-08-30 07:21:39 +02:00
Andrew Nicols 86cbf2a643 MDL-66181 course: Only assign roles that the user is allowed to assign 2019-08-30 07:21:39 +02:00
Andrew Nicols d33ae6c0cc MDL-66181 behat: You check checkboxes, not click them 2019-08-30 07:21:39 +02:00
Michael Hawkins 61b51f93ef MDL-55451 mod_forum: Limit subscription redirect to internal URLs 2019-08-30 07:21:39 +02:00
David Monllaó eb2f9593a7 MDL-66069 mlbackend_python: Bump to a new version of the package 2019-08-30 07:21:39 +02:00
Jake Dallimore e8b6cb418f weekly release 3.5.7+ 2019-08-30 13:12:06 +08:00
Jake Dallimore f8798a6b07 Merge branch 'MDL-66139_35' of https://github.com/stronk7/moodle into MOODLE_35_STABLE 2019-08-29 11:52:15 +08:00
Netica Informática 75259ad00f MDL-66139 cachestore_redis: Fix connection problems when port is not set
Due to some changes in Redis 5 php extension Moodle fails to connect via TCP when
no port is set. It's fixed upstream in phpredis repo (version 5.0.0, 5.0.1 and
5.0.2 affected so far), but with this patch we'll send the right port anyway.
2019-08-28 20:59:59 +02:00
Luca Bösch e149838c2a MDL-63852 behat: Using correct exception class path. 2019-08-28 17:43:27 +02:00
Eloy Lafuente (stronk7) 7e0c5d1c38 MDL-66184 core: Update composer to apply for php 7.0.0 as min
With behat extension v3.35.3 we started requiring php 7.0.0
(same requirement than core 3.5.x). This bumps all the components
in the lock file to suit that requirement.

Generated with php 7.0.x.
2019-08-27 00:25:28 +02:00
Eloy Lafuente (stronk7) b78a289579 Merge branch 'MDL-66312-35' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2019-08-26 19:43:10 +02:00
Adrian Greeve de168198e6 weekly release 3.5.7+ 2019-08-23 12:55:16 +08:00
Adrian Greeve d4cd76a5c8 Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2019-08-23 12:55:08 +08:00
Adrian Greeve 7430be37c5 Merge branch 'MDL-66378-35' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2019-08-22 09:32:16 +08:00
Andrew Nicols 327c830b2a MDL-66378 behat: Increase window size for rubric tests 2019-08-22 07:56:19 +08:00
Andrew Nicols f2c38390c9 MDL-66378 behat: Change screen size to small to work around UI bugs 2019-08-22 07:56:19 +08:00
Adrian Greeve 55bbdac9d9 Merge branch 'MDL-66378-35' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2019-08-21 09:04:02 +08:00
Andrew Nicols 7ed867fa20 MDL-66378 behat: Correct grammar of resize step 2019-08-21 08:39:51 +08:00
Andrew Nicols fc6f41655b MDL-66378 grade: Set window size to large for rubric tests 2019-08-21 08:39:28 +08:00
Andrew Nicols 15ddbf3907 MDL-66378 behat: All args are required for document.evaluate 2019-08-21 08:24:08 +08:00
AMOS bot 27b547db5a Automatically generated installer lang files 2019-08-21 00:11:34 +00:00
Adrian Greeve 0d13442b29 Merge branch 'MDL-66378-35' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2019-08-20 14:13:57 +08:00
AMOS bot d1bc79e02a Automatically generated installer lang files 2019-08-20 00:10:59 +00:00
Andrew Nicols 3abca9b368 MDL-66378 course: Navigation tests need small window 2019-08-19 08:16:41 +08:00
Andrew Nicols 3a000a8def MDL-66378 competency: Add pending promises to competency chooser 2019-08-19 08:16:41 +08:00
Andrew Nicols 1c3c38fb00 MDL-66378 behat: JS does not work with newlines in an xpath 2019-08-19 08:16:40 +08:00
Andrew Nicols 86cbd0840b MDL-66378 behat: Fix use of before/after selectors 2019-08-19 08:16:40 +08:00
Andrew Nicols 2ea211e78a MDL-66378 behat: Backport expand autocomplete step 2019-08-18 07:15:00 +08:00
Andrew Nicols b60ec99fec MDL-66378 behat: Add partial named selector for whole autocomplete field 2019-08-18 07:15:00 +08:00
Andrew Nicols 953b1b85da MDL-66378 behat: Before/after detection should be constrainable
The default before/after detection checks the entire body. Any match of
the text will therefore be found.

Add support for specification of a container for the nodes.
2019-08-18 07:15:00 +08:00
Andrew Nicols 45e2df1ce4 MDL-66378 behat: Add non-JS fallback for before/after 2019-08-18 07:15:00 +08:00
sam marshall 9f1149ac13 MDL-66378 Behat: Speed up 'before/after' step in Chrome
On some Chrome versions the xpath used for before/after is slow
and (sometimes) uses a lot of memory. This change uses pure
JavaScript to do the before/after calculation, which should always
be fast.
2019-08-18 07:15:00 +08:00
Andrew Nicols a157baa65a MDL-66378 behat: Correct invalid uses of selection from dropdown 2019-08-18 07:15:00 +08:00
Andrew Nicols 15d2dcf037 MDL-66378 report_participation: Correct label for target 2019-08-18 07:15:00 +08:00
Andrew Nicols 9eab90a827 MDL-66378 gradereport_singleview: Add missing label for dropdown 2019-08-18 07:15:00 +08:00
Andrew Nicols 2bee1f66b9 MDL-66378 behat: Update screen sizes to Y2K standards 2019-08-17 10:32:19 +08:00
Andrew Nicols c3731344e5 MDL-66378 behat: Update dependencies for chrome webdriver fix 2019-08-17 10:32:19 +08:00
Andrew Nicols c46b2eaf18 MDL-66312 js: Autocomplete promises were inside out
The pending promise should nott be resolved until the changes are
complete.
Previously the resolution of the pendingPromise was triggering the other
changes.
2019-08-16 11:56:25 +08:00
Andrew Nicols d6af305bb9 weekly release 3.5.7+ 2019-08-16 11:07:12 +08:00
Andrew Nicols fa319a92b8 Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2019-08-16 11:07:09 +08:00
AMOS bot e11d0e35de Automatically generated installer lang files 2019-08-15 00:13:11 +00:00
Jun Pataleta 313fd64469 Merge branch 'MDL-65925-grade-page-broken-for-deleted-submission-MOODLE_35_STABLE' of https://github.com/ilya-catalyst/moodle into MOODLE_35_STABLE 2019-08-14 15:25:36 +08:00
Ilya Tregubov 9f51263a37 MDL-65925 assign: Grade page broken if submission was deleted. 2019-08-12 09:25:50 +10:00
AMOS bot b375088f23 Automatically generated installer lang files 2019-08-10 00:11:37 +00:00
Jun Pataleta 6cdfbdc119 weekly release 3.5.7+ 2019-08-09 16:23:59 +08:00
Jun Pataleta c3e7a570f3 Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2019-08-09 16:23:58 +08:00
Sara Arjona b12ee51f8b Merge branch 'MDL-66281-35' of git://github.com/junpataleta/moodle into MOODLE_35_STABLE 2019-08-05 13:41:18 +08:00
AMOS bot 9192613a6a Automatically generated installer lang files 2019-08-02 00:11:41 +00:00
AMOS bot 74fc0a9620 Automatically generated installer lang files 2019-08-02 00:11:40 +00:00
AMOS bot 264ea8c7fc Automatically generated installer lang files 2019-07-31 00:09:31 +00:00
Jun Pataleta 06079db957 MDL-66281 tool_dataprivacy: Set sensitive data processing default value 2019-07-30 13:59:42 +08:00
Eloy Lafuente (stronk7) 59c9dd780b weekly release 3.5.7+ 2019-07-25 13:44:49 +02:00
Eloy Lafuente (stronk7) 5ec6a4e462 Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2019-07-25 13:44:48 +02:00
Eloy Lafuente (stronk7) 4ce08a765d Merge branch 'MDL-65788-35' of git://github.com/Chocolate-lightning/moodle into MOODLE_35_STABLE 2019-07-22 21:33:28 +02:00
sam marshall 0498684ae2 MDL-66132 Search: Behat tests should use simpledb, fix mock count
When searching using mock results (the 'global search expects the
query' step), the result count is not correctly set. As a result, the
page incorrectly reports that there are no results and doesn't
correctly show the first page of multi-page results.

Additionally, some of the core Behat tests can now be moved to use
real searching with the simpledb engine, rather than using mock
results at all. This gives better tests.

Unfortunately it was not possible to move all of the core Behat tests
and deprecate the mock step, because some of the tests are related to
the UI for 'special' features searching by user or group, neither of
which are supported by the simpledb engine.
2019-07-22 20:57:10 +02:00
Mihail Geshoski 9a0078f100 MDL-66136 assign: Verify presence of resources in online text submission 2019-07-22 10:44:53 +08:00
Mihail Geshoski d9126f03dc MDL-66136 assignfeedback_comments: Extend testcase 2019-07-22 10:44:41 +08:00
Eloy Lafuente (stronk7) 382fc36eba Merge branch 'MDL-50733_35' of git://github.com/stronk7/moodle into MOODLE_35_STABLE 2019-07-20 00:25:27 +02:00
Mathew May defe05cbcf MDL-50733 core: Update composer to updated behat-extension 2019-07-19 16:41:03 +02:00
Mathew May 71548acf7e MDL-65788 tool_policy: Move accept_policy JS call into an array 2019-07-18 10:51:19 +08:00
Mathew May de75e7471d MDL-65788 tool_policy: Prevent two modals rendering for guests.
With the Guest registration calling policyactions.js the [data-action="view"]
was having two click handlers set on the inital policy modal trgger.
With this commit we state what we want the click event to be set on.
2019-07-18 10:49:58 +08:00
AMOS bot 8635cc3871 Automatically generated installer lang files 2019-07-18 00:09:21 +00:00
Eloy Lafuente (stronk7) a8d72a836c weekly release 3.5.7+ 2019-07-11 23:33:37 +02:00
Eloy Lafuente (stronk7) 140b417065 Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2019-07-11 23:33:35 +02:00
Jun Pataleta 0094a77ccc Merge branch 'MDL-65926-MOODLE_35_STABLE_lowercase_username_sql_query' of https://github.com/andrewmadden/moodle into MOODLE_35_STABLE 2019-07-11 10:59:29 +08:00
Andrew Madden c7f46956d4 MDL-65926 moodlelib: Convert username to lowercase prior to SQL query
Within a very large project, it was found that searching for a user with their username in the user table using a case insensitive
search was inefficient. Instead it is proposed that the username input is made to be lowercase prior to executing a database query
as the username for each user in the database must be lowercase. This allows for a case sensitive query to find the user data.
Essentially we are moving a case insensitive search for a user from SQL into PHP to increase performance.
2019-07-10 20:04:23 +10:00
Andrew Nicols 648e72316d Merge branch 'MDL-65965-35-fix' of git://github.com/junpataleta/moodle into MOODLE_35_STABLE 2019-07-09 11:01:05 +08:00
Jun Pataleta 6b8c4ddacc MDL-65965 behat: Do not fetch grouping IDs for empty grouping idnumbers 2019-07-09 10:49:25 +08:00
Shamim Rezaie 3bf1e69a3e MDL-66054 behat: typo fix 2019-07-09 00:58:05 +02:00
Eloy Lafuente (stronk7) df4041b745 Merge branch 'MDL-65965-35' of git://github.com/junpataleta/moodle into MOODLE_35_STABLE 2019-07-09 00:55:26 +02:00
AMOS bot ac9e0f9ad5 Automatically generated installer lang files 2019-07-08 00:10:29 +00:00
AMOS bot c0cfb0ee09 Automatically generated installer lang files 2019-07-07 00:09:13 +00:00
Sara Arjona 5725188035 Moodle release 3.5.7 2019-07-05 12:27:14 +02:00
AMOS bot acb34a20c2 Automatically generated installer lang files 2019-07-05 00:10:07 +00:00
Eloy Lafuente (stronk7) e8c5c935a5 weekly release 3.5.6+ 2019-07-04 16:50:48 +02:00
Eloy Lafuente (stronk7) 5db144950d Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2019-07-04 16:50:43 +02:00
AMOS bot 904399daaf Automatically generated installer lang files 2019-07-04 00:08:56 +00:00
Shamim Rezaie 498fa3c1ae MDL-61114 mod_assign: Check if the teacher can access the override 2019-07-03 18:06:22 +02:00
Shamim Rezaie a8f2981158 MDL-61114 mod_assign: assignment overrides to observe group membership 2019-07-03 18:06:22 +02:00
Shamim Rezaie ccca3fc6e4 MDL-61115: mod_lesson: Check if the teacher can access the override 2019-07-03 17:50:44 +02:00
Shamim Rezaie 5d16523422 MDL-61115 mod_lesson: Lesson overrides to observe group membership 2019-07-03 17:50:44 +02:00
Sara Arjona 1953f78e3e Merge branch 'MDL-64794_35' of https://github.com/stronk7/moodle into MOODLE_35_STABLE 2019-07-03 11:16:08 +02:00
AMOS bot 6504388f3e Automatically generated installer lang files 2019-07-03 00:09:03 +00:00
AMOS bot 902d300967 Automatically generated installer lang files 2019-07-03 00:09:03 +00:00
Sara Arjona 9399070f9f Merge branch 'MDL-64614_35' of git://github.com/stronk7/moodle into MOODLE_35_STABLE 2019-07-02 21:21:57 +02:00
Shamim Rezaie 96b2794f29 MDL-34411 mod_quiz: Check if the teacher can access the override 2019-07-01 19:01:39 +02:00
Shamim Rezaie d551e89fad MDL-34411 groups: copy/paste error in test_groups_user_groups_visible 2019-07-01 19:01:39 +02:00
Shamim Rezaie 3bb633edc4 MDL-34411 mod_quiz: quiz overrides to observe group membership 2019-07-01 19:01:39 +02:00
Damyon Wiese 862d20bac0 MDL-64623 glossary: Check the entry id
The entry must match the glossary before you can do any action on it.
2019-07-01 19:01:39 +02:00
Damyon Wiese cf2beaf8c5 MDL-53689 xmldb: Require a sesskey to load xml
Loading and unloading xml files is not protected from XSS with a sesskey.
2019-07-01 19:01:39 +02:00
Eloy Lafuente (stronk7) d3eeabcf04 Merge branch 'MDL-64511-35' of https://github.com/paulholden/moodle into MOODLE_35_STABLE 2019-07-01 18:53:20 +02:00
Dan Marsden 8c678d9aa9 MDL-60347 core: debugsmtp should be a developer only setting. 2019-07-01 12:17:12 +02:00
Eloy Lafuente (stronk7) 9d86101204 MDL-64614 environment: mssql requirement up to 2012 (11.0) 2019-06-30 11:59:11 +02:00
Eloy Lafuente (stronk7) 2f535a7c43 MDL-64614 environment: 3.8 base information
This is a direct copy of the 3.7 branch to have
changes under control easier for next commits.
2019-06-30 11:59:10 +02:00
AMOS bot 776141f4d3 Automatically generated installer lang files 2019-06-30 00:09:32 +00:00
AMOS bot f33dbc4223 Automatically generated installer lang files 2019-06-29 00:09:37 +00:00
AMOS bot 11685ae642 Automatically generated installer lang files 2019-06-29 00:09:37 +00:00
Paul Holden 4cf939c638 MDL-64511 privacy: encode data URL when loading content.
Previously paths that included ? or # characters would break loading.
2019-06-28 13:17:42 +01:00
Eloy Lafuente (stronk7) 7a5e8583d9 weekly release 3.5.6+ 2019-06-27 18:54:28 +02:00
Eloy Lafuente (stronk7) 63b2abcc34 Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2019-06-27 18:54:26 +02:00
Sara Arjona 16a14f010d Merge branch 'MDL-60088-35' of git://github.com/Chocolate-lightning/moodle into MOODLE_35_STABLE 2019-06-26 18:11:31 +02:00
Eloy Lafuente (stronk7) da6a75fcc7 Merge branch 'MDL-65249-35-fix' of https://github.com/snake/moodle into MOODLE_35_STABLE 2019-06-26 10:30:21 +02:00
Jake Dallimore 522a84d484 MDL-65249 session: use redis host constant in unit tests 2019-06-26 16:12:35 +08:00
Jake Dallimore 09325c5a80 Merge branch 'MDL-65249-redis-catch-exception-after-retry-MOODLE_35_STABLE' of https://github.com/ilya-catalyst/moodle into MOODLE_35_STABLE 2019-06-26 14:53:01 +08:00
Jake Dallimore db72e5b94e Merge branch 'MDL-60978-35' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2019-06-26 13:27:55 +08:00
AMOS bot 2a7d1c59e8 Automatically generated installer lang files 2019-06-26 00:09:44 +00:00
Ilya Tregubov ed13b5bff3 MDL-65249 Session: Throw exception if number of attempts exceeded. 2019-06-25 15:06:42 +10:00
AMOS bot d4345429ec Automatically generated installer lang files 2019-06-25 00:09:34 +00:00
AMOS bot dccc4f0338 Automatically generated installer lang files 2019-06-24 00:08:33 +00:00
Mathew May 300afd6ab4 MDL-60088 travis: add dist:trusty to travis
We are doing this because travis changed its default release to xenial.
So this is a stop gap and we will add xenial support moving forward.
2019-06-23 23:55:34 +08:00
Jun Pataleta 91998db5f5 MDL-65965 behat: Map grouping for activity data generator 2019-06-21 15:41:14 +08:00
Jun Pataleta e76b0e1014 MDL-65965 availability: Behat test for activity grouping restriction 2019-06-21 15:41:14 +08:00
Andrew Nicols 5e5789ab09 MDL-60978 session: Run redis tests in isolation 2019-06-21 14:36:13 +08:00
Andrew Nicols 50d3ef02b9 MDL-60978 testing: Support ability to run phpunit in isolated process 2019-06-21 14:36:13 +08:00
AMOS bot cea931e57e Automatically generated installer lang files 2019-06-18 00:08:53 +00:00
AMOS bot ee4ea23869 Automatically generated installer lang files 2019-06-15 00:08:30 +00:00
Eloy Lafuente (stronk7) 473d664b4a weekly release 3.5.6+ 2019-06-13 18:15:37 +02:00
Eloy Lafuente (stronk7) f4c3a9e129 Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2019-06-13 18:15:35 +02:00
Andrew Nicols d29528c4db Merge branch 'm35_MDL-61038_Fix_uuid_extensions_usage_v2' of https://github.com/scara/moodle into MOODLE_35_STABLE 2019-06-10 14:12:23 +08:00
Matteo Scaramuccia 88f85ede8e MDL-61038 setuplib: Fixed PECL UUID extension support 2019-06-08 23:14:11 +02:00
AMOS bot b2a600563e Automatically generated installer lang files 2019-06-07 00:10:06 +00:00
Eloy Lafuente (stronk7) 7f5049c7bc weekly release 3.5.6+ 2019-06-06 16:46:39 +02:00
Eloy Lafuente (stronk7) 321125cadb Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2019-06-06 16:46:36 +02:00
AMOS bot 9c2796097f Automatically generated installer lang files 2019-06-06 00:08:33 +00:00
AMOS bot cc6bd24c30 Automatically generated installer lang files 2019-06-05 00:08:35 +00:00
Eloy Lafuente (stronk7) 9b37061aba Merge branch 'MDL-65576-35' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2019-06-04 21:40:25 +02:00
AMOS bot 8ac0bb82df Automatically generated installer lang files 2019-06-04 00:08:30 +00:00
AMOS bot 7ff9602c7a Automatically generated installer lang files 2019-06-03 00:08:32 +00:00
Andrew Nicols 2918831394 MDL-65576 behat: Reset Selenium driver between scorm scenarios 2019-05-31 08:17:29 +08:00
Eloy Lafuente (stronk7) bce54527f7 MDL-64794 tcpdf: Bump to tcpdf 6.2.26 2019-05-30 23:51:50 +02:00
Eloy Lafuente (stronk7) 39cd996f62 weekly release 3.5.6+ 2019-05-30 12:18:25 +02:00
Eloy Lafuente (stronk7) 2edb40d973 Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2019-05-30 12:18:23 +02:00
AMOS bot 1fa428ffcf Automatically generated installer lang files 2019-05-29 00:09:36 +00:00
Simey Lameze 40f3c1a50a MDL-65697 qtype_missingtype: include missing class 2019-05-28 13:36:05 +08:00
AMOS bot c1aea9fd14 Automatically generated installer lang files 2019-05-25 00:08:50 +00:00
AMOS bot 4e4d4e37b8 Automatically generated installer lang files 2019-05-24 00:15:24 +00:00
Eloy Lafuente (stronk7) 16eeee959b weekly release 3.5.6+ 2019-05-23 20:52:12 +02:00
Eloy Lafuente (stronk7) 3d44463106 Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2019-05-23 20:52:10 +02:00
AMOS bot 8fd0ca20b9 Automatically generated installer lang files 2019-05-23 00:13:01 +00:00
Jun Pataleta eafc231dd8 Merge branch 'MDL-65636_35' of https://github.com/timhunt/moodle into MOODLE_35_STABLE 2019-05-22 19:31:07 +08:00
Tim Hunt e8b72dabe6 MDL-65636 filter_multilang: add some basic unit tests
This commit includes suggestions from Jun Pataleta on how to improve the
unit tests.
2019-05-22 11:04:21 +01:00
AMOS bot 3dff98b036 Automatically generated installer lang files 2019-05-21 00:13:04 +00:00
AMOS bot 5e82098480 Automatically generated installer lang files 2019-05-21 00:13:04 +00:00
AMOS bot eff7030f7e Automatically generated installer lang files 2019-05-18 00:12:46 +00:00
AMOS bot 1dd2ee3f49 Automatically generated installer lang files 2019-05-17 00:14:38 +00:00
Sara Arjona 263b3cb643 weekly release 3.5.6+ 2019-05-14 13:17:33 +02:00
Sara Arjona 55ca32ba74 Merge branch 'MDL-65581-35' of git://github.com/bmbrands/moodle into MOODLE_35_STABLE 2019-05-13 21:20:22 +02:00
Bas Brands 7a548abf01 MDL-65581 core_blocks: change classname for hidden blocks
Changing the added class .invisible to .ivisibleblock to avoid hiding
the block completely
2019-05-13 12:43:34 +02:00
Eloy Lafuente (stronk7) 73d401b462 Moodle release 3.5.6 2019-05-11 23:17:42 +02:00
Eloy Lafuente (stronk7) 7ea8581868 weekly release 3.5.5+ 2019-05-10 20:31:14 +02:00
Eloy Lafuente (stronk7) 3f923b4570 Merge branch 'MDL-65537-35-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_35_STABLE 2019-05-10 20:09:24 +02:00
David Mudrák 8ef6c25a98 MDL-65537 lang: Use fixed strings in tests, too 2019-05-10 16:14:30 +02:00
Helen Foster 007b946948 MDL-65537 lang: Import fixed English strings (en_fix) 2019-05-10 16:14:16 +02:00
Eloy Lafuente (stronk7) d1e419d86f Merge branch 'MDL-65558-35' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2019-05-10 11:30:31 +02:00
Jun Pataleta 2e190e4739 Merge branch 'MDL-65540-35' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2019-05-10 15:58:28 +08:00
Andrew Nicols e81ac514ca MDL-65558 enrol_database: use , as port separator 2019-05-10 12:24:58 +08:00
Andrew Nicols 563f08ff54 MDL-65558 auth_db: use , as port separator 2019-05-10 12:24:58 +08:00
Andrew Nicols 8e70179f4d MDL-63959 feedback: Adjust unit test for perf 2019-05-10 11:43:19 +08:00
Andrew Nicols 30ac3bcfeb Merge branch 'MDL-63959-35' of git://github.com/tobiasreischmann/moodle into MOODLE_35_STABLE 2019-05-10 11:43:13 +08:00
Shamim Rezaie b287771272 MDL-65540 core_search: Explicit component name in the str helper 2019-05-10 08:12:40 +08:00
Shamim Rezaie 4b00d8392c MDL-65540 tool_dataprivacy: Explicit component name in the str helper 2019-05-10 08:12:40 +08:00
Eloy Lafuente (stronk7) abe4ff5534 Merge branch 'MDL-65197-35' of https://github.com/paulholden/moodle into MOODLE_35_STABLE 2019-05-09 20:02:49 +02:00
Eloy Lafuente (stronk7) 5b641c4187 Merge branch 'MDL-29320-35' of git://github.com/junpataleta/moodle into MOODLE_35_STABLE 2019-05-09 19:49:57 +02:00
Andrew Nicols 02dc7147c7 Merge branch 'MDL-65435_35' of git://github.com/stronk7/moodle into MOODLE_35_STABLE 2019-05-09 14:52:13 +08:00
Jun Pataleta 8ab8dee8c9 Merge branch 'MDL-65141-35' of git://github.com/jleyva/moodle into MOODLE_35_STABLE 2019-05-09 12:27:30 +08:00
Adrian Greeve b9569a887e Merge branch 'MDL-58315_35_boost_block_classes' of https://github.com/zpottie/moodle into MOODLE_35_STABLE 2019-05-09 11:35:07 +08:00
Adrian Greeve efee2e4c8b Merge branch 'MDL-65387-35' of https://github.com/lucaboesch/moodle into MOODLE_35_STABLE 2019-05-09 11:25:06 +08:00
Eloy Lafuente (stronk7) 33f22e1e83 MDL-65435 behat: Support any arg type with behat reruns
Right now, when executing a single rerun of a parallel run
using vendor/bin/behat, not all the argument alternatives
are supported (equal or space). This commit allows both to work.
2019-05-08 23:23:36 +02:00
Luca Bösch 500fc1b8f0 MDL-65387 dataformats: Table download formats choose pulldown style. 2019-05-08 20:20:11 +02:00
Michael Hawkins e36f1c9896 MDL-61738 messageinbound: Fix quota checks & filesize for email uploads
Private files uploaded by email will now honour the file quota limit,
because the filesize is set correctly and checked against users'
remaining personal quota limit. Previously, attachment size was always
set to zero, and quota was checked against the draft area (this is
not valid for email uploads, because each file is moved out of the
draft area as it is processed, so multiple files totalling greater
than the remaining quota would still pass the check).
2019-05-08 17:51:45 +02:00
Dan Marsden cd6fb4322b MDL-64708 cohort: Return url is not used anywhere in core. 2019-05-08 17:51:45 +02:00
Eloy Lafuente (stronk7) 1398145998 weekly release 3.5.5+ 2019-05-08 17:48:41 +02:00
Adrian Greeve ec6f1419dc Merge branch 'MDL-65484-35' of git://github.com/damyon/moodle into MOODLE_35_STABLE 2019-05-08 11:24:55 +08:00
Andrew Nicols 473145c2c7 Merge branch 'MDL-35396-35' of git://github.com/mihailges/moodle into MOODLE_35_STABLE 2019-05-08 09:48:33 +08:00
Damyon Wiese 469ac6dd08 MDL-65484 assign: Scrolling overflow CSS
Use relatively positioned elements, not absolutely positioned to prevent
elements being visible when they are scrolled outside the containing drawing region.
2019-05-07 16:23:04 +08:00
Mihail Geshoski 5ddac4b5b9 MDL-35396 lesson: Fix detailed statistics display for essay questions 2019-05-07 14:00:58 +08:00
Jun Pataleta 0c8113bf8c Merge branch 'MDL-65153-35-fix1' of http://github.com/damyon/moodle into MOODLE_35_STABLE 2019-05-07 10:09:07 +08:00
Damyon Wiese f4110673d4 MDL-65153 competencies: course competencies page
The webservice to fetch the data for the course competencies page requires the
pluginbaseurl to be set.
2019-05-07 10:01:51 +08:00
Sara Arjona fdecf60bab Merge branch 'MDL-65374-35' of https://github.com/lucaboesch/moodle into
MOODLE_35_STABLE
2019-05-06 12:09:48 +02:00
Jun Pataleta bef3d096fc Merge branch 'MDL-65399-35' of git://github.com/rezaies/moodle into MOODLE_35_STABLE 2019-05-06 16:26:27 +08:00
Sara Arjona bb1cfe25cf Merge branch 'MDL-65396-35' of https://github.com/lucaboesch/moodle into MOODLE_35_STABLE 2019-05-06 10:20:15 +02:00
Shamim Rezaie 1150862f9d MDL-65399 mod_quiz: Handling the edge case when section name is '' 2019-05-06 18:14:00 +10:00
Shamim Rezaie b94ea41bbf MDL-65399 mod_quiz: UI should prevent deleting the last slot of section 2019-05-06 18:14:00 +10:00
Shamim Rezaie 6946a25e9f MDL-65399 mod_quiz: remove_slot should update the existing info
The remove_slot method should update the remaining slot's slot
attribute. It also should update the remaining slot's question number
and section info.
2019-05-06 18:14:00 +10:00
Shamim Rezaie 2a75ea0ec9 MDL-65399 mod_quiz: Remove $slots from the \mod_quiz\structure class
It's enough to have $slotsinorder, and the $slots property
was redundant. There should only be a single source of truth.
2019-05-06 18:14:00 +10:00
Jun Pataleta dafd6f136c Merge branch 'MDL-65153-35' of git://github.com/damyon/moodle into MOODLE_35_STABLE 2019-05-06 16:13:40 +08:00
Adrian Greeve b6147f7e80 Merge branch 'MDL-64968-35' of https://github.com/lucaboesch/moodle into MOODLE_35_STABLE 2019-05-06 16:00:36 +08:00
Adrian Greeve 531036848c Merge branch 'MDL-65104-35' of git://git.cameron1729.xyz/moodle into MOODLE_35_STABLE 2019-05-06 12:01:55 +08:00
Jake Dallimore c0e1742985 Merge branch 'MDL-64988-35' of git://github.com/rezaies/moodle into MOODLE_35_STABLE 2019-05-06 10:34:51 +08:00
Luca Bösch bedb1ffc49 MDL-65396 theme_boost: Style duration chooser pulldown select. 2019-05-04 11:00:29 +02:00
Luca Bösch 4a6b23937a MDL-65374 core_grades: style "Move selected items to" pulldown. 2019-05-04 11:00:15 +02:00
Luca Bösch 83d8624eec MDL-64968 mod_lesson: Style "Yes, I'd like to try again" button. 2019-05-04 11:00:05 +02:00
Eloy Lafuente (stronk7) 6e311854b7 weekly release 3.5.5+ 2019-05-03 17:52:03 +02:00
Eloy Lafuente (stronk7) 12531500d3 Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2019-05-03 17:51:59 +02:00
Shamim Rezaie 73c4aa313b MDL-64988 mod_quiz: Fix questions always being added to the last section 2019-05-03 20:49:10 +10:00
zpottie b22947d3b7 MDL-58315 core: Add support for custom block classes in Boost 2019-05-03 16:17:50 +12:00
Adrian Greeve e208a8d307 Merge branch 'MDL-64851-35' of https://github.com/s-cenni/MDL-64851 into MOODLE_35_STABLE 2019-05-03 10:45:58 +08:00
Andrew Nicols a4c878c734 Merge branch 'MDL-64394-accesslog-MOODLE_35_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_35_STABLE 2019-05-03 08:54:29 +08:00
AMOS bot 54d672958d Automatically generated installer lang files 2019-05-03 00:14:40 +00:00
Jun Pataleta 13e1ef0300 Merge branch 'MDL-65411-35' of git://github.com/lameze/moodle into MOODLE_35_STABLE 2019-05-02 17:02:55 +08:00
Jun Pataleta b1899fcc4a Merge branch 'MDL-65446-35' of https://github.com/ryanwyllie/moodle into MOODLE_35_STABLE 2019-05-02 15:01:31 +08:00
Jake Dallimore 31c96d5e7f Merge branch 'MDL-64439-MOODLE_35_STABLE' of https://github.com/ilya-catalyst/moodle into MOODLE_35_STABLE 2019-05-02 14:53:21 +08:00
Jun Pataleta 3bb9a613c6 Merge branch 'MDL-65273-35' of https://github.com/lucaboesch/moodle into MOODLE_35_STABLE 2019-05-01 17:24:13 +08:00
Paul Holden 29fcc59f88 MDL-65197 editor: handle empty user preference in privacy export. 2019-05-01 09:52:59 +01:00
Luca Bösch 3cf521a427 MDL-65273 roles: Roles permissions buttons styles. 2019-05-01 09:26:51 +02:00
Adrian Greeve a27c089b40 Merge branch 'MDL-65149-35' of git://github.com/damyon/moodle into MOODLE_35_STABLE 2019-05-01 15:00:34 +08:00
Adrian Greeve 4d1fbba086 Merge branch 'MDL-64959_35_STABLE' of https://github.com/abhimanyuZ/moodle into MOODLE_35_STABLE 2019-05-01 14:32:15 +08:00
Adrian Greeve c8c229e08b Merge branch 'MDL-65178-35' of git://github.com/damyon/moodle into MOODLE_35_STABLE 2019-05-01 11:59:16 +08:00
Simey Lameze 7d78aeece1 MDL-65411 core_calendar: wrap long description text 2019-05-01 09:56:05 +08:00
Jake Dallimore 4d0fa8abdc Merge branch 'MDL-60851-35' of git://github.com/damyon/moodle into MOODLE_35_STABLE 2019-05-01 09:33:31 +08:00
Damyon Wiese 4c775e4618 MDL-60851 backup: coding style fixes 2019-05-01 08:51:57 +08:00
Damyon Wiese 9462d6f1c8 MDL-60851 backup: Sanitise setting dependencies
The only different between each setting dependency type is the evaluation of the condition,
and the mform js validation arguments - so that should be the only thing that is extended
by each subclass.
2019-05-01 08:51:57 +08:00
Damyon Wiese 2aeff9cfd7 MDL-60851 backup: Fix undefined $value 2019-05-01 08:51:57 +08:00
Damyon Wiese 5b01f0099f MDL-60851 backup: More unit tests for dependencies 2019-05-01 08:51:57 +08:00
Eloy Lafuente (stronk7) 6e3f19324a Merge branch 'MDL-65397-35-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_35_STABLE 2019-05-01 01:43:11 +02:00
Eloy Lafuente (stronk7) 34a46486ef weekly release 3.5.5+ 2019-05-01 00:28:41 +02:00
Eloy Lafuente (stronk7) 2a373db105 Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2019-05-01 00:28:39 +02:00
Juan Leyva 08135b0689 MDL-65141 tool_mobile: Return all the language translations 2019-04-30 15:25:29 +02:00
Jun Pataleta 1bd6794d80 MDL-29320 user: Make email query case-insensitive 2019-04-30 16:29:39 +08:00
Jun Pataleta 3e854512c5 MDL-29320 admin: Improve test for multiple accounts with same email
* Use Scenario Outlines
* More coverage:
  - Test for email case-sensitivity
  - Updating user profile as admin
  - Updating own user profile
2019-04-30 16:29:36 +08:00
Jun Pataleta 8326233128 MDL-29320 user: Remove @javascript tag for add new user behat test
* It's not necessary and will improve Behat execution time
2019-04-30 16:23:03 +08:00
Tobias Reischmann eb29ebefb4 MDL-63959 mod_feedback: Add phpunit tests for get_pages in completion 2019-04-30 07:57:21 +02:00
Zoltán Szarvas 638ba35597 MDL-63959 mod_feedback: Fixed nested dependency handling
For example the dependecy chain is the following: A->B->C. When a
question (A) depends on another dependent item (B) and B hasn't
displayed (because of C's response), the $value for the B's response
will be null. In this case the can_see_item() method returned
null. Because the can_see_item() returned null (not false), the
get_pages() method displayed the question A, because it checks for
explicit false: $this->can_see_item($item) !== false.
Now, false is also returned, if the dependent question is not visible.
2019-04-30 07:57:21 +02:00
Ryan Wyllie 94cbb103ef MDL-65446 admin: fix admin email option for cli install 2019-04-30 13:38:25 +08:00
Eloy Lafuente (stronk7) efaad61031 MDL-63137 mod_feedback: discern between user or id better
is_int('1') => false, so better we invert the check that is safer.
2019-04-30 08:50:20 +08:00
AMOS bot 05e4efbcee Automatically generated installer lang files 2019-04-30 00:12:35 +00:00
Eloy Lafuente (stronk7) 3451667bc9 Merge branch 'MDL-65293-35' of git://github.com/rezaies/moodle into MOODLE_35_STABLE 2019-04-29 22:46:47 +02:00
Eloy Lafuente (stronk7) 9efdbf36d7 Merge branch 'MDL-63137-35' of git://github.com/aanabit/moodle into MOODLE_35_STABLE 2019-04-29 20:11:13 +02:00
Helen Foster 23bb771193 MDL-65397 lang: Import fixed English strings (en_fix)
Significant string changes:

* direct:view,gradeimport_direct - wording corrected from 'CSV' to
  'spreadsheet'
* limitanswers_help,mod_choice - additional wording added explaining how
  the setting works with groups
2019-04-29 11:50:36 +02:00
Jun Pataleta f47cc5ce3f Merge branch 'MDL-65279-35' of https://github.com/tkorner/moodle into MOODLE_35_STABLE 2019-04-29 17:08:29 +08:00
AMOS bot 9f504db2f3 Automatically generated installer lang files 2019-04-27 00:12:52 +00:00
Eloy Lafuente (stronk7) 9e5cda1f6c weekly release 3.5.5+ 2019-04-26 18:41:11 +02:00
Amaia Anabitarte 3751ec0e68 MDL-63137 mod_feedback: PHPUnit tests for new userid parameter 2019-04-26 17:32:57 +02:00
Amaia Anabitarte 5a93c6c9ab MDL-63137 mod_feedback: mod_feedback_core_calendar_provide_event_action
Update mod_feedback_core_calendar_provide_event_action function to add a new userid parameter
Add userid to check capabilities, etc. to feedback completion and structure.
2019-04-26 17:32:57 +02:00
Amaia Anabitarte 596aa22c4e MDL-63137 mod_feedback: Pointing TODO tasks to right deprecation issue 2019-04-26 17:32:57 +02:00
Eloy Lafuente (stronk7) cc72ae7f29 MDL-60418 Behat: Fix missing $installurl 2019-04-25 23:39:11 +02:00
Eloy Lafuente (stronk7) 7aa7b392c0 Merge branch 'MDL-60418_35' of git://github.com/timhunt/moodle into MOODLE_35_STABLE 2019-04-25 23:26:19 +02:00
Tim Hunt 11a4683cfd MDL-60418 Behat: Fix broken docs links in Behat code. 2019-04-25 21:39:28 +01:00
Eloy Lafuente (stronk7) b6af039890 Merge branch 'MDL-64151-35-fix' of https://github.com/marinaglancy/moodle into MOODLE_35_STABLE 2019-04-24 12:49:58 +02:00
Marina Glancy 69e9f234e1 MDL-64151 forms: select element without selection
Select element that is not multiple should export null when nothing is
selected. If the element is displayed there will always be something
selected.
2019-04-24 11:42:03 +02:00
Sara Arjona b7f0a3fd9c Merge branch 'MDL-65170-35' of https://github.com/snake/moodle into MOODLE_35_STABLE 2019-04-24 09:02:54 +02:00
Adrian Greeve 4f701a0e67 Merge branch 'MDL-65375-m35' of https://github.com/sammarshallou/moodle into MOODLE_35_STABLE 2019-04-24 10:31:46 +08:00
Eloy Lafuente (stronk7) 45b9bae80f Merge branch 'MDL-64151-35' of git://github.com/marinaglancy/moodle into MOODLE_35_STABLE 2019-04-23 19:39:16 +02:00
Eloy Lafuente (stronk7) 5d3bf61c27 weekly release 3.5.5+ 2019-04-23 17:36:22 +02:00
David Monllaó c344124599 Merge branch 'MDL-65102-35' of git://github.com/rezaies/moodle into MOODLE_35_STABLE 2019-04-23 13:31:05 +02:00
sam marshall 22baf5c0aa MDL-65375 Restore: Null data in other field should be serialised
If the 'other' field is empty, then following a restore of course
logs, it should still be serialised so that it is consistent with
the normal behaviour when logging.

Without this change, an event with null value for other has the
field set to NULL if you restore it, but 'N;' when the event is
initially created.
2019-04-18 15:07:40 +01:00
Adrian Greeve f1125775fe Merge branch 'MDL-29318-35' of git://github.com/junpataleta/moodle into MOODLE_35_STABLE 2019-04-18 13:51:36 +08:00
Eloy Lafuente (stronk7) ca0f244e09 weekly release 3.5.5+ 2019-04-17 20:04:20 +02:00
Eloy Lafuente (stronk7) 216ea27814 Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2019-04-17 20:04:16 +02:00
AMOS bot e0ea44ae29 Automatically generated installer lang files 2019-04-13 00:13:30 +00:00
Eloy Lafuente (stronk7) 8ffac7d8e3 weekly release 3.5.5+ 2019-04-12 21:35:08 +02:00
Eloy Lafuente (stronk7) 8d0c6ac9dd Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2019-04-12 21:35:06 +02:00
Jake Dallimore 5b7563dbb2 Merge branch 'MDL-62974-35' of github.com:abgreeve/moodle into MOODLE_35_STABLE 2019-04-12 11:18:24 +08:00
Adrian Greeve 8bf1ffc9ed MDL-62974 mod_lesson: Minor update to html class. 2019-04-12 11:10:41 +08:00
Eloy Lafuente (stronk7) b3d49c46eb Merge branch 'MDL-62974-35' of https://github.com/jmvedrine/moodle into MOODLE_35_STABLE 2019-04-11 23:50:18 +02:00
Marina Glancy 98af4c736d MDL-64151 form: autocomplete element remove last choice
This is the same situation as was in MDL-56864 but now in 'course', 'autocomplete' and 'select' elements
- if the element allows multiple selection it is impossible to remove the last element
2019-04-11 16:46:33 +02:00
Sara Cenni 2653ea76be MDL-64851 badge: reviewing badges of invisible courses 2019-04-11 12:03:42 +02:00
Adrian Greeve 367a45a60b Merge branch 'MDL-64719-purge_user_cache-35' of git://github.com/leonstr/moodle into MOODLE_35_STABLE 2019-04-11 13:40:15 +08:00
Adrian Greeve 1da8aa30e0 Merge branch 'MDL-46975-35' of git://github.com/junpataleta/moodle into MOODLE_35_STABLE 2019-04-10 14:26:50 +08:00
AMOS bot 2e9bc58475 Merge branch 'MOODLE_35_STABLE' into install_35_STABLE 2019-04-10 00:12:29 +00:00
Jean-Michel Vedrine dd74898f63 MDL-62974 lesson: Suppress HTML font tags 2019-04-09 23:04:26 +02:00
Eloy Lafuente (stronk7) 12476a35a6 weekly release 3.5.5+ 2019-04-09 20:37:04 +02:00
Eloy Lafuente (stronk7) bf35831359 Merge branch 'MDL-64819-35' of https://github.com/sarjona/moodle into MOODLE_35_STABLE 2019-04-09 16:04:02 +02:00
Sara Arjona cc145e54fd MDL-64819 course: fix behat errors with the move icon
Some errors have been detected when using Clean + Goutte.
2019-04-09 14:16:42 +02:00
AMOS bot 48f96614ff Automatically generated installer lang files 2019-04-09 00:11:32 +00:00
AMOS bot 4066dda725 Automatically generated installer lang files 2019-04-09 00:11:32 +00:00
Sara Arjona 0a91d215c6 Merge branch 'MDL-64819-35' of git://github.com/damyon/moodle into MOODLE_35_STABLE 2019-04-08 14:20:03 +02:00
Adrian Greeve 6d0e1fe82d Merge branch 'MDL-65218-35' of git://github.com/damyon/moodle into MOODLE_35_STABLE 2019-04-08 16:56:31 +08:00
Damyon Wiese b7218d8a10 MDL-64819 output: Hide icons with no title
When output from javascript they should match what gets output from php.
2019-04-08 15:42:07 +08:00
Shamim Rezaie de2f0d85e7 MDL-65293 core_calendar: Privacy deletion fix
Deleting in course context should not delete from course modules
2019-04-08 15:41:09 +10:00
Jake Dallimore 077825f8c9 MDL-65170 core_user: perf improvement for user_get_user_details_courses
We don't always need to iterate over the user's courses, so only fetch
them when we do.
2019-04-08 09:05:40 +08:00
Jake Dallimore 06d2ee0fde MDL-65170 core_user: user_get_user_details_courses respects groupmode
This had a relatively simply check for course profile visibility, which
meant that users in separate groups could see one another's profile.
This has been replaced with the more correct check in
user_can_view_profile().
2019-04-08 09:05:40 +08:00
Eloy Lafuente (stronk7) 96607cf5b3 weekly release 3.5.5+ 2019-04-05 18:32:34 +02:00
Eloy Lafuente (stronk7) b290b3eded NOBUG: Fixed file access permissions 2019-04-05 18:32:34 +02:00
Thomas Korner f059d1176c MDL-65279 core: typo in categoriesandcourses fixed
AMOS BEGIN
 MOV [categoriesandcoures,core],[categoriesandcourses,core]
AMOS END
2019-04-05 14:35:09 +02:00
Damyon Wiese 0f389d44b6 MDL-64819 output: Activity menu icons
Remove duplciate alt text from activity menu icons and the links to add new sections.
2019-04-05 12:03:10 +08:00
Eloy Lafuente (stronk7) 29dba99cdf Merge branch 'MDL-65029_35' of git://github.com/timhunt/moodle into MOODLE_35_STABLE 2019-04-05 00:48:08 +02:00
Eloy Lafuente (stronk7) 7e7b71fbeb Merge branch 'MDL-65094-35' of git://github.com/rezaies/moodle into MOODLE_35_STABLE 2019-04-04 22:40:10 +02:00
Eloy Lafuente (stronk7) 4f2ee1dec1 Merge branch 'MDL-65038_MOODLE_35_STABLE' of https://github.com/maksudr/moodle into MOODLE_35_STABLE 2019-04-04 20:31:31 +02:00
Jun Pataleta f7a4ef3866 Merge branch 'MDL-62307_MOODLE_35_STABLE' of https://github.com/maksudr/moodle into MOODLE_35_STABLE 2019-04-03 16:47:56 +08:00
Jun Pataleta 6181040347 Merge branch 'MDL-65112-MOODLE_35_STABLE' of https://github.com/dmitriim/moodle into MOODLE_35_STABLE 2019-04-03 16:19:16 +08:00
Eloy Lafuente (stronk7) 8082ff4805 Merge branch 'MDL-64994-35-pythonmlversion' of git://github.com/mudrd8mz/moodle into MOODLE_35_STABLE 2019-04-03 00:09:45 +02:00
Eloy Lafuente (stronk7) 5e2338c868 weekly release 3.5.5+ 2019-04-02 15:52:50 +02:00
Eloy Lafuente (stronk7) 6909b8aada Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2019-04-02 15:52:44 +02:00
Adrian Greeve 80c1b6bcd0 Merge branch 'MDL-65144-35' of git://github.com/damyon/moodle into MOODLE_35_STABLE 2019-04-02 10:17:37 +08:00
Brendan Heywood d6455734d8 MDL-64394 core: Fixed bug when using access log with pre_loginpage_hook 2019-04-02 11:41:00 +11:00
Ilya Tregubov c91c235fb6 MDL-64439 auth: Refresh $cm in require_login after pre_loginpage_hook. 2019-04-02 10:22:41 +11:00
Leon Stringer f9ea236c4f MDL-64719 cache: Implement purge_current_user() in \cache
\cache::make() may return a cache_disabled subclass but callers, specifically
user/lib.php:user_create_user(), invoke \cache::purge_current_user() which was
only implemented by the cache_session subclass.  Added empty
\cache::purge_current_user() which subclasses can implement, i.e.
cache_session, or not, i.e. cache_disabled.
2019-04-01 15:32:42 +01:00
Damyon Wiese 61adf3b25b MDL-65144 output: Add img-fluid to logo
Extra wide logos do not scale to the screen size - this change adds the bootstrap class
img-fluid to logos on the loginpage, signupform and in the context header.

Thanks to Maksud R for working on this.
2019-04-01 15:52:16 +08:00
Jake Dallimore e9c0b71aee Merge branch 'MDL-65089_35' of https://github.com/dvdcastro/moodle into MOODLE_35_STABLE 2019-04-01 15:34:40 +08:00
Jun Pataleta 3304b0728c Merge branch 'MDL-64524-35' of git://github.com/damyon/moodle into MOODLE_35_STABLE 2019-04-01 13:46:34 +08:00
Damyon Wiese d831bfbf04 MDL-64524 gradingform_guide: Marking guide comments
When there are too many comments, scroll the list so they still fit in the dialogue.
2019-04-01 13:03:59 +08:00
Damyon Wiese 6bfcfd9a1f MDL-64524 assign: Styles editpdf comments
Properly display the list of comments, but limiting their size (use title to indicate the full comments).
When there are too many comments, show a scrollbar in the menu.
2019-04-01 13:03:58 +08:00
Jun Pataleta 9cbdd41129 Merge branch 'MDL-63906_35' of git://github.com/dmonllao/moodle into MOODLE_35_STABLE 2019-04-01 10:31:51 +08:00
Adrian Greeve c56206cebf Merge branch 'MDL-65173_35' of git://github.com/markn86/moodle into MOODLE_35_STABLE 2019-04-01 10:23:54 +08:00
Eloy Lafuente (stronk7) 71c0f9c055 MDL-65218 recycle bin: cover immunization via settings provider
Both for course and category recycle bins
2019-04-01 09:26:55 +08:00
Eloy Lafuente (stronk7) 5e3ce4ef7d MDL-65218 recycle bin: immunize recycle bin from backup_auto_storage
As far as recycle bin is using MODE_AUTOMATED, it observes the backup_auto_storage
setting (storing backups @ real location. For recycle bin we want to ensure that
backup files are always stored in Moodle file area. In order to achieve that, we
hack the setting here via $CFG->forced_plugin_settings, so it won't interfere other
operations.  See MDL-65218 for more information.

This hack will be removed once recycle bin switches to use its own backup mode, with
own preferences and 100% appart from MODLE_AUTOMATED.
2019-04-01 09:26:55 +08:00
Eloy Lafuente (stronk7) 1e21aeb97c MDL-65218 recycle bin: Course backups (cat bin) to use MODE_AUTOMATED
Surely this should have been done as part of MDL-63263, but it wasn't.
Better let's do it here so every recycle bin backup is using the
very same mode.
2019-04-01 09:26:54 +08:00
Tim Hunt 403f2d450c MDL-65029 questions: refactor generation of question div id
We are planning to change the id in Moodle 3.7. However, the new
method name has been back-ported to stable branches, because we
know a lot of third-party question types like to have a single
branch which supports multiple Moodle versions.
2019-03-29 13:44:46 +00:00
Jun Pataleta c8ce874199 MDL-46975 core_auth: Make email validation case-insensitive
* Make email query case-insensitive
* Check only for duplicate emails if $CFG->allowaccountssameemail
is empty.
* Compare the values in "Email address" and "Email (again)" in the
signup form in a case-insensitive fashion.
2019-03-29 13:38:19 +08:00
Jun Pataleta 13cdeaf6a4 MDL-46975 auth_email: Behat test for email validation on signup 2019-03-29 13:38:19 +08:00
Jun Pataleta 0503fc7a35 MDL-29318 login: Handle email in case-insensitive manner
* Let get_complete_user_data() handle the fetching of user data and
  handle the logic of the errors to be shown based on the exception
  it throws. This also saves us 1 DB query by eliminating the need to
  count for the users that match a given email first before fetching
  user information.
2019-03-29 13:33:55 +08:00
Jun Pataleta 6abbe519d6 MDL-29318 login: Additional test for forgot_password_data_provider() 2019-03-29 13:33:55 +08:00
Jun Pataleta bdca601d03 MDL-29318 core: Fixes for get_complete_user_data()
* Added email in the list of case-insensitive fields.
* New optional parameter $throwexception for \get_complete_user_data().
  If true, an exception will be thrown when there's no matching record
  found or when there are multiple records found for the given field
  value. If false, it will simply return false.
  Defaults to false when not set. This ensures that
  get_complete_user_data() fetches the correct user data.
2019-03-29 13:33:55 +08:00
Jun Pataleta 4477b21322 MDL-29318 core: More unit tests for get_complete_user_data() 2019-03-29 13:30:19 +08:00
AMOS bot 1625acf3eb Automatically generated installer lang files 2019-03-29 00:15:35 +00:00
David Castro 8326e3d1a9 MDL-65089 glossary: Enforcing case comparison in SQL. 2019-03-28 18:33:02 -05:00
Dmitrii Metelkin c4658fd9e2 MDL-65112 mod_lesson: fix html for shortanswer responses 2019-03-29 08:31:24 +11:00
Eloy Lafuente (stronk7) d28abb632d weekly release 3.5.5+ 2019-03-28 16:49:09 +01:00
Eloy Lafuente (stronk7) 819ff2f3d7 Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2019-03-28 16:49:03 +01:00
Shamim Rezaie 2787bb5593 MDL-65102 core_form: autocomplete element to handle submit event 2019-03-28 15:18:49 +11:00
Eloy Lafuente (stronk7) 2ca6891e1f Merge branch 'MDL-63196-35' of git://github.com/lameze/moodle into MOODLE_35_STABLE 2019-03-28 00:12:54 +01:00
Eloy Lafuente (stronk7) 5381aad94a Merge branch 'MDL-64996-35-untrainedstaticmodels' of git://github.com/mudrd8mz/moodle into MOODLE_35_STABLE 2019-03-27 23:46:29 +01:00
Eloy Lafuente (stronk7) 618b27a8ae Merge branch 'MDL-62992-35' of git://github.com/lameze/moodle into MOODLE_35_STABLE 2019-03-27 23:06:29 +01:00
Jun Pataleta 1ed39a4991 Merge branch 'MDL-65008_moodle_35_stable' of https://github.com/dvdcastro/moodle into MOODLE_35_STABLE 2019-03-27 10:39:49 +08:00
Simey Lameze 2427689f4c MDL-62992 quiz: fix tags filtering on random question modal 2019-03-27 10:26:33 +08:00
Simey Lameze 89b9e4f805 MDL-62992 question: conditionaly enable question tags feature 2019-03-27 10:26:33 +08:00
Paul Holden 4418ec9411 MDL-43130 access: fix user counting when retrieving assignable roles.
Previously users assigned the same role in a context via multiple
components would be counted multiple times.
2019-03-27 00:18:13 +01:00
Eloy Lafuente (stronk7) 5fbbcddd0c Merge branch 'MDL-65081-35' of git://github.com/junpataleta/moodle into MOODLE_35_STABLE 2019-03-26 22:44:10 +01:00
Eloy Lafuente (stronk7) 25570f80dc Merge branch 'MDL-63152-35' of git://github.com/rezaies/moodle into MOODLE_35_STABLE 2019-03-26 13:28:31 +01:00
Eloy Lafuente (stronk7) 0f038af8de Merge branch 'MDL-63149-35' of git://github.com/rezaies/moodle into MOODLE_35_STABLE 2019-03-26 13:25:20 +01:00
Eloy Lafuente (stronk7) 5e97ea1423 Merge branch 'MDL-63151-35' of git://github.com/rezaies/moodle into MOODLE_35_STABLE 2019-03-26 13:16:06 +01:00
Shamim Rezaie 2e790a9741 MDL-65094 registration: don't encourage registration if on localhost 2019-03-26 17:26:35 +11:00
Damyon Wiese 68b61978e8 MDL-65178 competencies: count_competencies fix
Fix sql error in course_module_competency::count_competencies() function.
2019-03-26 09:49:08 +08:00
Sara Arjona 0eff5b7765 Merge branch 'MDL-64615-35' of git://github.com/jleyva/moodle into MOODLE_35_STABLE 2019-03-25 18:20:22 +01:00
Sara Arjona fd0b312303 Merge branch 'MDL-64790-35_apidoc_fix' of https://github.com/nicoroeser/moodle into MOODLE_35_STABLE 2019-03-25 12:38:30 +01:00
Mark Nelson cfa3409712 MDL-65173 message_email: removed bogus logic
This reverts commit ecb4b0260e.
2019-03-25 17:19:27 +08:00
David Mudrák 15d1157600 MDL-64994 analytics: Improve the Python package version check
Use the new method to check that the installed Python package has high
enough yet still API-compatible version.
2019-03-25 09:19:51 +01:00
David Mudrák a1026db0fe MDL-64994 analytics: Add a simple semantic version check method
This method is to be used for checking that a compatible version of the
moodlemlbackend package is installed on the server. The package is
expected to use the semantic versioning scheme (semver.org).
2019-03-25 09:19:51 +01:00
David Mudrák 959c70e87b MDL-64996 analytics: Make sure the no_teaching model is trained
Due to the bug, the no_teaching model might have been marked as
not-trained in the database. Static predictions models (i.e. those using
a target based on assumptions, not facts) are always considered as
trained. If they were marked as not-trained, the prediction scheduled
task would skip them and they would produce no predictions.

Ideally, such a fix should be done for all static models. But there is
no easy way to do it during the upgrade where accessing the analytics
API is not possible. I don't think there are many models out there that
would be affected by this so this seems to be good enough solution for
now (and the future ability to reset models will cover the rest).
2019-03-25 09:16:13 +01:00
David Mudrák 8e2360f9c8 MDL-64996 analytics: Don't mark static model as untrained after clearing
Static predictions models (i.e. those using a target based on
assumptions, not facts) are always considered as trained. Clearing them
must not mark them as untrained. Doing so would make them being skipped
by the prediction scheduled task.
2019-03-25 09:14:32 +01:00
Adrian Greeve 55d5362ab6 Merge branch 'MDL-60339-35' of git://github.com/Chocolate-lightning/moodle into MOODLE_35_STABLE 2019-03-25 11:12:12 +08:00
Adrian Greeve e1c280f951 Merge branch 'MDL-64492-35' of git://github.com/damyon/moodle into MOODLE_35_STABLE 2019-03-25 11:00:40 +08:00
AMOS bot 238585c911 Automatically generated installer lang files 2019-03-25 00:09:32 +00:00
Abhimanyu Kumar d7903d34f0 MDL-64959 uploaduser: remove leading/trailing spaces from CSV headings
Earlier while uploading users via CSV, if any leading or trailing space was there in
headings of CSV file then error was displayed which will be difficult for a non-technical
person to understand. After this patch, leading and trailing spaces from headings will
be trimmed automatically.
2019-03-23 22:34:28 +05:30
maksudr 710b4e0a4b MDL-62307 mod_feedback: Decode HTML special char in add_form_element() 2019-03-22 15:45:16 +00:00
Mathew May 0c74fb3f82 MDL-60339 course: Course editing only checked against site:manageblocks.
Add in additional capabilities to the page. When all_editing_caps is called it'll check against
moodle/site:manageblocks & added capabilities. If moodle/site:manageblocks
was not set the user would have trouble editing the page.
2019-03-22 13:51:58 +08:00
Damyon Wiese ab3236199d MDL-65153 competencies: Urls course competencies
The template for the course competencies page expects a pluginbaseurl parameter
but the webservice that fetches when rendered by AJAX is missing this property.
2019-03-22 13:18:03 +08:00
Jun Pataleta 67d62946ff MDL-65081 core_output: Unit tests for single_select and url_select 2019-03-22 11:15:24 +08:00
Jun Pataleta 9415d26ea4 MDL-65081 core_output: Set single_select and url_select attributes 2019-03-22 11:15:24 +08:00
Damyon Wiese c2a956a63d MDL-64492 course: Hide activity icons for Ally
Empty alt text results in an image with no label.
role="presentation" does not hide - it only removes the semantic information.
If the image provides no information, make it hidden with aria-hidden.
2019-03-22 11:01:42 +08:00
Simey Lameze d9af5335c2 MDL-63196 core_calendar: add behat scenario 2019-03-22 10:46:02 +08:00
Simey Lameze 4c0ea3f45e MDL-63196 calendar: add missing option to export category events 2019-03-22 10:46:02 +08:00
Damyon Wiese d707892d0c MDL-65149 emoticons: Do not show all emoticons
Allow some emoticons to still work, but not be selectable from the text editor plugins.
2019-03-22 10:07:15 +08:00
Eloy Lafuente (stronk7) d70651f787 weekly release 3.5.5+ 2019-03-21 20:19:36 +01:00
Cameron Ball c55d75120a MDL-65104 registration: Ensure $registration is always null when no record exists 2019-03-21 16:12:31 +08:00
Adrian Greeve 59f0c4b48a Merge branch 'MDL-46803-greedy-roles-reset-MOODLE_35' of https://github.com/DSI-Universite-Rennes2/moodle into MOODLE_35_STABLE 2019-03-21 11:23:42 +08:00
Eloy Lafuente (stronk7) f4ae633fa5 Merge branch 'wip-35-MDL-64563' of https://github.com/adpe/moodle into MOODLE_35_STABLE 2019-03-21 00:44:05 +01:00
Eloy Lafuente (stronk7) 89eded8477 MDL-63263 tool_recyclebin: show the note as part of the heading element
It looks better (IMO) than using admin_setting_description and works in all
branches.
2019-03-21 00:15:08 +01:00
Eloy Lafuente (stronk7) 57b5bf77b7 Merge branch 'MDL-63263-MOODLE_35_STABLE' of https://github.com/tuanngocnguyen/moodle into MOODLE_35_STABLE 2019-03-20 23:16:26 +01:00
Eloy Lafuente (stronk7) dc5d047953 Merge branch 'MDL-65022-35' of https://github.com/Dagefoerde/moodle into MOODLE_35_STABLE 2019-03-20 22:32:10 +01:00
M 8f9f22aeb3 MDL-65038 core_files: Fix typo in function mock_response 2019-03-20 20:52:48 +00:00
Jun Pataleta 500ea66aba Merge branch 'MDL-62872-35' of git://github.com/rezaies/moodle into MOODLE_35_STABLE 2019-03-20 16:30:20 +08:00
Adrian Greeve 5c12024435 Merge branch 'MDL-65005-35-fix' of git://github.com/junpataleta/moodle into MOODLE_35_STABLE 2019-03-20 13:58:38 +08:00
Jun Pataleta 51feaeafa2 MDL-65005 tool_policy: Ensure the user's on the Dashboard after agreeing 2019-03-20 13:13:35 +08:00
Eloy Lafuente (stronk7) bccd34fa0a Merge branch 'MDL-65085_35' of git://github.com/dmonllao/moodle into MOODLE_35_STABLE 2019-03-20 00:40:38 +01:00
Eloy Lafuente (stronk7) 77e067dc2e Merge branch 'MDL-64979-m35' of https://github.com/sammarshallou/moodle into MOODLE_35_STABLE 2019-03-19 22:09:43 +01:00
sam marshall 0ec20a18a4 MDL-64979 Behat: Add option to increase timeouts 2019-03-19 17:13:47 +00:00
Adrian Greeve d402e44ab9 Merge branch 'MDL-64958-35' of git://github.com/junpataleta/moodle into MOODLE_35_STABLE 2019-03-19 13:43:54 +08:00
Adrian Greeve a8ad45b9e8 Merge branch 'MDL-63144-35' of git://github.com/rezaies/moodle into MOODLE_35_STABLE 2019-03-19 11:27:32 +08:00
Eloy Lafuente (stronk7) b60590a2fa Merge branch 'MDL-64974-35' of git://github.com/sarjona/moodle into MOODLE_35_STABLE 2019-03-19 00:23:58 +01:00
Eloy Lafuente (stronk7) 25160a2a05 Merge branch 'MDL-65006-35' of git://github.com/sarjona/moodle into MOODLE_35_STABLE 2019-03-18 23:36:08 +01:00
Julien Boulen 849f7f40c8 MDL-46803 course: Prevent unenrol users with multiple roles during reset 2019-03-18 11:17:58 +01:00
David Monllaó 36ec2d7503 MDL-63906 analytics: Release the lock on \Throwable received 2019-03-18 09:31:46 +01:00
Shamim Rezaie e3a7647ec3 MDL-63152 mod_workshop: Add userid param to calendar callbacks 2019-03-18 15:53:42 +11:00
Shamim Rezaie 70c84f07d7 MDL-63152 mod_workshop: check if the module is visible to the user 2019-03-18 15:53:42 +11:00
Shamim Rezaie 485ac4aeba MDL-62872 atto_recordrtc: max_filesize detection fix 2019-03-18 15:42:15 +11:00
Jake Dallimore ca39432c7a Merge branch 'MDL-65291_35' of git://github.com/stronk7/moodle into MOODLE_35_STABLE 2019-03-16 07:19:30 +08:00
Eloy Lafuente (stronk7) e1de53be9f Merge branch 'MDL-65179-m35' of https://github.com/sammarshallou/moodle into MOODLE_35_STABLE 2019-04-16 20:44:42 +02:00
David Monllaó 7c05382b75 Merge branch 'MDL-62572-35' of git://github.com/damyon/moodle into MOODLE_35_STABLE 2019-04-15 11:07:14 +02:00
David Monllaó 8d371c2174 Merge branch 'wip-MDL-65220-MOODLE_35_STABLE' of https://github.com/jason-platts/moodle into MOODLE_35_STABLE 2019-04-15 07:58:10 +02:00
David Monllaó 457f84654e Merge branch 'MDL-64894-35' of git://github.com/damyon/moodle into MOODLE_35_STABLE 2019-04-15 07:45:48 +02:00
David Monllaó 87648029c4 Merge branch 'MDL-29317-35' of git://github.com/junpataleta/moodle into MOODLE_35_STABLE 2019-04-15 07:43:38 +02:00
Eloy Lafuente (stronk7) 5fd2f276f1 MDL-65291 phpunit: Make a test immune to DST changes 2019-04-15 01:23:03 +02:00
Trisha Milan ba8f84021f MDL-64894 Theme: Fix unable to expand collapsible topics 2019-04-12 14:20:59 +08:00
Damyon Wiese 7f84843045 MDL-62572 backup: Duplicating an activity
Don't apply admin defaults for import when using the duplicate function.
2019-04-12 14:05:09 +08:00
Jason Platts 41bb7608e8 MDL-65220 behat: test scenarios sometimes do not clear database data 2019-03-29 15:30:30 +00:00
Jun Pataleta b9ceefadf0 MDL-29317 gradeimport_csv: Case-insensitive query for email and username
Query using the following fields for
\gradeimport_csv_load_data::check_user_exists() should be done in a
case-insensitive manner:
* email - As agreed in MDL-29315
* username - Although usernames can only be in lowercase during
  registration, usernames are being handled in a case-insensitive
  fashion when logging in. It makes sense to make check_user_exists()
  consistent with this behaviour.
2019-03-29 13:30:06 +08:00
Jun Pataleta 2ff2274ffc MDL-29317 gradeimport_csv: Tests for case-insensitivity 2019-03-29 13:30:06 +08:00
sam marshall 82a46e6f07 MDL-65179 Web service: Token last access is updated too frequently 2019-03-28 17:15:29 +00:00
David Monllaó e34384ed18 MDL-65085 analytics: noreply user sends insights 2019-03-15 13:50:09 +01:00
Nicolas Roeser 43121fbe8b MDL-64790 upgrade: parameter API doc regression fix
Partially update the API documentation of function
upgrade_plugin_savepoint.

This restores consistency between function parameters and API
documentation; as commit 17da2e6f28 (fix
for MDL-16438) had renamed parameter $dir to $plugin, but not also
applied this change to the API documentation.

Also reword the parameter comment text so that it is more meaningful to
developers: document that the parameter contains the name of the plugin.

Change the API documentation of parameter $type as well so that it is
a) correct, and
b) not in conflict with the API documentation for $plugin.
2019-03-15 11:11:44 +01:00
Nathan Nguyen fe033417a6 MDL-63263 tool_recyclebin: Apply automated backup setting
Use Automated backup settings as settings for Recycle bin backup and restore.
2019-03-15 14:53:15 +11:00
Rex Lorenzo 73c24fa02c MDL-63263 tool_recyclebin: Recycle bin should always save user data. 2019-03-15 14:53:15 +11:00
Jake Dallimore b1376641d4 weekly release 3.5.5+ 2019-03-15 11:01:27 +08:00
Paul Holden 546ea12179 MDL-46931 roles: retrieve distinct users in sub-query.
Prevents duplicate key column warning when a user is enrolled in
a course via multiple enrolment methods.
2019-03-14 01:27:42 +01:00
Eloy Lafuente (stronk7) 55c0301d33 Merge branch 'MDL-63146-35' of git://github.com/rezaies/moodle into MOODLE_35_STABLE 2019-03-14 01:22:19 +01:00
Eloy Lafuente (stronk7) cca1025271 Merge branch 'MDL-61585_35' of git://github.com/dmonllao/moodle into MOODLE_35_STABLE 2019-03-14 01:16:14 +01:00
Eloy Lafuente (stronk7) dda86847b1 Merge branch 'MDL-63524-35' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2019-03-13 23:56:58 +01:00
Andrew Nicols 12abff6943 MDL-63524 behat: Do not skip tests on Step 0 error 2019-03-14 06:55:23 +08:00
Juan Leyva e247dabc3a MDL-64615 tool_mobile: Do not modify custom download URLs 2019-03-13 17:10:36 +01:00
Jan Dageförde 22f5807e22 MDL-65022 wiki: declare the cancel button secondary 2019-03-12 09:06:22 +01:00
Shamim Rezaie 3be7a5ce18 MDL-63151 mod_wiki: Add userid param to mod_wiki calendar callbacks 2019-03-12 17:17:05 +11:00
Shamim Rezaie 34667451cf MDL-63151 mod_wiki: check if the module is visible to the user 2019-03-12 17:17:04 +11:00
Sara Arjona b02583be81 MDL-65006 policy: avoid loop when no policies need to be agreeded
Avoid an infinite loop when the user has no policies to agreed but
the policyagreed = 0.
2019-03-11 10:36:37 +01:00
Sara Arjona 4d53d44f2e MDL-64974 badges: add missing configurecriteria capability check 2019-03-11 10:25:49 +01:00
David Monllaó deb6d89f94 MDL-61585 analytics: Include missing indicators 2019-03-11 09:39:51 +01:00
Jun Pataleta 9820d27a23 MDL-64958 gradeimport_csv: Better unit tests for check_user_exists() 2019-03-11 09:36:00 +08:00
Jun Pataleta 78615db17f MDL-64958 grade_import: Ensure correct user is being fetched
* We need to ensure that we are checking the correct user account.
  Since email and idnumber are not unique fields, there's a chance that
  multiple user records will match when querying for user data using
  these fields. This might lead to a different user's grades being
  inadvertently modified during grade import. In such a case, this
  function needs to return a null userid.
2019-03-11 09:36:00 +08:00
David Castro 8d34e84bb9 MDL-65008 question: Query enhancement.
Adding core_question as an additional filter to the tag backup.
2019-03-08 16:34:25 -05:00
Shamim Rezaie f20c9009fa MDL-63149 mod_survey: Add userid param to mod_survey calendar callbacks 2019-03-07 17:54:54 +11:00
Shamim Rezaie 3be433b5d2 MDL-63144 mod_lti: Add userid param to mod_lti calendar callbacks 2019-03-07 17:49:30 +11:00
Shamim Rezaie 3086259abb MDL-63144 mod_lti: Check if the module is visible to the user 2019-03-07 17:49:30 +11:00
Shamim Rezaie 4480118b5d MDL-63146 mod_quiz: Add userid param to mod_quiz calendar callbacks 2019-03-05 14:23:47 +11:00
Adrian Perez ed73a073a3 MDL-64563 theme_boost: Add page site admin category name word-break 2019-02-09 20:17:03 +01:00
509 changed files with 12814 additions and 3611 deletions
+1 -1
View File
@@ -203,7 +203,7 @@
}
},
{
files: ["**/amd/src/*.js"],
files: ["**/amd/src/*.js", "Gruntfile.js"],
// Check AMD with some slightly stricter rules.
rules: {
'no-unused-vars': 'error',
+2
View File
@@ -0,0 +1,2 @@
**/amd/**
/*.js
+1
View File
@@ -0,0 +1 @@
v8.16.1
+2
View File
@@ -11,6 +11,8 @@ notifications:
language: php
dist: trusty
php:
# We only run the highest and lowest supported versions to reduce the load on travis-ci.org.
- 7.2
+1
View File
@@ -24,6 +24,7 @@
* Grunt configuration
*/
/* eslint-env node */
module.exports = function(grunt) {
var path = require('path'),
tasks = {},
+1 -1
View File
@@ -710,7 +710,7 @@ if ($interactive) {
cli_separator();
cli_heading(get_string('cliadminemail', 'install'));
$prompt = get_string('clitypevaluedefault', 'admin', $options['adminemail']);
$options['adminemail'] = cli_input($prompt);
$options['adminemail'] = cli_input($prompt, $options['adminemail']);
}
// Validate that the address provided was an e-mail address.
+364
View File
@@ -2451,6 +2451,7 @@
<VENDOR name="oracle" version="11.2" />
</DATABASE>
<PHP version="7.0.0" level="required">
<RESTRICT function="restrict_php_version_74" message="unsupportedphpversion74" />
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
@@ -2632,6 +2633,7 @@
<VENDOR name="oracle" version="11.2" />
</DATABASE>
<PHP version="7.1.0" level="required">
<RESTRICT function="restrict_php_version_74" message="unsupportedphpversion74" />
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
@@ -2799,4 +2801,366 @@
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
<MOODLE version="3.8" requires="3.2">
<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.6" />
<VENDOR name="postgres" version="9.4" />
<VENDOR name="mssql" version="11.0" />
<VENDOR name="oracle" version="11.2" />
</DATABASE>
<PHP version="7.1.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_CHECK file="lib/upgradelib.php" function="check_sixtyfour_bits" level="optional">
<FEEDBACK>
<ON_CHECK message="sixtyfourbitswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
<MOODLE version="3.9" requires="3.5">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mariadb" version="10.2.29" />
<VENDOR name="mysql" version="5.6" />
<VENDOR name="postgres" version="9.5" />
<VENDOR name="mssql" version="11.0" />
<VENDOR name="oracle" version="11.2" />
</DATABASE>
<PHP version="7.2.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="required">
<FEEDBACK>
<ON_ERROR message="mbstringrequired" />
</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_CHECK file="lib/upgradelib.php" function="check_sixtyfour_bits" level="optional">
<FEEDBACK>
<ON_CHECK message="sixtyfourbitswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
</COMPATIBILITY_MATRIX>
+1 -2
View File
@@ -823,8 +823,7 @@ class core_admin_renderer extends plugin_renderer_base {
*/
protected function registration_warning($registered) {
if (!$registered) {
if (!$registered && site_is_public()) {
if (has_capability('moodle/site:config', context_system::instance())) {
$registerbutton = $this->single_button(new moodle_url('/admin/registration/index.php'),
get_string('register', 'admin'));
+5 -2
View File
@@ -69,8 +69,11 @@ class core_role_check_users_selector extends user_selector_base {
if ($coursecontext and $coursecontext != SITEID) {
$sql1 = " FROM {user} u
JOIN {user_enrolments} ue ON (ue.userid = u.id)
JOIN {enrol} e ON (e.id = ue.enrolid AND e.courseid = :courseid1)
JOIN (SELECT DISTINCT subu.id
FROM {user} subu
JOIN {user_enrolments} ue ON (ue.userid = subu.id)
JOIN {enrol} e ON (e.id = ue.enrolid AND e.courseid = :courseid1)
) subq ON subq.id = u.id
WHERE $wherecondition";
$params['courseid1'] = $coursecontext->instanceid;
+1 -1
View File
@@ -325,7 +325,7 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) {
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_skip_modif_prev', new lang_string('skipmodifprev', 'backup'), new lang_string('skipmodifprevhelp', 'backup'), 0));
// Automated defaults section.
$temp->add(new admin_setting_heading('automatedsettings', new lang_string('automatedsettings','backup'), ''));
$temp->add(new admin_setting_heading('automatedsettings', new lang_string('automatedsettings','backup'), new lang_string('recyclebin_desc', 'backup')));
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_users', new lang_string('generalusers', 'backup'), new lang_string('configgeneralusers', 'backup'), 1));
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_role_assignments', new lang_string('generalroleassignments','backup'), new lang_string('configgeneralroleassignments','backup'), 1));
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_activities', new lang_string('generalactivities','backup'), new lang_string('configgeneralactivities','backup'), 1));
+5 -29
View File
@@ -48,7 +48,6 @@ class behat_admin extends behat_base {
* @param TableNode $table
*/
public function i_set_the_following_administration_settings_values(TableNode $table) {
if (!$data = $table->getRowsHash()) {
return;
}
@@ -57,17 +56,12 @@ class behat_admin extends behat_base {
// We expect admin block to be visible, otherwise go to homepage.
if (!$this->getSession()->getPage()->find('css', '.block_settings')) {
$this->getSession()->visit($this->locate_path('/'));
$this->wait(self::TIMEOUT * 1000, self::PAGE_READY_JS);
$this->execute('behat_forms::i_am_on_homepage');
}
// Search by label.
$searchbox = $this->find_field(get_string('searchinsettings', 'admin'));
$searchbox->setValue($label);
$submitsearch = $this->find('css', 'form.adminsearchform input[type=submit]');
$submitsearch->press();
$this->wait(self::TIMEOUT * 1000, self::PAGE_READY_JS);
$this->execute('behat_forms::i_set_the_field_to', [get_string('searchinsettings', 'admin'), $label]);
$this->execute("behat_general::i_click_on_in_the", [get_string('search', 'admin'), 'button', '.block_settings', 'css_element']);
// Admin settings does not use the same DOM structure than other moodle forms
// but we also need to use lib/behat/form_field/* to deal with the different moodle form elements.
@@ -83,35 +77,17 @@ class behat_admin extends behat_base {
"@id=//span[contains(normalize-space(.), $label)]/preceding-sibling::label[1]/@for]";
$fieldnode = $this->find('xpath', $fieldxpath, $exception);
$formfieldtypenode = $this->find('xpath', $fieldxpath . "/ancestor::div[@class='form-setting']" .
"/child::div[contains(concat(' ', @class, ' '), ' form-')]/child::*/parent::div");
} catch (ElementNotFoundException $e) {
// Multi element settings, interacting only the first one.
$fieldxpath = "//*[label[normalize-space(.)= $label]|span[normalize-space(.)= $label]]/" .
"ancestor::div[contains(concat(' ', normalize-space(@class), ' '), ' form-item ')]" .
"/descendant::div[@class='form-group']/descendant::*[self::input | self::textarea | self::select]" .
"[not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')]";
$fieldnode = $this->find('xpath', $fieldxpath);
// It is the same one that contains the type.
$formfieldtypenode = $fieldnode;
}
// Getting the class which contains the field type.
$classes = explode(' ', $formfieldtypenode->getAttribute('class'));
foreach ($classes as $class) {
if (substr($class, 0, 5) == 'form-') {
$type = substr($class, 5);
}
}
// Instantiating the appropiate field type.
$field = behat_field_manager::get_field_instance($type, $fieldnode, $this->getSession());
$field->set_value($value);
$this->find_button(get_string('savechanges'))->press();
$this->execute('behat_forms::i_set_the_field_with_xpath_to', [$fieldxpath, $value]);
$this->execute("behat_general::i_click_on", [get_string('savechanges'), 'button']);
}
}
@@ -1,57 +1,74 @@
@core @core_admin
Feature: Enable multiple accounts to have the same email address
In order to have multiple accounts registerd on the system with the same email address
@core @core_admin @core_user
Feature: Allowing multiple accounts to have the same email address
In order to manage user accounts
As an admin
I need to enable multiple accounts to be registered with the same email address and verify it is applied
I need to be able to set whether to allow multiple accounts with the same email or not
Background:
Given I log in as "admin"
Scenario: Enable registration of multiple accounts with the same email address
Scenario Outline: Create a user with the same email as an existing user
Given the following config values are set as admin:
| allowaccountssameemail | 1 |
When I navigate to "Add a new user" node in "Site administration>Users>Accounts"
| allowaccountssameemail | <allowsameemail> |
And the following "users" exist:
| username | firstname | lastname | email |
| s1 | John | Doe | s1@example.com |
When I log in as "admin"
And I navigate to "Users > Accounts > Add a new user" in site administration
And I set the following fields to these values:
| Username | testmultiemailuser1 |
| Choose an authentication method | Manual accounts |
| New password | test@User1 |
| First name | Test |
| Surname | Multi1 |
| Email address | testmultiemailuser@example.com |
| Username | s2 |
| First name | Jane |
| Surname | Doe |
| Email address | <email> |
| New password | test |
And I press "Create user"
And I should see "Test Multi1"
And I press "Add a new user"
And I set the following fields to these values:
| Username | testmultiemailuser2 |
| Choose an authentication method | Manual accounts |
| New password | test@User2 |
| First name | Test |
| Surname | Multi2 |
| Email address | testmultiemailuser@example.com |
And I press "Create user"
Then I should see "Test Multi2"
And I should not see "This email address is already registered"
Then I should <expect> "This email address is already registered."
Scenario: Disable registration of multiple accounts with the same email address
Examples:
| allowsameemail | email | expect |
| 0 | s1@example.com | see |
| 0 | S1@EXAMPLE.COM | see |
| 1 | s1@example.com | not see |
| 1 | S1@EXAMPLE.COM | not see |
Scenario Outline: Update a user with the same email as an existing user
Given the following config values are set as admin:
| allowaccountssameemail | 0 |
When I navigate to "Add a new user" node in "Site administration>Users>Accounts"
And I set the following fields to these values:
| Username | testmultiemailuser1 |
| Choose an authentication method | Manual accounts |
| New password | test@User1 |
| First name | Test |
| Surname | Multi1 |
| Email address | testmultiemailuser@example.com |
And I press "Create user"
And I should see "Test Multi1"
And I press "Add a new user"
And I set the following fields to these values:
| Username | testmultiemailuser2 |
| Choose an authentication method | Manual accounts |
| New password | test@User2 |
| First name | Test |
| Surname | Multi2 |
| Email address | testmultiemailuser@example.com |
And I press "Create user"
Then I should see "This email address is already registered"
| allowaccountssameemail | <allowsameemail> |
And the following "users" exist:
| username | firstname | lastname | email |
| s1 | John | Doe | s1@example.com |
| s2 | Jane | Doe | s2@example.com |
When I log in as "admin"
And I navigate to "Users > Accounts > Browse list of users" in site administration
And I click on "Edit" "link" in the "Jane Doe" "table_row"
And I set the field "Email address" to "<email>"
And I press "Update profile"
Then I should <expect> "This email address is already registered."
Examples:
| allowsameemail | email | expect |
| 0 | s1@example.com | see |
| 0 | S1@EXAMPLE.COM | see |
| 1 | s1@example.com | not see |
| 1 | S1@EXAMPLE.COM | not see |
| 0 | S2@EXAMPLE.COM | not see |
| 1 | S2@EXAMPLE.COM | not see |
Scenario Outline: Update own user profile with the same email as an existing user
Given the following config values are set as admin:
| allowaccountssameemail | <allowsameemail> |
And the following "users" exist:
| username | firstname | lastname | email |
| s1 | John | Doe | s1@example.com |
| s2 | Jane | Doe | s2@example.com |
When I log in as "s2"
And I open my profile in edit mode
And I set the field "Email address" to "<email>"
And I press "Update profile"
Then I should <expect> "This email address is already registered."
Examples:
| allowsameemail | email | expect |
| 0 | s1@example.com | see |
| 0 | S1@EXAMPLE.COM | see |
| 1 | s1@example.com | not see |
| 1 | S1@EXAMPLE.COM | not see |
| 0 | S2@EXAMPLE.COM | not see |
| 1 | S2@EXAMPLE.COM | not see |
+1
View File
@@ -9,6 +9,7 @@ Feature: Manage tokens
| username | password | firstname | lastname |
| testuser | testuser | Joe | Bloggs |
| testuser2 | testuser2 | TestFirstname | TestLastname |
And I change window size to "small"
And I log in as "admin"
And I am on site homepage
+3 -3
View File
@@ -162,11 +162,11 @@ class tool_behat_renderer extends plugin_renderer_base {
$html .= $this->output->heading($title);
// Info.
$installurl = behat_command::DOCS_URL . '#Installation';
$installurl = behat_command::DOCS_URL;
$installlink = html_writer::tag('a', $installurl, array('href' => $installurl, 'target' => '_blank'));
$writetestsurl = behat_command::DOCS_URL . '#Writing_features';
$writetestsurl = 'https://docs.moodle.org/dev/Writing acceptance tests';
$writetestslink = html_writer::tag('a', $writetestsurl, array('href' => $writetestsurl, 'target' => '_blank'));
$writestepsurl = behat_command::DOCS_URL . '#Adding_steps_definitions';
$writestepsurl = 'https://docs.moodle.org/dev/Writing_new_acceptance_test_step_definitions';
$writestepslink = html_writer::tag('a', $writestepsurl, array('href' => $writestepsurl, 'target' => '_blank'));
$infos = array(
get_string('installinfo', 'tool_behat', $installlink),
@@ -0,0 +1,27 @@
@tool_behat
Feature: Behat steps for interacting with form work
In order to test my Moodle code
As a developer
I need the Behat steps for form elements to work reliably
@javascript
Scenario: Test fields in containers
Given the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
When I log in as "admin"
And I am on "Course 1" course homepage
# Just get to any form.
And I navigate to "Edit settings" in current page administration
And I set the field "Course full name" in the "General" "fieldset" to "Frog"
And I set the following fields in the "Appearance" "fieldset" to these values:
| Show activity reports | Yes |
| Number of announcements | 1 |
Then the field "Show activity reports" in the "Appearance" "fieldset" matches value "Yes"
And the field "Show activity reports" in the "Appearance" "fieldset" does not match value "No"
And the following fields in the "region-main" "region" match these values:
| Course full name | Frog |
| Number of announcements | 1 |
And the following fields in the "region-main" "region" do not match these values:
| Course full name | Course 1 |
| Number of announcements | 5 |
+42
View File
@@ -222,6 +222,48 @@ class api {
}
}
// Clean the legacy role assignments which are stale.
$paramsclean['usercontext'] = CONTEXT_USER;
$paramsclean['component'] = 'tool_cohortroles';
$sql = 'SELECT DISTINCT(ra.id), ra.roleid, ra.userid, ra.contextid, ctx.instanceid
FROM {role_assignments} ra
JOIN {context} ctx ON ctx.id = ra.contextid AND ctx.contextlevel = :usercontext
JOIN {cohort_members} cm ON cm.userid = ctx.instanceid
LEFT JOIN {tool_cohortroles} tc ON tc.cohortid = cm.cohortid
AND tc.userid = ra.userid
AND tc.roleid = ra.roleid
WHERE ra.component = :component
AND tc.id is null';
if ($candidatelegacyassignments = $DB->get_records_sql($sql, $paramsclean)) {
$sql = 'SELECT DISTINCT(ra.id)
FROM {role_assignments} ra
JOIN {context} ctx ON ctx.id = ra.contextid AND ctx.contextlevel = :usercontext
JOIN {cohort_members} cm ON cm.userid = ctx.instanceid
JOIN {tool_cohortroles} tc ON tc.cohortid = cm.cohortid AND tc.userid = ra.userid
WHERE ra.component = :component';
if ($currentvalidroleassignments = $DB->get_records_sql($sql, $paramsclean)) {
foreach ($candidatelegacyassignments as $candidate) {
if (!array_key_exists($candidate->id, $currentvalidroleassignments)) {
role_unassign($candidate->roleid, $candidate->userid, $candidate->contextid, 'tool_cohortroles');
$rolesremoved[] = array(
'useridassignedto' => $candidate->userid,
'useridassignedover' => $candidate->instanceid,
'roleid' => $candidate->roleid
);
}
}
} else {
foreach ($candidatelegacyassignments as $candidate) {
role_unassign($candidate->roleid, $candidate->userid, $candidate->contextid, 'tool_cohortroles');
$rolesremoved[] = array(
'useridassignedto' => $candidate->userid,
'useridassignedover' => $candidate->instanceid,
'roleid' => $candidate->roleid
);
}
}
}
return array('rolesadded' => $rolesadded, 'rolesremoved' => $rolesremoved);
}
@@ -103,5 +103,4 @@ class cohort_role_assignment extends persistent {
return true;
}
}
+82 -7
View File
@@ -50,8 +50,6 @@ class tool_cohortroles_api_testcase extends advanced_testcase {
* Setup function- we will create a course and add an assign instance to it.
*/
protected function setUp() {
global $DB;
$this->resetAfterTest(true);
// Create some users.
@@ -133,14 +131,91 @@ class tool_cohortroles_api_testcase extends advanced_testcase {
public function test_delete_cohort_role_assignment() {
$this->setAdminUser();
$params = (object) array(
// Create a cohort role assigment.
$params = (object) [
'userid' => $this->userassignto->id,
'roleid' => $this->roleid,
'cohortid' => $this->cohort->id
);
$result = api::create_cohort_role_assignment($params);
$worked = api::delete_cohort_role_assignment($result->get('id'));
$this->assertTrue($worked);
];
$cohortroleassignment = api::create_cohort_role_assignment($params);
$sync = api::sync_all_cohort_roles();
$rolesadded = [
[
'useridassignedto' => $this->userassignto->id,
'useridassignedover' => $this->userassignover->id,
'roleid' => $this->roleid
]
];
$expected = [
'rolesadded' => $rolesadded,
'rolesremoved' => []
];
$this->assertEquals($sync, $expected);
// Delete the cohort role assigment and confirm the roles are removed.
$result = api::delete_cohort_role_assignment($cohortroleassignment->get('id'));
$this->assertTrue($result);
$sync = api::sync_all_cohort_roles();
$expected = [
'rolesadded' => [],
'rolesremoved' => $rolesadded
];
$this->assertEquals($expected, $sync);
}
/**
* Test case verifying that syncing won't remove role assignments if they are valid for another cohort role assignment.
*/
public function test_delete_cohort_role_assignment_cohorts_having_same_members() {
$this->setAdminUser();
// Create 2 cohorts, with a 1 user (user1) present in both,
// and user2 and user3 members of 1 cohort each.
$cohort1 = $this->getDataGenerator()->create_cohort();
$cohort2 = $this->getDataGenerator()->create_cohort();
$user1 = $this->getDataGenerator()->create_user();
$user2 = $this->getDataGenerator()->create_user();
$user3 = $this->getDataGenerator()->create_user();
cohort_add_member($cohort1->id, $user1->id);
cohort_add_member($cohort1->id, $user2->id);
cohort_add_member($cohort2->id, $user1->id);
cohort_add_member($cohort2->id, $user3->id);
// And a role and a user to assign that role to.
$user4 = $this->getDataGenerator()->create_user(); // A cohort manager, for example.
$roleid = create_role('Role 1', 'myrole', 'test');
// Assign the role for user4 in both cohorts.
$params = (object) [
'userid' => $user4->id,
'roleid' => $roleid,
'cohortid' => $cohort1->id
];
$cohort1roleassignment = api::create_cohort_role_assignment($params);
$params->cohortid = $cohort2->id;
$cohort2roleassignment = api::create_cohort_role_assignment($params);
$sync = api::sync_all_cohort_roles();
// There is no guarantee about the order of roles assigned.
// so confirm we have 3 role assignments, and they are for the users 1, 2 and 3.
$this->assertCount(3, $sync['rolesadded']);
$addedusers = array_column($sync['rolesadded'], 'useridassignedover');
$this->assertContains($user1->id, $addedusers);
$this->assertContains($user2->id, $addedusers);
$this->assertContains($user3->id, $addedusers);
// Remove the role assignment for user4/cohort1.
// Verify only 1 role is unassigned as the others are still valid for the other cohort role assignment.
$result = api::delete_cohort_role_assignment($cohort1roleassignment->get('id'));
$this->assertTrue($result);
$sync = api::sync_all_cohort_roles();
$this->assertCount(0, $sync['rolesadded']);
$this->assertCount(1, $sync['rolesremoved']);
$removedusers = array_column($sync['rolesremoved'], 'useridassignedover');
$this->assertContains($user2->id, $removedusers);
}
public function test_list_cohort_role_assignments() {
@@ -440,6 +440,9 @@ class purpose extends persistent {
}
if (!empty($data->sensitivedatareasons) && is_array($data->sensitivedatareasons)) {
$data->sensitivedatareasons = implode(',', $data->sensitivedatareasons);
} else {
// Nothing selected. Set default value of null.
$data->sensitivedatareasons = null;
}
// A single value.
@@ -137,7 +137,7 @@
}} data-status="{{status}}"{{!
}}>
<td>{{typename}}</td>
<td>{{#userdate}} {{timecreated}}, {{#str}} strftimedatetime {{/str}} {{/userdate}}</td>
<td>{{#userdate}} {{timecreated}}, {{#str}} strftimedatetime, core_langconfig {{/str}} {{/userdate}}</td>
<td><a href="{{requestedbyuser.profileurl}}" title="{{#str}}viewprofile{{/str}}">{{requestedbyuser.fullname}}</a></td>
<td>
<span class="label {{statuslabelclass}}" title="{{statuslabeltitle}}">{{statuslabel}}</span>
@@ -67,7 +67,8 @@
<a href="mailto:{{foruser.email}}">{{foruser.email}}</a>
<div class="clearfix m-t-1 m-b-1">
<span class="pull-left m-r-1">
<strong>{{#str}}daterequesteddetail, tool_dataprivacy{{/str}}</strong> {{#userdate}} {{timecreated}}, {{#str}} strftimedatetime {{/str}} {{/userdate}}
<strong>{{#str}}daterequesteddetail, tool_dataprivacy{{/str}}</strong>
{{#userdate}} {{timecreated}}, {{#str}} strftimedatetime, core_langconfig {{/str}} {{/userdate}}
</span>
<span class="pull-left m-r-1">
<strong>{{#str}}statusdetail, tool_dataprivacy{{/str}}</strong>
@@ -337,6 +337,11 @@ class tool_dataprivacy_api_testcase extends advanced_testcase {
$datarequest = api::create_data_request($student->id, api::DATAREQUEST_TYPE_EXPORT);
$requestid = $datarequest->get('id');
// Login as a user without DPO role.
$this->setUser($teacher);
$this->expectException(required_capability_exception::class);
api::approve_data_request($requestid);
}
/**
@@ -137,14 +137,14 @@ abstract class restore_tool_log_logstore_subplugin extends restore_subplugin {
}
}
}
// Now we want to serialize it so we can store it in the DB.
$data->other = serialize($data->other);
} else {
$message = "Event class not found: \"$eventclass\". Skipping log record.";
$this->log($message, backup::LOG_DEBUG);
return; // No such class, can not restore.
}
}
// Now we want to serialize it so we can store it in the DB.
$data->other = serialize($data->other);
return $data;
}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1 +1 @@
define(["jquery","core/notification","tool_lp/dialogue","core/str","core/ajax","core/templates"],function(a,b,c,d,e,f){var g=function(b){a(b).on("click",this.configureSettings.bind(this))};return g.prototype._dialogue=null,g.prototype.configureSettings=function(e){var g=a(e.target).closest("a").data("courseid"),h=a(e.target).closest("a").data("pushratingstouserplans"),i={courseid:g,settings:{pushratingstouserplans:h}};e.preventDefault(),f.render("tool_lp/course_competency_settings",i).done(function(a){d.get_string("configurecoursecompetencysettings","tool_lp").done(function(b){this._dialogue=new c(b,a,this.addListeners.bind(this))}.bind(this)).fail(b.exception)}.bind(this)).fail(b.exception)},g.prototype.addListeners=function(){var a=this._find('[data-action="save"]');a.on("click",this.saveSettings.bind(this));var b=this._find('[data-action="cancel"]');b.on("click",this.cancelChanges.bind(this))},g.prototype.cancelChanges=function(a){a.preventDefault(),this._dialogue.close()},g.prototype._find=function(b){return a('[data-region="coursecompetencysettings"]').find(b)},g.prototype.saveSettings=function(a){a.preventDefault();var c=this._find('input[name="pushratingstouserplans"]:checked').val(),d=this._find('input[name="courseid"]').val(),f={pushratingstouserplans:c};e.call([{methodname:"core_competency_update_course_competency_settings",args:{courseid:d,settings:f}}])[0].done(function(){this.refreshCourseCompetenciesPage()}.bind(this)).fail(b.exception)},g.prototype.refreshCourseCompetenciesPage=function(){var c=this._find('input[name="courseid"]').val();e.call([{methodname:"tool_lp_data_for_course_competencies_page",args:{courseid:c}}])[0].done(function(c){f.render("tool_lp/course_competencies_page",c).done(function(b,c){a('[data-region="coursecompetenciespage"]').replaceWith(b),f.runTemplateJS(c),this._dialogue.close()}.bind(this)).fail(b.exception)}.bind(this)).fail(b.exception)},g});
define(["jquery","core/notification","tool_lp/dialogue","core/str","core/ajax","core/templates","core/pending"],function(a,b,c,d,e,f,g){var h=function(b){a(b).on("click",this.configureSettings.bind(this))};return h.prototype._dialogue=null,h.prototype.configureSettings=function(e){var h=new g,i=a(e.target).closest("a").data("courseid"),j=a(e.target).closest("a").data("pushratingstouserplans"),k={courseid:i,settings:{pushratingstouserplans:j}};e.preventDefault(),a.when(d.get_string("configurecoursecompetencysettings","tool_lp"),f.render("tool_lp/course_competency_settings",k)).then(function(a,b){return this._dialogue=new c(a,b[0],this.addListeners.bind(this)),this._dialogue}.bind(this)).then(h.resolve)["catch"](b.exception)},h.prototype.addListeners=function(){var a=this._find('[data-action="save"]');a.on("click",this.saveSettings.bind(this));var b=this._find('[data-action="cancel"]');b.on("click",this.cancelChanges.bind(this))},h.prototype.cancelChanges=function(a){a.preventDefault(),this._dialogue.close()},h.prototype._find=function(b){return a('[data-region="coursecompetencysettings"]').find(b)},h.prototype.saveSettings=function(a){var c=new g;a.preventDefault();var d=this._find('input[name="pushratingstouserplans"]:checked').val(),f=this._find('input[name="courseid"]').val(),h={pushratingstouserplans:d};e.call([{methodname:"core_competency_update_course_competency_settings",args:{courseid:f,settings:h}}])[0].then(function(){return this.refreshCourseCompetenciesPage()}.bind(this)).then(c.resolve)["catch"](b.exception)},h.prototype.refreshCourseCompetenciesPage=function(){var c=this._find('input[name="courseid"]').val(),d=new g;e.call([{methodname:"tool_lp_data_for_course_competencies_page",args:{courseid:c}}])[0].then(function(a){return f.render("tool_lp/course_competencies_page",a)}).then(function(b,c){f.replaceNode(a('[data-region="coursecompetenciespage"]'),b,c),this._dialogue.close()}.bind(this)).then(d.resolve)["catch"](b.exception)},h});
+1 -1
View File
@@ -1 +1 @@
define(["jquery","core/notification","core/templates","tool_lp/dialogue","tool_lp/event_base","core/str"],function(a,b,c,d,e,f){var g=function(a){e.prototype.constructor.apply(this,[]),this._ratingOptions=a};return g.prototype=Object.create(e.prototype),g.prototype._popup=null,g.prototype._ratingOptions=null,g.prototype._afterRender=function(){var b=this._find('[data-action="rate"]'),c=this._find('[name="rating"]'),d=this._find('[name="comment"]');this._find('[data-action="cancel"]').click(function(a){a.preventDefault(),this._trigger("cancelled"),this.close()}.bind(this)),c.change(function(){var c=a(this);c.val()?b.prop("disabled",!1):b.prop("disabled",!0)}).change(),b.click(function(a){a.preventDefault();var b=c.val();b&&(this._trigger("rated",{rating:b,note:d.val()}),this.close())}.bind(this))},g.prototype.close=function(){this._popup.close(),this._popup=null},g.prototype.display=function(){return this._render().then(function(a){return f.get_string("rate","tool_lp").then(function(b){this._popup=new d(b,a,this._afterRender.bind(this))}.bind(this))}.bind(this)).fail(b.exception)},g.prototype._find=function(b){return a(this._popup.getContent()).find(b)},g.prototype._render=function(){var a={cangrade:this._canGrade,ratings:this._ratingOptions};return c.render("tool_lp/competency_grader",a)},g});
define(["jquery","core/notification","core/templates","tool_lp/dialogue","tool_lp/event_base","core/str"],function(a,b,c,d,e,f){var g=function(a){e.prototype.constructor.apply(this,[]),this._ratingOptions=a};return g.prototype=Object.create(e.prototype),g.prototype._popup=null,g.prototype._ratingOptions=null,g.prototype._afterRender=function(){var b=this._find('[data-action="rate"]'),c=this._find('[name="rating"]'),d=this._find('[name="comment"]');this._find('[data-action="cancel"]').click(function(a){a.preventDefault(),this._trigger("cancelled"),this.close()}.bind(this)),c.change(function(){var c=a(this);c.val()?b.prop("disabled",!1):b.prop("disabled",!0)}).change(),b.click(function(a){a.preventDefault();var b=c.val();b&&(this._trigger("rated",{rating:b,note:d.val()}),this.close())}.bind(this))},g.prototype.close=function(){this._popup.close(),this._popup=null},g.prototype.display=function(){return a.when(f.get_string("rate","tool_lp"),this._render()).then(function(a,b){return this._popup=new d(a,b[0],this._afterRender.bind(this)),this._popup}.bind(this))["catch"](b.exception)},g.prototype._find=function(b){return a(this._popup.getContent()).find(b)},g.prototype._render=function(){var a={cangrade:this._canGrade,ratings:this._ratingOptions};return c.render("tool_lp/competency_grader",a)},g});
@@ -1 +1 @@
define(["jquery","core/notification","core/ajax","core/log","tool_lp/grade_dialogue","tool_lp/event_base","tool_lp/scalevalues"],function(a,b,c,d,e,f,g){var h=function(b,c,d,e,g,h,i){f.prototype.constructor.apply(this,[]);var j=a(b);if(!j.length)throw new Error("Could not find the trigger");this._scaleId=c,this._competencyId=d,this._userId=e,this._planId=g,this._courseId=h,this._chooseStr=i,this._setUp(),j.click(function(a){a.preventDefault(),this._dialogue.display()}.bind(this)),this._planId?(this._methodName="core_competency_grade_competency_in_plan",this._args={competencyid:this._competencyId,planid:this._planId}):this._courseId?(this._methodName="core_competency_grade_competency_in_course",this._args={competencyid:this._competencyId,courseid:this._courseId,userid:this._userId}):(this._methodName="core_competency_grade_competency",this._args={userid:this._userId,competencyid:this._competencyId})};return h.prototype=Object.create(f.prototype),h.prototype._setUp=function(){var a=[],d=this,f=g.get_values(d._scaleId);f.done(function(f){a.push({value:"",name:d._chooseStr});for(var g=0;g<f.length;g++){var h=f[g];a.push({value:h.id,name:h.name})}d._dialogue=new e(a),d._dialogue.on("rated",function(a,e){var f=d._args;f.grade=e.rating,f.note=e.note,c.call([{methodname:d._methodName,args:f,done:function(a){d._trigger("competencyupdated",{args:f,evidence:a})},fail:b.exception}])})}).fail(b.exception)},h.prototype._scaleId=null,h.prototype._competencyId=null,h.prototype._userId=null,h.prototype._planId=null,h.prototype._courseId=null,h.prototype._chooseStr=null,h.prototype._dialogue=null,h});
define(["jquery","core/notification","core/ajax","core/log","tool_lp/grade_dialogue","tool_lp/event_base","tool_lp/scalevalues"],function(a,b,c,d,e,f,g){var h=function(b,c,d,e,g,h,i){f.prototype.constructor.apply(this,[]);var j=a(b);if(!j.length)throw new Error("Could not find the trigger");this._scaleId=c,this._competencyId=d,this._userId=e,this._planId=g,this._courseId=h,this._chooseStr=i,this._setUp(),j.click(function(a){a.preventDefault(),this._dialogue.display()}.bind(this)),this._planId?(this._methodName="core_competency_grade_competency_in_plan",this._args={competencyid:this._competencyId,planid:this._planId}):this._courseId?(this._methodName="core_competency_grade_competency_in_course",this._args={competencyid:this._competencyId,courseid:this._courseId,userid:this._userId}):(this._methodName="core_competency_grade_competency",this._args={userid:this._userId,competencyid:this._competencyId})};return h.prototype=Object.create(f.prototype),h.prototype._setUp=function(){var a=[],d=this,f=g.get_values(d._scaleId);f.then(function(b){a.push({value:"",name:d._chooseStr});for(var c=0;c<b.length;c++){var e=b[c];a.push({value:e.id,name:e.name})}return a}).then(function(a){return new e(a)}).then(function(a){return a.on("rated",function(a,e){var f=d._args;f.grade=e.rating,f.note=e.note,c.call([{methodname:d._methodName,args:f,done:function(a){d._trigger("competencyupdated",{args:f,evidence:a})},fail:b.exception}])}),a}).then(function(a){d._dialogue=a}).fail(b.exception)},h.prototype._scaleId=null,h.prototype._competencyId=null,h.prototype._userId=null,h.prototype._planId=null,h.prototype._courseId=null,h.prototype._chooseStr=null,h.prototype._dialogue=null,h});
+28 -15
View File
@@ -27,8 +27,9 @@ define(['jquery',
'core/templates',
'core/str',
'tool_lp/competencypicker',
'tool_lp/dragdrop-reorder'],
function($, notification, ajax, templates, str, Picker, dragdrop) {
'tool_lp/dragdrop-reorder',
'core/pending'],
function($, notification, ajax, templates, str, Picker, dragdrop, Pending) {
/**
* Constructor
@@ -117,6 +118,7 @@ define(['jquery',
* Pick a competency
*
* @method pickCompetency
* @return {Promise}
*/
competencies.prototype.pickCompetency = function() {
var self = this;
@@ -132,6 +134,7 @@ define(['jquery',
self.pickerInstance = new Picker(self.pageContextId, false, pageContextIncludes);
self.pickerInstance.on('save', function(e, data) {
var compIds = data.competencyIds;
var pendingPromise = new Pending();
if (self.itemtype === "course") {
requests = [];
@@ -181,17 +184,20 @@ define(['jquery',
pagerender = 'tool_lp/plan_page';
pageregion = 'plan-page';
}
ajax.call(requests)[requests.length - 1].then(function(context) {
ajax.call(requests)[requests.length - 1]
.then(function(context) {
return templates.render(pagerender, context);
}).then(function(html, js) {
$('[data-region="' + pageregion + '"]').replaceWith(html);
templates.runTemplateJS(js);
})
.then(function(html, js) {
templates.replaceNode($('[data-region="' + pageregion + '"]'), html, js);
return;
}).catch(notification.exception);
})
.then(pendingPromise.resolve)
.catch(notification.exception);
});
}
self.pickerInstance.display();
return self.pickerInstance.display();
};
/**
@@ -302,6 +308,7 @@ define(['jquery',
if (localthis.itemtype == 'course') {
// Course completion rule handling.
$('[data-region="coursecompetenciespage"]').on('change', 'select[data-field="ruleoutcome"]', function(e) {
var pendingPromise = new Pending();
var requests = [];
var pagerender = 'tool_lp/course_competencies_page';
var pageregion = 'coursecompetenciespage';
@@ -314,18 +321,24 @@ define(['jquery',
args: {courseid: localthis.itemid}}
]);
requests[1].done(function(context) {
templates.render(pagerender, context).done(function(html, js) {
$('[data-region="' + pageregion + '"]').replaceWith(html);
templates.runTemplateJS(js);
}).fail(notification.exception);
}).fail(notification.exception);
requests[1].then(function(context) {
return templates.render(pagerender, context);
})
.then(function(html, js) {
return templates.replaceNode($('[data-region="' + pageregion + '"]'), html, js);
})
.then(pendingPromise.resolve)
.catch(notification.exception);
});
}
$('[data-region="actions"] button').click(function(e) {
var pendingPromise = new Pending();
e.preventDefault();
localthis.pickCompetency();
localthis.pickCompetency()
.then(pendingPromise.resolve)
.catch();
});
$('[data-action="delete-competency-link"]').click(function(e) {
e.preventDefault();
+10 -3
View File
@@ -33,8 +33,12 @@ define(['jquery',
'tool_lp/menubar',
'tool_lp/competencypicker',
'tool_lp/competency_outcomes',
'tool_lp/competencyruleconfig'],
function($, url, templates, notification, str, ajax, dragdrop, Ariatree, Dialogue, menubar, Picker, Outcomes, RuleConfig) {
'tool_lp/competencyruleconfig',
'core/pending',
],
function(
$, url, templates, notification, str, ajax, dragdrop, Ariatree, Dialogue, menubar, Picker, Outcomes, RuleConfig, Pending
) {
// Private variables and functions.
/** @var {Object} treeModel - This is an object representing the nodes in the tree. */
@@ -412,6 +416,7 @@ define(['jquery',
if (!pickerInstance) {
pickerInstance = new Picker(pageContextId, relatedTarget.competencyframeworkid);
pickerInstance.on('save', function(e, data) {
var pendingPromise = new Pending();
var compIds = data.competencyIds;
var calls = [];
@@ -436,7 +441,9 @@ define(['jquery',
templates.runTemplateJS(js);
updatedRelatedCompetencies();
return;
}).catch(notification.exception);
})
.then(pendingPromise.resolve)
.catch(notification.exception);
});
}
+8 -2
View File
@@ -31,8 +31,10 @@ define(['jquery',
'core/templates',
'tool_lp/dialogue',
'core/str',
'tool_lp/tree'],
function($, Notification, Ajax, Templates, Dialogue, Str, Tree) {
'tool_lp/tree',
'core/pending'
],
function($, Notification, Ajax, Templates, Dialogue, Str, Tree, Pending) {
/**
* Competency picker class.
@@ -157,6 +159,7 @@ define(['jquery',
// Add listener for add.
self._find('[data-region="competencylinktree"] [data-action="add"]').click(function(e) {
e.preventDefault();
var pendingPromise = new Pending();
if (!self._selectedCompetencies.length) {
return;
}
@@ -168,7 +171,10 @@ define(['jquery',
self._trigger('save', {competencyId: self._selectedCompetencies[0]});
}
// The dialogue here is a YUI dialogue and doesn't support Promises at all.
// However, it is typically synchronous so this shoudl suffice.
self.close();
pendingPromise.resolve();
});
// The list of selected competencies will be modified while looping (because of the listeners above).
@@ -26,8 +26,10 @@ define(['jquery',
'tool_lp/dialogue',
'core/str',
'core/ajax',
'core/templates'],
function($, notification, Dialogue, str, ajax, templates) {
'core/templates',
'core/pending'
],
function($, notification, Dialogue, str, ajax, templates, Pending) {
/**
* Constructor
@@ -48,6 +50,7 @@ define(['jquery',
* @method configureSettings
*/
settingsMod.prototype.configureSettings = function(e) {
var pendingPromise = new Pending();
var courseid = $(e.target).closest('a').data('courseid');
var currentValue = $(e.target).closest('a').data('pushratingstouserplans');
var context = {
@@ -56,16 +59,21 @@ define(['jquery',
};
e.preventDefault();
templates.render('tool_lp/course_competency_settings', context).done(function(html) {
str.get_string('configurecoursecompetencysettings', 'tool_lp').done(function(title) {
this._dialogue = new Dialogue(
title,
html,
this.addListeners.bind(this)
);
}.bind(this)).fail(notification.exception);
}.bind(this)).fail(notification.exception);
$.when(
str.get_string('configurecoursecompetencysettings', 'tool_lp'),
templates.render('tool_lp/course_competency_settings', context)
)
.then(function(title, templateResult) {
this._dialogue = new Dialogue(
title,
templateResult[0],
this.addListeners.bind(this)
);
return this._dialogue;
}.bind(this))
.then(pendingPromise.resolve)
.catch(notification.exception);
};
/**
@@ -108,6 +116,7 @@ define(['jquery',
* @method saveSettings
*/
settingsMod.prototype.saveSettings = function(e) {
var pendingPromise = new Pending();
e.preventDefault();
var newValue = this._find('input[name="pushratingstouserplans"]:checked').val();
@@ -117,9 +126,12 @@ define(['jquery',
ajax.call([
{methodname: 'core_competency_update_course_competency_settings',
args: {courseid: courseId, settings: settings}}
])[0].done(function() {
this.refreshCourseCompetenciesPage();
}.bind(this)).fail(notification.exception);
])[0]
.then(function() {
return this.refreshCourseCompetenciesPage();
}.bind(this))
.then(pendingPromise.resolve)
.catch(notification.exception);
};
@@ -131,18 +143,23 @@ define(['jquery',
*/
settingsMod.prototype.refreshCourseCompetenciesPage = function() {
var courseId = this._find('input[name="courseid"]').val();
var pendingPromise = new Pending();
ajax.call([
{methodname: 'tool_lp_data_for_course_competencies_page',
args: {courseid: courseId}}
])[0].done(function(context) {
templates.render('tool_lp/course_competencies_page', context).done(function(html, js) {
$('[data-region="coursecompetenciespage"]').replaceWith(html);
templates.runTemplateJS(js);
this._dialogue.close();
}.bind(this)).fail(notification.exception);
}.bind(this)).fail(notification.exception);
])[0]
.then(function(context) {
return templates.render('tool_lp/course_competencies_page', context);
})
.then(function(html, js) {
templates.replaceNode($('[data-region="coursecompetenciespage"]'), html, js);
this._dialogue.close();
return;
}.bind(this))
.then(pendingPromise.resolve)
.catch(notification.exception);
};
return /** @alias module:tool_lp/configurecoursecompetencysettings */ settingsMod;
+14 -9
View File
@@ -102,15 +102,20 @@ define(['jquery',
* @return {Promise}
*/
Grade.prototype.display = function() {
return this._render().then(function(html) {
return Str.get_string('rate', 'tool_lp').then(function(title) {
this._popup = new Dialogue(
title,
html,
this._afterRender.bind(this)
);
}.bind(this));
}.bind(this)).fail(Notification.exception);
return $.when(
Str.get_string('rate', 'tool_lp'),
this._render()
)
.then(function(title, templateResult) {
this._popup = new Dialogue(
title,
templateResult[0],
this._afterRender.bind(this)
);
return this._popup;
}.bind(this))
.catch(Notification.exception);
};
/**
@@ -95,7 +95,7 @@ define(['jquery',
self = this;
var promise = ScaleValues.get_values(self._scaleId);
promise.done(function(scalevalues) {
promise.then(function(scalevalues) {
options.push({
value: '',
name: self._chooseStr
@@ -109,8 +109,13 @@ define(['jquery',
});
}
self._dialogue = new GradeDialogue(options);
self._dialogue.on('rated', function(e, data) {
return options;
})
.then(function(options) {
return new GradeDialogue(options);
})
.then(function(dialogue) {
dialogue.on('rated', function(e, data) {
var args = self._args;
args.grade = data.rating;
args.note = data.note;
@@ -123,7 +128,15 @@ define(['jquery',
fail: notification.exception
}]);
});
}).fail(notification.exception);
return dialogue;
})
.then(function(dialogue) {
self._dialogue = dialogue;
return;
})
.fail(notification.exception);
};
/** @type {Number} The scale id for this competency. */
+1
View File
@@ -422,6 +422,7 @@ class external extends external_api {
'comppath' => competency_path_exporter::get_read_structure(),
))),
'manageurl' => new external_value(PARAM_LOCALURL, 'Url to the manage competencies page.'),
'pluginbaseurl' => new external_value(PARAM_LOCALURL, 'Url to the course competencies page.'),
));
}
@@ -113,6 +113,7 @@ class course_competencies_page implements renderable, templatable {
$data->courseid = $this->courseid;
$data->pagecontextid = $this->context->id;
$data->competencies = array();
$data->pluginbaseurl = (new moodle_url('/admin/tool/lp'))->out(true);
$gradable = is_enrolled($this->context, $USER, 'moodle/competency:coursecompetencygradable');
if ($gradable) {
@@ -66,7 +66,7 @@
<div class="clearfix"></div>
{{/canmanagecoursecompetencies}}
{{#competency}}
<a href="{{pluginbaseurl}}user_competency_in_course.php?courseid={{courseid}}&competencyid={{competency.id}}&userid={{gradableuserid}}"
<a href="{{pluginbaseurl}}/user_competency_in_course.php?courseid={{courseid}}&competencyid={{competency.id}}&userid={{gradableuserid}}"
id="competency-info-link-{{competency.id}}"
title="{{#str}}viewdetails, tool_lp{{/str}}">
<p><strong>{{{competency.shortname}}} <em>{{competency.idnumber}}</em></strong></p>
@@ -6,6 +6,7 @@ Feature: Manage competency frameworks
Background:
Given I log in as "admin"
And I change window size to "small"
And I am on site homepage
Scenario: Create a new framework
@@ -6,6 +6,7 @@ Feature: Manage plearning plan templates
Background:
Given I log in as "admin"
And I change window size to "small"
And I am on site homepage
Scenario: Create a new learning plan template
@@ -672,7 +672,7 @@ class manager {
$attachment->charset = $partdata->getCharset();
$attachment->description = $partdata->getDescription();
$attachment->contentid = $partdata->getContentId();
$attachment->filesize = $messagedata->getBodyPartSize($part);
$attachment->filesize = $partdata->getBytes();
if (!empty($CFG->antiviruses)) {
mtrace("--> Attempting virus scan of '{$attachment->filename}'");
+1 -1
View File
@@ -99,7 +99,7 @@ class api {
$lang = array();
if (!empty($addoninfo['lang'])) {
$stringmanager = get_string_manager();
$langs = $stringmanager->get_list_of_translations();
$langs = $stringmanager->get_list_of_translations(true);
foreach ($langs as $langid => $langname) {
foreach ($addoninfo['lang'] as $stringinfo) {
$lang[$langid][$stringinfo[0]] =
+1 -1
View File
@@ -30,7 +30,7 @@ require_once($CFG->libdir . '/externallib.php');
$serviceshortname = required_param('service', PARAM_ALPHANUMEXT);
$passport = required_param('passport', PARAM_RAW); // Passport send from the app to validate the response URL.
$urlscheme = optional_param('urlscheme', 'moodlemobile', PARAM_NOTAGS); // The URL scheme the app supports.
$urlscheme = optional_param('urlscheme', 'moodlemobile', PARAM_ALPHANUM); // The URL scheme the app supports.
$confirmed = optional_param('confirmed', false, PARAM_BOOL); // If we are being redirected after user confirmation.
$oauthsso = optional_param('oauthsso', 0, PARAM_INT); // Id of the OpenID issuer (for OAuth direct SSO).
+6
View File
@@ -66,6 +66,12 @@ function tool_mobile_create_app_download_url() {
}
$downloadurl = new moodle_url($mobilesettings->setuplink);
// Do not update the URL if it is a custom one (we may break it completely).
if ($mobilesettings->setuplink != 'https://download.moodle.org/mobile') {
return $downloadurl;
}
$downloadurl->param('version', $CFG->version);
$downloadurl->param('lang', current_language());
+1 -1
View File
@@ -63,7 +63,7 @@ if ($hassiteconfig) {
$temp->add(new admin_setting_configtext('tool_mobile/forcedurlscheme',
new lang_string('forcedurlscheme_key', 'tool_mobile'),
new lang_string('forcedurlscheme', 'tool_mobile'), '', PARAM_NOTAGS));
new lang_string('forcedurlscheme', 'tool_mobile'), '', PARAM_ALPHANUM));
$ADMIN->add('mobileapp', $temp);
+2 -1
View File
@@ -28,6 +28,7 @@ defined('MOODLE_INTERNAL') || die();
use \tool_monitor\privacy\provider;
use \core_privacy\local\request\approved_contextlist;
use \core_privacy\local\request\approved_userlist;
use \core_privacy\tests\provider_testcase;
/**
* Privacy test for the event monitor
@@ -37,7 +38,7 @@ use \core_privacy\local\request\approved_userlist;
* @copyright 2018 Adrian Greeve <adriangreeve.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class tool_monitor_privacy_testcase extends advanced_testcase {
class tool_monitor_privacy_testcase extends provider_testcase {
/**
* Set up method.
+6 -3
View File
@@ -123,9 +123,12 @@ class issuer extends persistent {
$mform->addElement('checkbox', 'showonloginpage', get_string('issuershowonloginpage', 'tool_oauth2'));
$mform->addHelpButton('showonloginpage', 'issuershowonloginpage', 'tool_oauth2');
// Require confirmation email for new accounts.
$mform->addElement('advcheckbox', 'requireconfirmation', get_string('issuerrequireconfirmation', 'tool_oauth2'));
$mform->addHelpButton('requireconfirmation', 'issuerrequireconfirmation', 'tool_oauth2');
$showrequireconfirm = $this->_customdata['showrequireconfirm'] ?? false;
if ($showrequireconfirm) {
// Require confirmation email for new accounts.
$mform->addElement('advcheckbox', 'requireconfirmation', get_string('issuerrequireconfirmation', 'tool_oauth2'));
$mform->addHelpButton('requireconfirmation', 'issuerrequireconfirmation', 'tool_oauth2');
}
$mform->addElement('hidden', 'sortorder');
$mform->setType('sortorder', PARAM_INT);
+33 -5
View File
@@ -58,7 +58,25 @@ if ($action == 'edit') {
$PAGE->navbar->add(get_string('createnewissuer', 'tool_oauth2'));
}
$mform = new \tool_oauth2\form\issuer(null, ['persistent' => $issuer]);
if (!empty($issuerid)) {
// Show the "Require confirmation email" checkbox for trusted issuers like Google, Facebook and Microsoft.
$likefacebook = $DB->sql_like('url', ':facebook');
$likegoogle = $DB->sql_like('url', ':google');
$likemicrosoft = $DB->sql_like('url', ':microsoft');
$params = [
'issuerid' => $issuerid,
'facebook' => '%facebook%',
'google' => '%google%',
'microsoft' => '%microsoft%',
];
$select = "issuerid = :issuerid AND ($likefacebook OR $likegoogle OR $likemicrosoft)";
// We're querying from the oauth2_endpoint table because the base URLs of FB and Microsoft can be empty in the issuer table.
$showrequireconfirm = $DB->record_exists_select('oauth2_endpoint', $select, $params);
} else {
$showrequireconfirm = optional_param('showrequireconfirm', false, PARAM_BOOL);
}
$mform = new \tool_oauth2\form\issuer(null, ['persistent' => $issuer, 'showrequireconfirm' => $showrequireconfirm]);
}
if ($mform && $mform->is_cancelled()) {
@@ -157,21 +175,31 @@ if ($mform && $mform->is_cancelled()) {
$issuers = core\oauth2\api::get_all_issuers();
echo $renderer->issuers_table($issuers);
// Google template.
$docs = 'admin/tool/oauth2/issuers/google';
$params = ['action' => 'edittemplate', 'type' => 'google', 'sesskey' => sesskey(), 'docslink' => $docs];
$params = ['action' => 'edittemplate', 'type' => 'google', 'sesskey' => sesskey(), 'docslink' => $docs,
'showrequireconfirm' => true];
$addurl = new moodle_url('/admin/tool/oauth2/issuers.php', $params);
echo $renderer->single_button($addurl, get_string('createnewgoogleissuer', 'tool_oauth2'));
// Microsoft template.
$docs = 'admin/tool/oauth2/issuers/microsoft';
$params = ['action' => 'edittemplate', 'type' => 'microsoft', 'sesskey' => sesskey(), 'docslink' => $docs];
$params = ['action' => 'edittemplate', 'type' => 'microsoft', 'sesskey' => sesskey(), 'docslink' => $docs,
'showrequireconfirm' => true];
$addurl = new moodle_url('/admin/tool/oauth2/issuers.php', $params);
echo $renderer->single_button($addurl, get_string('createnewmicrosoftissuer', 'tool_oauth2'));
// Facebook template.
$docs = 'admin/tool/oauth2/issuers/facebook';
$params = ['action' => 'edittemplate', 'type' => 'microsoft', 'sesskey' => sesskey(), 'docslink' => $docs];
$params = ['action' => 'edittemplate', 'type' => 'facebook', 'sesskey' => sesskey(), 'docslink' => $docs];
$params = ['action' => 'edittemplate', 'type' => 'facebook', 'sesskey' => sesskey(), 'docslink' => $docs,
'showrequireconfirm' => true];
$addurl = new moodle_url('/admin/tool/oauth2/issuers.php', $params);
echo $renderer->single_button($addurl, get_string('createnewfacebookissuer', 'tool_oauth2'));
// Generic issuer.
$addurl = new moodle_url('/admin/tool/oauth2/issuers.php', ['action' => 'edit']);
echo $renderer->single_button($addurl, get_string('createnewissuer', 'tool_oauth2'));
echo $OUTPUT->footer();
}
+1 -1
View File
@@ -1 +1 @@
define(["jquery","core/ajax","core/notification","core/modal_factory","core/modal_events"],function(a,b,c,d,e){var f={VIEW_POLICY:'[data-action="view"]'},g=function(){this.registerEvents()};return g.prototype.registerEvents=function(){a(f.VIEW_POLICY).click(function(f){f.preventDefault();var g=a(this).data("versionid"),h=a(this).data("behalfid"),i={versionid:g,behalfid:h},j={methodname:"tool_policy_get_policy_version",args:i},k=a.Deferred(),l=a.Deferred(),m=d.create({title:k,body:l,large:!0}).then(function(a){return a.getRoot().on(e.hidden,function(){a.destroy()}),a}).then(function(a){return a.show(),a})["catch"](c.exception),n=b.call([j]);a.when(n[0]).then(function(a){if(a.result.policy)return k.resolve(a.result.policy.name),l.resolve(a.result.policy.content),a;throw new Error(a.warnings[0].message)})["catch"](function(a){return m.then(function(a){return a.hide(),a.destroy(),a})["catch"](c.exception),c.addNotification({message:a,type:"error"})})})},{init:function(){return new g}}});
define(["jquery","core/ajax","core/notification","core/modal_factory","core/modal_events"],function(a,b,c,d,e){var f=function(a){this.registerEvents(a)};return f.prototype.registerEvents=function(f){f.on("click",function(f){f.preventDefault();var g=a(this).data("versionid"),h=a(this).data("behalfid"),i={versionid:g,behalfid:h},j={methodname:"tool_policy_get_policy_version",args:i},k=a.Deferred(),l=a.Deferred(),m=d.create({title:k,body:l,large:!0}).then(function(a){return a.getRoot().on(e.hidden,function(){a.destroy()}),a}).then(function(a){return a.show(),a})["catch"](c.exception),n=b.call([j]);a.when(n[0]).then(function(a){if(a.result.policy)return k.resolve(a.result.policy.name),l.resolve(a.result.policy.content),a;throw new Error(a.warnings[0].message)})["catch"](function(a){return m.then(function(a){return a.hide(),a.destroy(),a})["catch"](c.exception),c.addNotification({message:a,type:"error"})})})},{init:function(b){return b=a(b),new f(b)}}});
+7 -15
View File
@@ -29,27 +29,18 @@ define([
'core/modal_events'],
function($, Ajax, Notification, ModalFactory, ModalEvents) {
/**
* List of action selectors.
*
* @type {{VIEW_POLICY: string}}
*/
var ACTIONS = {
VIEW_POLICY: '[data-action="view"]'
};
/**
* PolicyActions class.
*/
var PolicyActions = function() {
this.registerEvents();
var PolicyActions = function(root) {
this.registerEvents(root);
};
/**
* Register event listeners.
*/
PolicyActions.prototype.registerEvents = function() {
$(ACTIONS.VIEW_POLICY).click(function(e) {
PolicyActions.prototype.registerEvents = function(root) {
root.on("click", function(e) {
e.preventDefault();
var versionid = $(this).data('versionid');
@@ -127,8 +118,9 @@ function($, Ajax, Notification, ModalFactory, ModalEvents) {
* @method init
* @return {PolicyActions}
*/
'init': function() {
return new PolicyActions();
'init': function(root) {
root = $(root);
return new PolicyActions(root);
}
};
});
@@ -97,7 +97,7 @@ class accept_policy extends \moodleform {
}
}
$PAGE->requires->js_call_amd('tool_policy/policyactions', 'init');
$PAGE->requires->js_call_amd('tool_policy/policyactions', 'init', ['[data-action="view"]']);
}
/**
@@ -178,4 +178,4 @@ class accept_policy extends \moodleform {
}
}
}
}
}
@@ -232,6 +232,10 @@ class page_agreedocs implements renderable, templatable {
];
redirect(new moodle_url('/admin/tool/policy/view.php', $urlparams));
}
} else {
// Update the policyagreed for the user to avoid infinite loop because there are no policies to-be-accepted.
api::update_policyagreed($userid);
$this->redirect_to_previous_url();
}
}
@@ -58,7 +58,7 @@ require(['jquery', 'tool_policy/jquery-eu-cookie-law-popup', 'tool_policy/policy
"<ul>{{#policies}}" +
"<li>" +
"<a href=\"{{pluginbaseurl}}/view.php?versionid={{id}}{{#returnurl}}&amp;returnurl={{.}}{{/returnurl}}\" " +
" data-action=\"view\" data-versionid=\"{{id}}\" data-behalfid=\"1\" >" +
" data-action=\"view-guest\" data-versionid=\"{{id}}\" data-behalfid=\"1\" >" +
"{{{name}}}" +
"</a>" +
"</li>" +
@@ -81,7 +81,7 @@ require(['jquery', 'tool_policy/jquery-eu-cookie-law-popup', 'tool_policy/policy
{{/haspolicies}}
// Initialise the JS for the modal window which displays the policy versions.
ActionsMod.init();
ActionsMod.init('[data-action="view-guest"]');
});
});
@@ -123,6 +123,6 @@
{{#js}}
// Initialise the JS for the modal window which displays the policy versions.
require(['tool_policy/policyactions'], function(ActionsMod) {
ActionsMod.init();
ActionsMod.init('[data-action="view"]');
});
{{/js}}
@@ -73,6 +73,6 @@
{{#js}}
// Initialise the JS for the modal window which displays the policy versions.
require(['tool_policy/policyactions'], function(ActionsMod) {
ActionsMod.init();
ActionsMod.init('[data-action="view"]');
});
{{/js}}
@@ -80,7 +80,7 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
And I press "Next"
And I set the field "I agree to the This site policy" to "1"
And I press "Next"
And I should not see "Next"
And I should see "Course overview"
And I navigate to "Users > Privacy and policies > Manage policies" in site administration
And I click on "1 of 4 (25%)" "link" in the "This site policy" "table_row"
And I click on "Consent not given" "link" in the "User One" "table_row"
@@ -292,3 +292,23 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
And I should see "2 of 2" in the "User One" "table_row"
And "Consent given on behalf of user" "icon" should exist in the "User Two" "table_row"
And I should see "2 of 2" in the "User Two" "table_row"
Scenario: View acceptances made by users on their own after inactivating a policy
Given I log in as "user1"
And I should see "This site policy"
And I should not see "Course overview"
And I press "Next"
And I set the field "I agree to the This site policy" to "1"
And I press "Next"
And I should see "Course overview"
And I log out
And I log in as "admin"
And I navigate to "Users > Privacy and policies > Manage policies" in site administration
And I click on "Actions" "link_or_button" in the "This privacy policy" "table_row"
And I click on "Set status to \"Active\"" "link" in the "This privacy policy" "table_row"
And I press "Continue"
And I click on "Set status to \"Inactive\"" "link" in the "This privacy policy" "table_row"
And I press "Continue"
And I log out
When I log in as "user1"
Then I should see "Course overview"
+16 -2
View File
@@ -108,6 +108,16 @@ class category_bin extends base_bin {
require_once($CFG->dirroot . '/backup/util/includes/backup_includes.php');
// As far as recycle bin is using MODE_AUTOMATED, it observes the backup_auto_storage
// setting (storing backups @ real location. For recycle bin we want to ensure that
// backup files are always stored in Moodle file area. In order to achieve that, we
// hack the setting here via $CFG->forced_plugin_settings, so it won't interfere other
// operations. See MDL-65218 for more information.
// This hack will be removed once recycle bin switches to use its own backup mode, with
// own preferences and 100% appart from MODLE_AUTOMATED.
// TODO: Remove this as part of MDL-65228.
$CFG->forced_plugin_settings['backup'] = ['backup_auto_storage' => 0];
// Backup the course.
$user = get_admin();
$controller = new \backup_controller(
@@ -115,11 +125,15 @@ class category_bin extends base_bin {
$course->id,
\backup::FORMAT_MOODLE,
\backup::INTERACTIVE_NO,
\backup::MODE_GENERAL,
\backup::MODE_AUTOMATED,
$user->id
);
$controller->execute_plan();
// We don't need the forced setting anymore, hence unsetting it.
// TODO: Remove this as part of MDL-65228.
unset($CFG->forced_plugin_settings['backup']);
// Grab the result.
$result = $controller->get_results();
if (!isset($result['backup_destination'])) {
@@ -233,7 +247,7 @@ class category_bin extends base_bin {
$tempdir,
$course->id,
\backup::INTERACTIVE_NO,
\backup::MODE_GENERAL,
\backup::MODE_AUTOMATED,
$user->id,
\backup::TARGET_NEW_COURSE
);
+16 -2
View File
@@ -112,6 +112,16 @@ class course_bin extends base_bin {
return;
}
// As far as recycle bin is using MODE_AUTOMATED, it observes the backup_auto_storage
// setting (storing backups @ real location. For recycle bin we want to ensure that
// backup files are always stored in Moodle file area. In order to achieve that, we
// hack the setting here via $CFG->forced_plugin_settings, so it won't interfere other
// operations. See MDL-65218 for more information.
// This hack will be removed once recycle bin switches to use its own backup mode, with
// own preferences and 100% appart from MODLE_AUTOMATED.
// TODO: Remove this as part of MDL-65228.
$CFG->forced_plugin_settings['backup'] = ['backup_auto_storage' => 0];
// Backup the activity.
$user = get_admin();
$controller = new \backup_controller(
@@ -119,11 +129,15 @@ class course_bin extends base_bin {
$cm->id,
\backup::FORMAT_MOODLE,
\backup::INTERACTIVE_NO,
\backup::MODE_GENERAL,
\backup::MODE_AUTOMATED,
$user->id
);
$controller->execute_plan();
// We don't need the forced setting anymore, hence unsetting it.
// TODO: Remove this as part of MDL-65228.
unset($CFG->forced_plugin_settings['backup']);
// Grab the result.
$result = $controller->get_results();
if (!isset($result['backup_destination'])) {
@@ -224,7 +238,7 @@ class course_bin extends base_bin {
$tempdir,
$this->_courseid,
\backup::INTERACTIVE_NO,
\backup::MODE_GENERAL,
\backup::MODE_AUTOMATED,
$user->id,
\backup::TARGET_EXISTING_ADDING
);
@@ -176,4 +176,116 @@ class tool_recyclebin_category_bin_tests extends advanced_testcase {
$course = reset($courses);
$this->assertEquals('Test course 2', $course->fullname);
}
/**
* Provider for test_course_restore_with_userdata() and test_course_restore_without_userdata()
*
* Used to verify that recycle bin is immune to various settings. Provides plugin, name, value for
* direct usage with set_config()
*/
public function recycle_bin_settings_provider() {
return [
'backup/backup_auto_storage moodle' => [[
(object)['plugin' => 'backup', 'name' => 'backup_auto_storage', 'value' => 0],
]],
'backup/backup_auto_storage external' => [[
(object)['plugin' => 'backup', 'name' => 'backup_auto_storage', 'value' => 1],
(object)['plugin' => 'backup', 'name' => 'backup_auto_destination', 'value' => true],
]],
'backup/backup_auto_storage mixed' => [[
(object)['plugin' => 'backup', 'name' => 'backup_auto_storage', 'value' => 2],
(object)['plugin' => 'backup', 'name' => 'backup_auto_destination', 'value' => true],
]],
];
}
/**
* Tests that user data is restored when course is restored.
*
* @dataProvider recycle_bin_settings_provider
* @param array $settings array of plugin, name, value stdClass().
*/
public function test_course_restore_with_userdata($settings) {
global $DB;
// Force configuration changes from provider.
foreach ($settings as $setting) {
// Need to create a directory for backup_auto_destination.
if ($setting->plugin === 'backup' && $setting->name === 'backup_auto_destination' && $setting->value === true) {
$setting->value = make_request_directory();
}
set_config($setting->name, $setting->value, $setting->plugin);
}
// We want user data to be included for this test.
set_config('backup_auto_users', true, 'backup');
$student = $this->getDataGenerator()->create_and_enrol($this->course, 'student');
// Delete course.
delete_course($this->course, false);
$this->assertFalse($DB->record_exists('course', ['id' => $this->course->id]));
// Verify there is now a backup @ cat recycle bin file area.
$recyclebin = new \tool_recyclebin\category_bin($this->course->category);
$this->assertEquals(1, count($recyclebin->get_items()));
// Restore the recycle bin item.
$recyclebin->restore_item(current($recyclebin->get_items()));
// Get the new course.
$newcourse = $DB->get_record('course', ['shortname' => $this->course->shortname], '*', MUST_EXIST);
// Check that it was removed from the recycle bin.
$this->assertEquals(0, count($recyclebin->get_items()));
// Verify that student DOES continue enrolled.
$this->assertTrue(is_enrolled(context_course::instance($newcourse->id), $student->id));
}
/**
* Tests that user data is not restored when course is restored.
*
* @dataProvider recycle_bin_settings_provider
* @param array $settings array of plugin, name, value stdClass().
*/
public function test_course_restore_without_userdata($settings) {
global $DB;
// Force configuration changes from provider.
foreach ($settings as $setting) {
// Need to create a directory for backup_auto_destination.
if ($setting->plugin === 'backup' && $setting->name === 'backup_auto_destination' && $setting->value === true) {
$setting->value = make_request_directory();
}
set_config($setting->name, $setting->value, $setting->plugin);
}
// We want user data to be included for this test.
set_config('backup_auto_users', false, 'backup');
$student = $this->getDataGenerator()->create_and_enrol($this->course, 'student');
// Delete course.
delete_course($this->course, false);
$this->assertFalse($DB->record_exists('course', ['id' => $this->course->id]));
// Verify there is now a backup @ cat recycle bin file area.
$recyclebin = new \tool_recyclebin\category_bin($this->course->category);
$this->assertEquals(1, count($recyclebin->get_items()));
// Restore the recycle bin item.
$recyclebin->restore_item(current($recyclebin->get_items()));
// Get the new course.
$newcourse = $DB->get_record('course', ['shortname' => $this->course->shortname], '*', MUST_EXIST);
// Check that it was removed from the recycle bin.
$this->assertEquals(0, count($recyclebin->get_items()));
// Verify that student DOES NOT continue enrolled.
$this->assertFalse(is_enrolled(context_course::instance($newcourse->id), $student->id));
}
}
+144 -1
View File
@@ -55,7 +55,7 @@ class tool_recyclebin_course_bin_tests extends advanced_testcase {
$this->course = $this->getDataGenerator()->create_course();
$this->quiz = $this->getDataGenerator()->get_plugin_generator('mod_quiz')->create_instance(array(
'course' => $this->course->id
'course' => $this->course->id, 'grade' => 100.0, 'sumgrades' => 1
));
}
@@ -173,4 +173,147 @@ class tool_recyclebin_course_bin_tests extends advanced_testcase {
$deletedbook = reset($items);
$this->assertEquals($book->name, $deletedbook->name);
}
/**
* Provider for test_coursemodule_restore_with_userdata() and test_coursemodule_restore_without_userdata()
*
* Used to verify that recycle bin is immune to various settings. Provides plugin, name, value for
* direct usage with set_config()
*/
public function recycle_bin_settings_provider() {
return [
'backup/backup_auto_storage moodle' => [[
(object)['plugin' => 'backup', 'name' => 'backup_auto_storage', 'value' => 0],
]],
'backup/backup_auto_storage external' => [[
(object)['plugin' => 'backup', 'name' => 'backup_auto_storage', 'value' => 1],
(object)['plugin' => 'backup', 'name' => 'backup_auto_destination', 'value' => true],
]],
'backup/backup_auto_storage mixed' => [[
(object)['plugin' => 'backup', 'name' => 'backup_auto_storage', 'value' => 2],
(object)['plugin' => 'backup', 'name' => 'backup_auto_destination', 'value' => true],
]],
];
}
/**
* Tests that user data is restored when module is restored.
*
* @dataProvider recycle_bin_settings_provider
* @param array $settings array of plugin, name, value stdClass().
*/
public function test_coursemodule_restore_with_userdata($settings) {
// Force configuration changes from provider.
foreach ($settings as $setting) {
// Need to create a directory for backup_auto_destination.
if ($setting->plugin === 'backup' && $setting->name === 'backup_auto_destination' && $setting->value === true) {
$setting->value = make_request_directory();
}
set_config($setting->name, $setting->value, $setting->plugin);
}
$student = $this->getDataGenerator()->create_and_enrol($this->course, 'student');
$this->setUser($student);
set_config('backup_auto_users', true, 'backup');
$this->create_quiz_attempt($this->quiz, $student);
// Delete quiz.
$cm = get_coursemodule_from_instance('quiz', $this->quiz->id);
course_delete_module($cm->id);
phpunit_util::run_all_adhoc_tasks();
$quizzes = get_coursemodules_in_course('quiz', $this->course->id);
$this->assertEquals(0, count($quizzes));
// Restore quiz.
$recyclebin = new \tool_recyclebin\course_bin($this->course->id);
foreach ($recyclebin->get_items() as $item) {
$recyclebin->restore_item($item);
}
$quizzes = get_coursemodules_in_course('quiz', $this->course->id);
$this->assertEquals(1, count($quizzes));
$cm = array_pop($quizzes);
// Check if user quiz attempt data is restored.
$attempts = quiz_get_user_attempts($cm->instance, $student->id);
$this->assertEquals(1, count($attempts));
$attempt = array_pop($attempts);
$attemptobj = quiz_attempt::create($attempt->id);
$this->assertEquals($student->id, $attemptobj->get_userid());
$this->assertEquals(true, $attemptobj->is_finished());
}
/**
* Tests that user data is not restored when module is restored.
*
* @dataProvider recycle_bin_settings_provider
* @param array $settings array of plugin, name, value stdClass().
*/
public function test_coursemodule_restore_without_userdata($settings) {
// Force configuration changes from provider.
foreach ($settings as $setting) {
// Need to create a directory for backup_auto_destination.
if ($setting->plugin === 'backup' && $setting->name === 'backup_auto_destination' && $setting->value === true) {
$setting->value = make_request_directory();
}
set_config($setting->name, $setting->value, $setting->plugin);
}
$student = $this->getDataGenerator()->create_and_enrol($this->course, 'student');
$this->setUser($student);
set_config('backup_auto_users', false, 'backup');
$this->create_quiz_attempt($this->quiz, $student);
// Delete quiz.
$cm = get_coursemodule_from_instance('quiz', $this->quiz->id);
course_delete_module($cm->id);
phpunit_util::run_all_adhoc_tasks();
$quizzes = get_coursemodules_in_course('quiz', $this->course->id);
$this->assertEquals(0, count($quizzes));
// Restore quiz.
$recyclebin = new \tool_recyclebin\course_bin($this->course->id);
foreach ($recyclebin->get_items() as $item) {
$recyclebin->restore_item($item);
}
$quizzes = get_coursemodules_in_course('quiz', $this->course->id);
$this->assertEquals(1, count($quizzes));
$cm = array_pop($quizzes);
// Check if user quiz attempt data is restored.
$attempts = quiz_get_user_attempts($cm->instance, $student->id);
$this->assertEquals(0, count($attempts));
}
/**
* Add a question to quiz and create a quiz attempt.
* @param \stdClass $quiz Quiz
* @param \stdClass $student User
* @throws coding_exception
* @throws moodle_exception
*/
private function create_quiz_attempt($quiz, $student) {
// Add Question.
$questiongenerator = $this->getDataGenerator()->get_plugin_generator('core_question');
$cat = $questiongenerator->create_question_category();
$numq = $questiongenerator->create_question('numerical', null, array('category' => $cat->id));
quiz_add_quiz_question($numq->id, $quiz);
// Create quiz attempt.
$quizobj = quiz::create($quiz->id, $student->id);
$quba = question_engine::make_questions_usage_by_activity('mod_quiz', $quizobj->get_context());
$quba->set_preferred_behaviour($quizobj->get_quiz()->preferredbehaviour);
$timenow = time();
$attempt = quiz_create_attempt($quizobj, 1, false, $timenow, false, $student->id);
quiz_start_new_attempt($quizobj, $quba, $attempt, 1, $timenow);
quiz_attempt_save_started($quizobj, $quba, $attempt);
$attemptobj = quiz_attempt::create($attempt->id);
$tosubmit = array(1 => array('answer' => '0'));
$attemptobj->process_submitted_actions($timenow, false, $tosubmit);
$attemptobj = quiz_attempt::create($attempt->id);
$attemptobj->process_finish($timenow, false);
}
}
+1
View File
@@ -183,6 +183,7 @@ function uu_validate_user_upload_columns(csv_import_reader $cir, $stdfields, $pr
$processed = array();
foreach ($columns as $key=>$unused) {
$field = $columns[$key];
$field = trim($field);
$lcfield = core_text::strtolower($field);
if (in_array($field, $stdfields) or in_array($lcfield, $stdfields)) {
// standard fields are only lowercase
@@ -38,9 +38,6 @@ class load_xml_file extends XMLDBAction {
$this->can_subaction = ACTION_NONE;
//$this->can_subaction = ACTION_HAVE_SUBACTIONS;
// Set own custom attributes
$this->sesskey_protected = false; // This action doesn't need sesskey protection
// Get needed strings
$this->loadStrings(array(
// 'key' => 'module',
@@ -169,7 +169,7 @@ class main_view extends XMLDBAction {
file_exists($key . '/install.xml') &&
is_readable($key . '/install.xml') &&
empty($dbdir->xml_loaded)) {
$b .= '<a href="index.php?action=load_xml_file&amp;dir=' . urlencode(str_replace($CFG->dirroot, '', $key)) . '&amp;time=' . time() . '&amp;postaction=main_view#lastused">[' . $this->str['load'] . ']</a>';
$b .= '<a href="index.php?action=load_xml_file&amp;sesskey=' . sesskey() . '&amp;dir=' . urlencode(str_replace($CFG->dirroot, '', $key)) . '&amp;time=' . time() . '&amp;postaction=main_view#lastused">[' . $this->str['load'] . ']</a>';
} else {
$b .= '[' . $this->str['load'] . ']';
}
@@ -239,7 +239,7 @@ class main_view extends XMLDBAction {
is_readable($key . '/install.xml') &&
!empty($dbdir->xml_loaded) &&
empty($dbdir->xml_changed)) {
$b .= '<a href="index.php?action=unload_xml_file&amp;dir=' . urlencode(str_replace($CFG->dirroot, '', $key)) . '&amp;time=' . time() . '&amp;postaction=main_view#lastused">[' . $this->str['unload'] . ']</a>';
$b .= '<a href="index.php?action=unload_xml_file&amp;sesskey=' . sesskey() . '&amp;dir=' . urlencode(str_replace($CFG->dirroot, '', $key)) . '&amp;time=' . time() . '&amp;postaction=main_view#lastused">[' . $this->str['unload'] . ']</a>';
} else {
$b .= '[' . $this->str['unload'] . ']';
}
@@ -35,9 +35,6 @@ class unload_xml_file extends XMLDBAction {
function init() {
parent::init();
// Set own custom attributes
$this->sesskey_protected = false; // This action doesn't need sesskey protection
// Get needed strings
$this->loadStrings(array(
// 'key' => 'module',
+34 -19
View File
@@ -577,9 +577,14 @@ abstract class base {
return $result;
}
// Remove samples the target consider invalid.
$this->analysabletarget->add_sample_data($samplesdata);
$this->analysabletarget->filter_out_invalid_samples($sampleids, $analysable, $includetarget);
try {
// Remove samples the target consider invalid.
$this->analysabletarget->add_sample_data($samplesdata);
$this->analysabletarget->filter_out_invalid_samples($sampleids, $analysable, $includetarget);
} catch (\Throwable $e) {
$dataset->close_process();
throw $e;
}
if (!$sampleids) {
$result->status = \core_analytics\model::NO_DATASET;
@@ -588,19 +593,24 @@ abstract class base {
return $result;
}
foreach ($this->indicators as $key => $indicator) {
// The analyser attaches the main entities the sample depends on and are provided to the
// indicator to calculate the sample.
$this->indicators[$key]->add_sample_data($samplesdata);
}
try {
foreach ($this->indicators as $key => $indicator) {
// The analyser attaches the main entities the sample depends on and are provided to the
// indicator to calculate the sample.
$this->indicators[$key]->add_sample_data($samplesdata);
}
// Here we start the memory intensive process that will last until $data var is
// unset (until the method is finished basically).
if ($includetarget) {
$data = $timesplitting->calculate($sampleids, $this->get_samples_origin(), $this->indicators, $ranges,
$this->analysabletarget);
} else {
$data = $timesplitting->calculate($sampleids, $this->get_samples_origin(), $this->indicators, $ranges);
// Here we start the memory intensive process that will last until $data var is
// unset (until the method is finished basically).
if ($includetarget) {
$data = $timesplitting->calculate($sampleids, $this->get_samples_origin(), $this->indicators, $ranges,
$this->analysabletarget);
} else {
$data = $timesplitting->calculate($sampleids, $this->get_samples_origin(), $this->indicators, $ranges);
}
} catch (\Throwable $e) {
$dataset->close_process();
throw $e;
}
if (!$data) {
@@ -610,11 +620,16 @@ abstract class base {
return $result;
}
// Add extra metadata.
$this->add_model_metadata($data);
try {
// Add extra metadata.
$this->add_model_metadata($data);
// Write all calculated data to a file.
$file = $dataset->store($data);
// Write all calculated data to a file.
$file = $dataset->store($data);
} catch (\Throwable $e) {
$dataset->close_process();
throw $e;
}
// Flag the model + analysable + timesplitting as analysed.
$dataset->close_process();
+1 -1
View File
@@ -196,7 +196,7 @@ abstract class base extends \core_analytics\calculable {
$message->component = 'moodle';
$message->name = 'insights';
$message->userfrom = get_admin();
$message->userfrom = \core_user::get_noreply_user();
$message->userto = $user;
$insighturl = new \moodle_url('/report/insights/insights.php?modelid=' . $modelid . '&contextid=' . $context->id);
+4 -1
View File
@@ -1480,7 +1480,10 @@ class model {
// 1 db read per context.
$this->purge_insights_cache();
$this->model->trained = 0;
if (!$this->is_static()) {
$this->model->trained = 0;
}
$this->model->timemodified = time();
$this->model->usermodified = $USER->id;
$DB->update_record('analytics_models', $this->model);
+24
View File
@@ -168,10 +168,34 @@ class analytics_model_testcase extends advanced_testcase {
$this->assertEmpty($DB->count_records('analytics_predict_samples'));
$this->assertEmpty($DB->count_records('analytics_used_files'));
// Check that the model is marked as not trained after clearing (as it is not a static one).
$this->assertEquals(0, $DB->get_field('analytics_models', 'trained', array('id' => $this->modelobj->id)));
set_config('enabled_stores', '', 'tool_log');
get_log_manager(true);
}
/**
* Test behaviour of {\core_analytics\model::clear()} for static models.
*/
public function test_clear_static() {
global $DB;
$this->resetAfterTest();
$statictarget = new test_static_target_shortname();
$indicators['test_indicator_max'] = \core_analytics\manager::get_indicator('test_indicator_max');
$model = \core_analytics\model::create($statictarget, $indicators, '\core\analytics\time_splitting\quarters');
$modelobj = $model->get_model_obj();
// Static models are always considered trained.
$this->assertEquals(1, $DB->get_field('analytics_models', 'trained', array('id' => $modelobj->id)));
$model->clear();
// Check that the model is still marked as trained even after clearing.
$this->assertEquals(1, $DB->get_field('analytics_models', 'trained', array('id' => $modelobj->id)));
}
public function test_model_manager() {
$this->resetAfterTest(true);
+7
View File
@@ -99,6 +99,13 @@ class auth_db_testcase extends advanced_testcase {
case 'mssql':
set_config('type', 'mssqlnative', 'auth_db');
set_config('sybasequoting', '1', 'auth_db');
// The native sqlsrv driver uses a comma as separator between host and port.
$dbhost = $CFG->dbhost;
if (!empty($dboptions['dbport'])) {
$dbhost .= ',' . $dboptions['dbport'];
}
set_config('host', $dbhost, 'auth_db');
break;
default:
+33
View File
@@ -63,3 +63,36 @@ Feature: User must accept policy when logging in and signing up
And I log in as "user1"
And I open my profile in edit mode
And the field "First name" matches value "User1"
Scenario Outline: Email validation during email registration
Given the following config values are set as admin:
| allowaccountssameemail | <allowsameemail> |
| registerauth | email |
| passwordpolicy | 0 |
And the following "users" exist:
| username | firstname | lastname | email |
| s1 | John | Doe | s1@example.com |
And I am on site homepage
And I follow "Log in"
When I press "Create new account"
And I set the following fields to these values:
| Username | s2 |
| Password | test |
| Email address | <email1> |
| Email (again) | <email2> |
| First name | Jane |
| Surname | Doe |
And I press "Create my new account"
Then I should <expect> "This email address is already registered. Perhaps you created an account in the past?"
And I should <expect2> "Invalid email address"
Examples:
| allowsameemail | email1 | email2 | expect | expect2 |
| 0 | s1@example.com | s1@example.com | see | not see |
| 0 | S1@EXAMPLE.COM | S1@EXAMPLE.COM | see | not see |
| 0 | s1@example.com | S1@EXAMPLE.COM | see | not see |
| 0 | s2@example.com | s1@example.com | not see | see |
| 1 | s1@example.com | s1@example.com | not see | not see |
| 1 | S1@EXAMPLE.COM | S1@EXAMPLE.COM | not see | not see |
| 1 | s1@example.com | S1@EXAMPLE.COM | not see | not see |
| 1 | s1@example.com | s2@example.com | not see | see |
+1 -5
View File
@@ -36,11 +36,7 @@ $string['auth_ldap_contexts_key'] = 'Contexts';
$string['auth_ldap_create_context'] = 'If you enable user creation with email confirmation, specify the context where users are created. This context should be different from other users to prevent security issues. You don\'t need to add this context to ldap_context-variable, Moodle will search for users from this context automatically.<br /><b>Note!</b> You have to modify the method user_create() in file auth/ldap/auth.php to make user creation work';
$string['auth_ldap_create_context_key'] = 'Context for new users';
$string['auth_ldap_create_error'] = 'Error creating user in LDAP.';
$string['auth_ldapdescription'] = 'This method provides authentication against an external LDAP server.
If the given username and password are valid, Moodle creates a new user
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_ldapdescription'] = 'This method provides authentication against an external LDAP server. If the given username and password are valid, Moodle creates a new user entry in its database. This plugin 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 \'{$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.';
+34
View File
@@ -47,5 +47,39 @@ function xmldb_auth_oauth2_upgrade($oldversion) {
// Automatically generated Moodle v3.5.0 release upgrade line.
// Put any upgrade step following this.
if ($oldversion < 2018051401) {
// Fetch Facebook, Google, and Microsoft issuers. We use the URL field to determine the issuer type as it's the only
// field that contains the keyword that can somewhat let us reliably determine the issuer type.
$likefacebook = $DB->sql_like('oe.url', ':facebook');
$likegoogle = $DB->sql_like('oe.url', ':google');
$likemicrosoft = $DB->sql_like('oe.url', ':microsoft');
$params = [
'facebook' => '%facebook%',
'google' => '%google%',
'microsoft' => '%microsoft%',
];
// We're querying from the oauth2_endpoint table because the base URLs of FB and Microsoft can be empty in the issuer table.
$subsql = "
SELECT DISTINCT oe.issuerid
FROM {oauth2_endpoint} oe
WHERE $likefacebook
OR $likegoogle
OR $likemicrosoft";
// Update non-Facebook/Google/Microsoft issuers and set requireconfirmation to 1.
$updatesql = "
UPDATE {oauth2_issuer}
SET requireconfirmation = 1
WHERE id NOT IN ({$subsql})";
$DB->execute($updatesql, $params);
// Delete linked logins for non-Facebook/Google/Microsoft issuers. They can easily re-link their logins anyway.
$DB->delete_records_select('auth_oauth2_linked_login', "issuerid NOT IN ($subsql)", $params);
upgrade_plugin_savepoint(true, 2018051401, 'auth', 'oauth2');
}
return true;
}
+8 -2
View File
@@ -40,7 +40,10 @@ then cut and paste the address into the address
line at the top of your web browser window.
If you need help, please contact the site administrator,
{$a->admin}';
{$a->admin}
If you did not do this, someone else could be trying to compromise your account.
Please contact the site administrator immediately.';
$string['confirmaccountemailsubject'] = '{$a}: account confirmation';
$string['confirmationinvalid'] = 'The confirmation link is either invalid, or has expired. Please start the login process again to generate a new confirmation email.';
$string['confirmationpending'] = 'This account is pending email confirmation.';
@@ -60,7 +63,10 @@ then cut and paste the address into the address
line at the top of your web browser window.
If you need help, please contact the site administrator,
{$a->admin}';
{$a->admin}
If you did not do this, someone else could be trying to compromise your account.
Please contact the site administrator immediately.';
$string['confirmlinkedloginemailsubject'] = '{$a}: linked login confirmation';
$string['createaccountswarning'] = 'This authentication plugin allows users to create accounts on your site. You may want to enable the setting "authpreventaccountcreation" if you use this plugin.';
$string['createnewlinkedlogin'] = 'Link a new account ({$a})';
+1 -1
View File
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2018051400; // The current plugin version (Date: YYYYMMDDXX).
$plugin->version = 2018051401; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2018050800; // Requires this Moodle version.
$plugin->component = 'auth_oauth2'; // Full name of the plugin (used for diagnostics).
+10 -2
View File
@@ -42,10 +42,18 @@ class behat_auth extends behat_base {
* Logs in the user. There should exist a user with the same value as username and password.
*
* @Given /^I log in as "(?P<username_string>(?:[^"]|\\")*)"$/
* @param string $username the user to log in as.
* @param moodle_url|null $wantsurl optional, URL to go to after logging in.
*/
public function i_log_in_as($username) {
public function i_log_in_as(string $username, moodle_url $wantsurl = null) {
$loginurl = new moodle_url('/login/index.php');
if ($wantsurl !== null) {
$loginurl->param('wantsurl', $wantsurl->out_as_local_url());
}
// Visit login page.
$this->getSession()->visit($this->locate_path('login/index.php'));
$this->getSession()->visit($this->locate_path($loginurl->out_as_local_url()));
// Enter username and password.
$this->execute('behat_forms::i_set_the_field_to', array('Username', $this->escape($username)));
@@ -92,3 +92,25 @@ Feature: availability_grouping
# P1 should show but not B2.
Then I should see "P1" in the "region-main" "region"
And I should not see "P2" in the "region-main" "region"
@javascript
Scenario: Check grouping access restriction message on course homepage
Given the following "groupings" exist:
| name | course | idnumber |
| Grouping A | C1 | GA |
And the following "grouping groups" exist:
| grouping | group |
| GA | GI1 |
And the following "activities" exist:
| activity | name | intro | course | idnumber | groupmode | grouping |
| assign | Test assign | Assign description | C1 | assign1 | 1 | GA |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I turn editing mode on
And I open "Test assign" actions menu
And I choose "Edit settings" in the open action menu
And I expand all fieldsets
And the field "groupingid" matches value "Grouping A"
And I press "Add group/grouping access restriction"
When I press "Save and return to course"
Then I should see "Not available unless: You belong to a group in Grouping A"
@@ -311,11 +311,11 @@ class backup_controller extends base_controller {
// Basic/initial prevention against time/memory limits
core_php_time_limit::raise(1 * 60 * 60); // 1 hour for 1 course initially granted
raise_memory_limit(MEMORY_EXTRA);
// If this is not a course backup, inform the plan we are not
// If this is not a course backup, or single activity backup (e.g. duplicate) inform the plan we are not
// including all the activities for sure. This will affect any
// task/step executed conditionally to stop including information
// for section and activity backup. MDL-28180.
if ($this->get_type() !== backup::TYPE_1COURSE) {
if ($this->get_type() !== backup::TYPE_1COURSE && $this->get_type() !== backup::TYPE_1ACTIVITY) {
$this->log('notifying plan about excluded activities by type', backup::LOG_DEBUG);
$this->plan->set_excluding_activities();
}
@@ -326,11 +326,11 @@ class restore_controller extends base_controller {
// Basic/initial prevention against time/memory limits
core_php_time_limit::raise(1 * 60 * 60); // 1 hour for 1 course initially granted
raise_memory_limit(MEMORY_EXTRA);
// If this is not a course restore, inform the plan we are not
// If this is not a course restore or single activity restore (e.g. duplicate), inform the plan we are not
// including all the activities for sure. This will affect any
// task/step executed conditionally to stop processing information
// for section and activity restore. MDL-28180.
if ($this->get_type() !== backup::TYPE_1COURSE) {
if ($this->get_type() !== backup::TYPE_1COURSE && $this->get_type() !== backup::TYPE_1ACTIVITY) {
$this->log('notifying plan about excluded activities by type', backup::LOG_DEBUG);
$this->plan->set_excluding_activities();
}
+5 -1
View File
@@ -2270,7 +2270,11 @@ class backup_questions_structure_step extends backup_structure_step {
FROM {tag} t
JOIN {tag_instance} ti ON ti.tagid = t.id
WHERE ti.itemid = ?
AND ti.itemtype = 'question'", array(backup::VAR_PARENTID));
AND ti.itemtype = 'question'
AND ti.component = 'core_question'",
[
backup::VAR_PARENTID
]);
// don't need to annotate ids nor files
// (already done by {@link backup_annotate_all_question_files}
@@ -580,6 +580,17 @@ abstract class backup_controller_dbops extends backup_dbops {
'backup_import_competencies' => 'competencies'
);
self::apply_admin_config_defaults($controller, $settings, true);
if ((!$controller->get_interactive()) &&
$controller->get_type() == backup::TYPE_1ACTIVITY) {
// This is duplicate - there is no concept of defaults - these settings must be on.
$settings = array(
'activities',
'blocks',
'filters',
'questionbank'
);
self::force_enable_settings($controller, $settings);
}
break;
case backup::MODE_AUTOMATED:
// Load the automated defaults.
@@ -607,6 +618,30 @@ abstract class backup_controller_dbops extends backup_dbops {
}
}
/**
* Turn these settings on. No defaults from admin settings.
*
* @param backup_controller $controller
* @param array $settings a map from admin config names to setting names (Config name => Setting name)
*/
private static function force_enable_settings(backup_controller $controller, array $settings) {
$plan = $controller->get_plan();
foreach ($settings as $config => $settingname) {
$value = true;
if ($plan->setting_exists($settingname)) {
$setting = $plan->get_setting($settingname);
// We do not allow this setting to be locked for a duplicate function.
if ($setting->get_status() !== base_setting::NOT_LOCKED) {
$setting->set_status(base_setting::NOT_LOCKED);
}
$setting->set_value($value);
$setting->set_status(base_setting::LOCKED_BY_CONFIG);
} else {
$controller->log('Unknown setting: ' . $setting, BACKUP::LOG_DEBUG);
}
}
}
/**
* Sets the controller settings default values from the admin config.
*
@@ -183,6 +183,18 @@ abstract class restore_controller_dbops extends restore_dbops {
);
self::apply_admin_config_defaults($controller, $settings, true);
}
if ($controller->get_mode() == backup::MODE_IMPORT &&
(!$controller->get_interactive()) &&
$controller->get_type() == backup::TYPE_1ACTIVITY) {
// This is duplicate - there is no concept of defaults - these settings must be on.
$settings = array(
'activities',
'blocks',
'filters',
'questionbank'
);
self::force_enable_settings($controller, $settings);
};
// Add some dependencies.
$plan = $controller->get_plan();
@@ -233,6 +245,30 @@ abstract class restore_controller_dbops extends restore_dbops {
return $value;
}
/**
* Turn these settings on. No defaults from admin settings.
*
* @param restore_controller $controller
* @param array $settings a map from admin config names to setting names (Config name => Setting name)
*/
private static function force_enable_settings(restore_controller $controller, array $settings) {
$plan = $controller->get_plan();
foreach ($settings as $config => $settingname) {
$value = true;
if ($plan->setting_exists($settingname)) {
$setting = $plan->get_setting($settingname);
// We do not allow this setting to be locked for a duplicate function.
if ($setting->get_status() !== base_setting::NOT_LOCKED) {
$setting->set_status(base_setting::NOT_LOCKED);
}
$setting->set_value($value);
$setting->set_status(base_setting::LOCKED_BY_CONFIG);
} else {
$controller->log('Unknown setting: ' . $settingname, BACKUP::LOG_DEBUG);
}
}
}
/**
* Sets the controller settings default values from the admin config.
*
+141 -259
View File
@@ -1,5 +1,4 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
@@ -82,7 +81,7 @@ abstract class setting_dependency {
* Destroy all circular references. It helps PHP 5.2 a lot!
*/
public function destroy() {
// No need to destroy anything recursively here, direct reset
// No need to destroy anything recursively here, direct reset.
$this->setting = null;
$this->dependentsetting = null;
}
@@ -94,16 +93,19 @@ abstract class setting_dependency {
* @return bool
*/
final public function process_change($changetype, $oldvalue) {
// Check the type of change requested
// Check the type of change requested.
switch ($changetype) {
// Process a status change
case base_setting::CHANGED_STATUS: return $this->process_status_change($oldvalue);
// Process a visibility change
case base_setting::CHANGED_VISIBILITY: return $this->process_visibility_change($oldvalue);
// Process a value change
case base_setting::CHANGED_VALUE: return $this->process_value_change($oldvalue);
// Process a status change.
case base_setting::CHANGED_STATUS:
return $this->process_status_change($oldvalue);
// Process a visibility change.
case base_setting::CHANGED_VISIBILITY:
return $this->process_visibility_change($oldvalue);
// Process a value change.
case base_setting::CHANGED_VALUE:
return $this->process_value_change($oldvalue);
}
// Throw an exception if we get this far
// Throw an exception if we get this far.
throw new backup_ui_exception('unknownchangetype');
}
/**
@@ -112,11 +114,11 @@ abstract class setting_dependency {
* @return bool
*/
protected function process_visibility_change($oldvisibility) {
// Store the current dependent settings visibility for comparison
// Store the current dependent settings visibility for comparison.
$prevalue = $this->dependentsetting->get_visibility();
// Set it regardless of whether we need to
// Set it regardless of whether we need to.
$this->dependentsetting->set_visibility($this->setting->get_visibility());
// Return true if it changed
// Return true if it changed.
return ($prevalue != $this->dependentsetting->get_visibility());
}
/**
@@ -182,15 +184,16 @@ class setting_dependency_disabledif_equals extends setting_dependency {
*/
public function __construct(base_setting $setting, base_setting $dependentsetting, $value, $defaultvalue = false) {
parent::__construct($setting, $dependentsetting, $defaultvalue);
$this->value = ($value)?(string)$value:0;
$this->value = ($value) ? (string)$value : 0;
}
/**
* Returns true if the dependent setting is locked by this setting_dependency.
* @return bool
*/
public function is_locked() {
// If the setting is locked or the dependent setting should be locked then return true
if ($this->setting->get_status() !== base_setting::NOT_LOCKED || $this->setting->get_value() == $this->value) {
// If the setting is locked or the dependent setting should be locked then return true.
if ($this->setting->get_status() !== base_setting::NOT_LOCKED ||
$this->evaluate_disabled_condition($this->setting->get_value())) {
return true;
}
// Else the dependent setting is not locked by this setting_dependency.
@@ -208,17 +211,25 @@ class setting_dependency_disabledif_equals extends setting_dependency {
return false;
}
$prevalue = $this->dependentsetting->get_value();
// If the setting is the desired value enact the dependency
if ($this->setting->get_value() == $this->value) {
// If the setting is the desired value enact the dependency.
$settingvalue = $this->setting->get_value();
if ($this->evaluate_disabled_condition($settingvalue)) {
// The dependent setting needs to be locked by hierachy and set to the
// default value.
$this->dependentsetting->set_status(base_setting::LOCKED_BY_HIERARCHY);
$this->dependentsetting->set_value($this->defaultvalue);
// For checkboxes the default value is false, but when the setting is
// locked, the value should inherit from the parent setting.
if ($this->defaultvalue === false) {
$this->dependentsetting->set_value($settingvalue);
} else {
$this->dependentsetting->set_value($this->defaultvalue);
}
} else if ($this->dependentsetting->get_status() == base_setting::LOCKED_BY_HIERARCHY) {
// We can unlock the dependent setting
// We can unlock the dependent setting.
$this->dependentsetting->set_status(base_setting::NOT_LOCKED);
}
// Return true if the value has changed for the dependent setting
// Return true if the value has changed for the dependent setting.
return ($prevalue != $this->dependentsetting->get_value());
}
/**
@@ -227,17 +238,18 @@ class setting_dependency_disabledif_equals extends setting_dependency {
* @return bool
*/
protected function process_status_change($oldstatus) {
// Store the dependent status
// Store the dependent status.
$prevalue = $this->dependentsetting->get_status();
// Store the current status
// Store the current status.
$currentstatus = $this->setting->get_status();
if ($currentstatus == base_setting::NOT_LOCKED) {
if ($prevalue == base_setting::LOCKED_BY_HIERARCHY && $this->setting->get_value() != $this->value) {
// Dependency has changes, is not fine, unlock the dependent setting
if ($prevalue == base_setting::LOCKED_BY_HIERARCHY &&
!$this->evaluate_disabled_condition($this->setting->get_value())) {
// Dependency has changes, is not fine, unlock the dependent setting.
$this->dependentsetting->set_status(base_setting::NOT_LOCKED);
}
} else {
// Make sure the dependent setting is also locked, in this case by hierarchy
// Make sure the dependent setting is also locked, in this case by hierarchy.
$this->dependentsetting->set_status(base_setting::LOCKED_BY_HIERARCHY);
}
// Return true if the dependent setting has changed.
@@ -248,17 +260,17 @@ class setting_dependency_disabledif_equals extends setting_dependency {
* @return bool True if there were changes
*/
public function enforce() {
// This will be set to true if ANYTHING changes
// This will be set to true if ANYTHING changes.
$changes = false;
// First process any value changes
// First process any value changes.
if ($this->process_value_change($this->setting->get_value())) {
$changes = true;
}
// Second process any status changes
// Second process any status changes.
if ($this->process_status_change($this->setting->get_status())) {
$changes = true;
}
// Finally process visibility changes
// Finally process visibility changes.
if ($this->process_visibility_change($this->setting->get_visibility())) {
$changes = true;
}
@@ -271,152 +283,72 @@ class setting_dependency_disabledif_equals extends setting_dependency {
*/
public function get_moodleform_properties() {
return array(
'setting'=>$this->dependentsetting->get_ui_name(),
'dependenton'=>$this->setting->get_ui_name(),
'condition'=>'eq',
'value'=>$this->value
'setting' => $this->dependentsetting->get_ui_name(),
'dependenton' => $this->setting->get_ui_name(),
'condition' => 'eq',
'value' => $this->value
);
}
/**
* Evaluate the current value of the setting and return true if the dependent setting should be locked or false.
* This function should be abstract, but there will probably be existing sub-classes so we must provide a default
* implementation.
* @param mixed $value The value of the parent setting.
* @return bool
*/
protected function evaluate_disabled_condition($value) {
return $value == $this->value;
}
}
/**
* A dependency that disables the secondary setting if the primary setting is
* not equal to the provided value
*
* @copyright 2011 Darko Miletic <dmiletic@moodlerooms.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class setting_dependency_disabledif_not_equals extends setting_dependency_disabledif_equals {
/**
* Evaluate the current value of the setting and return true if the dependent setting should be locked or false.
* @param mixed $value The value of the parent setting.
* @return bool
*/
protected function evaluate_disabled_condition($value) {
return $value != $this->value;
}
/**
* Returns an array of properties suitable to be used to define a moodleforms
* disabled command
* @return array
*/
public function get_moodleform_properties() {
return array(
'setting' => $this->dependentsetting->get_ui_name(),
'dependenton' => $this->setting->get_ui_name(),
'condition' => 'notequal',
'value' => $this->value
);
}
}
/**
* A dependency that disables the secondary setting if the primary setting is
* not equal to the provided value
*
* @copyright 2011 Darko Miletic <dmiletic@moodlerooms.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class setting_dependency_disabledif_not_equals extends setting_dependency_disabledif_equals {
/**
* Enforces the dependency if required.
* @return bool True if there were changes
*/
public function enforce() {
// This will be set to true if ANYTHING changes
$changes = false;
// First process any value changes
if (!$this->process_value_change($this->setting->get_value())) {
$changes = true;
}
// Second process any status changes
if ($this->process_status_change($this->setting->get_status())) {
$changes = true;
}
// Finally process visibility changes
if ($this->process_visibility_change($this->setting->get_visibility())) {
$changes = true;
}
return $changes;
}
/**
* Returns an array of properties suitable to be used to define a moodleforms
* disabled command
* @return array
*/
public function get_moodleform_properties() {
return array(
'setting'=>$this->dependentsetting->get_ui_name(),
'dependenton'=>$this->setting->get_ui_name(),
'condition'=>'notequal',
'value'=>$this->value
);
}
}
* Disable if a value is in a list.
*/
class setting_dependency_disabledif_in_array extends setting_dependency_disabledif_equals {
//with array
class setting_dependency_disabledif_equals2 extends setting_dependency {
/**
* The value to compare to
* @var mixed
*/
protected $value;
/**
* Creates the dependency
*
* @param base_setting $setting
* @param base_setting $dependentsetting
* @param mixed $value
* @param mixed $defaultvalue
*/
public function __construct(base_setting $setting, base_setting $dependentsetting, array $value, $defaultvalue = false) {
parent::__construct($setting, $dependentsetting, $defaultvalue);
$this->value = $value;
}
/**
* Returns true if the dependent setting is locked by this setting_dependency.
* Evaluate the current value of the setting and return true if the dependent setting should be locked or false.
* @param mixed $value The value of the parent setting.
* @return bool
*/
public function is_locked() {
// If the setting is locked or the dependent setting should be locked then return true
if ($this->setting->get_status() !== base_setting::NOT_LOCKED || in_array($this->setting->get_value(), $this->value)) {
return true;
}
// Else the dependent setting is not locked by this setting_dependency.
return false;
}
/**
* Processes a value change in the primary setting
* @param mixed $oldvalue
* @return bool
*/
protected function process_value_change($oldvalue) {
$prevalue = $this->dependentsetting->get_value();
// If the setting is the desired value enact the dependency
if (in_array($this->setting->get_value(), $this->value)) {
// The dependent setting needs to be locked by hierachy and set to the
// default value.
$this->dependentsetting->set_status(base_setting::LOCKED_BY_HIERARCHY);
$this->dependentsetting->set_value($this->defaultvalue);
} else if ($this->dependentsetting->get_status() == base_setting::LOCKED_BY_HIERARCHY) {
// We can unlock the dependent setting
$this->dependentsetting->set_status(base_setting::NOT_LOCKED);
}
// Return true if the value has changed for the dependent setting
return ($prevalue != $this->dependentsetting->get_value());
}
/**
* Processes a status change in the primary setting
* @param mixed $oldstatus
* @return bool
*/
protected function process_status_change($oldstatus) {
// Store the dependent status
$prevalue = $this->dependentsetting->get_status();
// Store the current status
$currentstatus = $this->setting->get_status();
if ($currentstatus == base_setting::NOT_LOCKED) {
if ($prevalue == base_setting::LOCKED_BY_HIERARCHY && !in_array($this->setting->get_value(), $this->value)) {
// Dependency has changes, is not fine, unlock the dependent setting
$this->dependentsetting->set_status(base_setting::NOT_LOCKED);
}
} else {
// Make sure the dependent setting is also locked, in this case by hierarchy
$this->dependentsetting->set_status(base_setting::LOCKED_BY_HIERARCHY);
}
// Return true if the dependent setting has changed.
return ($prevalue != $this->dependentsetting->get_status());
}
/**
* Enforces the dependency if required.
* @return bool True if there were changes
*/
public function enforce() {
// This will be set to true if ANYTHING changes
$changes = false;
// First process any value changes
if ($this->process_value_change($this->setting->get_value())) {
$changes = true;
}
// Second process any status changes
if ($this->process_status_change($this->setting->get_status())) {
$changes = true;
}
// Finally process visibility changes
if ($this->process_visibility_change($this->setting->get_visibility())) {
$changes = true;
}
return $changes;
protected function evaluate_disabled_condition($value) {
return in_array($value, $this->value);
}
/**
* Returns an array of properties suitable to be used to define a moodleforms
* disabled command
@@ -424,14 +356,19 @@ class setting_dependency_disabledif_equals2 extends setting_dependency {
*/
public function get_moodleform_properties() {
return array(
'setting'=>$this->dependentsetting->get_ui_name(),
'dependenton'=>$this->setting->get_ui_name(),
'condition'=>'eq',
'value'=>$this->value
'setting' => $this->dependentsetting->get_ui_name(),
'dependenton' => $this->setting->get_ui_name(),
'condition' => 'eq',
'value' => $this->value
);
}
}
/**
* This class is here for backwards compatibility (terrible name).
*/
class setting_dependency_disabledif_equals2 extends setting_dependency_disabledif_in_array {
}
/**
* A dependency that disables the secondary element if the primary element is
@@ -452,9 +389,9 @@ class setting_dependency_disabledif_checked extends setting_dependency_disabledi
*/
public function get_moodleform_properties() {
return array(
'setting'=>$this->dependentsetting->get_ui_name(),
'dependenton'=>$this->setting->get_ui_name(),
'condition'=>'checked'
'setting' => $this->dependentsetting->get_ui_name(),
'dependenton' => $this->setting->get_ui_name(),
'condition' => 'checked'
);
}
}
@@ -478,9 +415,9 @@ class setting_dependency_disabledif_not_checked extends setting_dependency_disab
*/
public function get_moodleform_properties() {
return array(
'setting'=>$this->dependentsetting->get_ui_name(),
'dependenton'=>$this->setting->get_ui_name(),
'condition'=>'notchecked'
'setting' => $this->dependentsetting->get_ui_name(),
'dependenton' => $this->setting->get_ui_name(),
'condition' => 'notchecked'
);
}
}
@@ -497,6 +434,16 @@ class setting_dependency_disabledif_not_empty extends setting_dependency_disable
parent::__construct($setting, $dependentsetting, false, $defaultvalue);
$this->value = false;
}
/**
* Evaluate the current value of the setting and return true if the dependent setting should be locked or false.
* @param mixed $value The value of the parent setting.
* @return bool
*/
protected function evaluate_disabled_condition($value) {
return !empty($value);
}
/**
* Returns an array of properties suitable to be used to define a moodleforms
* disabled command
@@ -504,50 +451,12 @@ class setting_dependency_disabledif_not_empty extends setting_dependency_disable
*/
public function get_moodleform_properties() {
return array(
'setting'=>$this->dependentsetting->get_ui_name(),
'dependenton'=>$this->setting->get_ui_name(),
'condition'=>'notequal',
'value'=>''
'setting' => $this->dependentsetting->get_ui_name(),
'dependenton' => $this->setting->get_ui_name(),
'condition' => 'notequal',
'value' => ''
);
}
/**
* Processes a value change in the primary setting
* @param mixed $oldvalue
* @return bool
*/
protected function process_value_change($oldvalue) {
$prevalue = $this->dependentsetting->get_value();
// If the setting is the desired value enact the dependency
$value = $this->setting->get_value();
if (!empty($value)) {
// The dependent setting needs to be locked by hierachy and set to the
// default value.
$this->dependentsetting->set_status(base_setting::LOCKED_BY_HIERARCHY);
if ($this->defaultvalue === false) {
$this->dependentsetting->set_value($value);
} else {
$this->dependentsetting->set_value($this->defaultvalue);
}
} else if ($this->dependentsetting->get_status() == base_setting::LOCKED_BY_HIERARCHY) {
// We can unlock the dependent setting
$this->dependentsetting->set_status(base_setting::NOT_LOCKED);
}
// Return true if the value has changed for the dependent setting
return ($prevalue != $this->dependentsetting->get_value());
}
/**
* Returns true if the dependent setting is locked by this setting_dependency.
* @return bool
*/
public function is_locked() {
// If the setting is locked or the dependent setting should be locked then return true
if ($this->setting->get_status() !== base_setting::NOT_LOCKED || !empty($value)) {
return true;
}
// Else the dependent setting is not locked by this setting_dependency.
return false;
}
}
/**
@@ -562,6 +471,16 @@ class setting_dependency_disabledif_empty extends setting_dependency_disabledif_
parent::__construct($setting, $dependentsetting, false, $defaultvalue);
$this->value = false;
}
/**
* Evaluate the current value of the setting and return true if the dependent setting should be locked or false.
* @param mixed $value The value of the parent setting.
* @return bool
*/
protected function evaluate_disabled_condition($value) {
return empty($value);
}
/**
* Returns an array of properties suitable to be used to define a moodleforms
* disabled command
@@ -569,47 +488,10 @@ class setting_dependency_disabledif_empty extends setting_dependency_disabledif_
*/
public function get_moodleform_properties() {
return array(
'setting'=>$this->dependentsetting->get_ui_name(),
'dependenton'=>$this->setting->get_ui_name(),
'condition'=>'notequal',
'value'=>''
'setting' => $this->dependentsetting->get_ui_name(),
'dependenton' => $this->setting->get_ui_name(),
'condition' => 'notequal',
'value' => ''
);
}
/**
* Processes a value change in the primary setting
* @param mixed $oldvalue
* @return bool
*/
protected function process_value_change($oldvalue) {
$prevalue = $this->dependentsetting->get_value();
// If the setting is the desired value enact the dependency
$value = $this->setting->get_value();
if (empty($value)) {
// The dependent setting needs to be locked by hierachy and set to the
// default value.
$this->dependentsetting->set_status(base_setting::LOCKED_BY_HIERARCHY);
if ($this->defaultvalue === false) {
$this->dependentsetting->set_value($value);
} else {
$this->dependentsetting->set_value($this->defaultvalue);
}
} else if ($this->dependentsetting->get_status() == base_setting::LOCKED_BY_HIERARCHY) {
// We can unlock the dependent setting
$this->dependentsetting->set_status(base_setting::NOT_LOCKED);
}
// Return true if the value has changed for the dependent setting
return ($prevalue != $this->dependentsetting->get_value());
}
/**
* Returns true if the dependent setting is locked by this setting_dependency.
* @return bool
*/
public function is_locked() {
// If the setting is locked or the dependent setting should be locked then return true
if ($this->setting->get_status() !== base_setting::NOT_LOCKED || empty($value)) {
return true;
}
// Else the dependent setting is not locked by this setting_dependency.
return false;
}
}
+49 -5
View File
@@ -45,7 +45,7 @@ class backp_settings_testcase extends basic_testcase {
/**
* test base_setting class
*/
function test_base_setting() {
public function test_base_setting() {
// Instantiate base_setting and check everything
$bs = new mock_base_setting('test', base_setting::IS_BOOLEAN);
$this->assertTrue($bs instanceof base_setting);
@@ -290,10 +290,54 @@ class backp_settings_testcase extends basic_testcase {
$this->assertEquals($ubs3->get_status(), $ubs1->get_status());
}
/**
* Test that locked and unlocked states on dependent backup settings at the same level
* correctly do not flow from the parent to the child setting when the setting is locked by permissions.
*/
public function test_dependency_empty_locked_by_permission_child_is_not_unlocked() {
// Check dependencies are working ok.
$bs1 = new mock_backup_setting('test1', base_setting::IS_INTEGER, 2);
$bs1->set_level(1);
$bs2 = new mock_backup_setting('test2', base_setting::IS_INTEGER, 2);
$bs2->set_level(1); // Same level *must* work.
$bs1->add_dependency($bs2, setting_dependency::DISABLED_EMPTY);
$bs1->set_status(base_setting::LOCKED_BY_PERMISSION);
$this->assertEquals(base_setting::LOCKED_BY_HIERARCHY, $bs2->get_status());
$this->assertEquals(base_setting::LOCKED_BY_PERMISSION, $bs1->get_status());
$bs2->set_status(base_setting::LOCKED_BY_PERMISSION);
$this->assertEquals(base_setting::LOCKED_BY_PERMISSION, $bs1->get_status());
// Unlocking the parent should NOT unlock the child.
$bs1->set_status(base_setting::NOT_LOCKED);
$this->assertEquals(base_setting::LOCKED_BY_PERMISSION, $bs2->get_status());
}
/**
* Test that locked and unlocked states on dependent backup settings at the same level
* correctly do flow from the parent to the child setting when the setting is locked by config.
*/
public function test_dependency_not_empty_locked_by_config_parent_is_unlocked() {
$bs1 = new mock_backup_setting('test1', base_setting::IS_INTEGER, 0);
$bs1->set_level(1);
$bs2 = new mock_backup_setting('test2', base_setting::IS_INTEGER, 0);
$bs2->set_level(1); // Same level *must* work.
$bs1->add_dependency($bs2, setting_dependency::DISABLED_NOT_EMPTY);
$bs1->set_status(base_setting::LOCKED_BY_CONFIG);
$this->assertEquals(base_setting::LOCKED_BY_HIERARCHY, $bs2->get_status());
$this->assertEquals(base_setting::LOCKED_BY_CONFIG, $bs1->get_status());
// Unlocking the parent should unlock the child.
$bs1->set_status(base_setting::NOT_LOCKED);
$this->assertEquals(base_setting::NOT_LOCKED, $bs2->get_status());
}
/**
* test backup_setting class
*/
function test_backup_setting() {
public function test_backup_setting() {
// Instantiate backup_setting class and set level
$bs = new mock_backup_setting('test', base_setting::IS_INTEGER, null);
$bs->set_level(1);
@@ -340,7 +384,7 @@ class backp_settings_testcase extends basic_testcase {
/**
* test activity_backup_setting class
*/
function test_activity_backup_setting() {
public function test_activity_backup_setting() {
$bs = new mock_activity_backup_setting('test', base_setting::IS_INTEGER, null);
$this->assertEquals($bs->get_level(), backup_setting::ACTIVITY_LEVEL);
@@ -355,7 +399,7 @@ class backp_settings_testcase extends basic_testcase {
/**
* test section_backup_setting class
*/
function test_section_backup_setting() {
public function test_section_backup_setting() {
$bs = new mock_section_backup_setting('test', base_setting::IS_INTEGER, null);
$this->assertEquals($bs->get_level(), backup_setting::SECTION_LEVEL);
@@ -370,7 +414,7 @@ class backp_settings_testcase extends basic_testcase {
/**
* test course_backup_setting class
*/
function test_course_backup_setting() {
public function test_course_backup_setting() {
$bs = new mock_course_backup_setting('test', base_setting::IS_INTEGER, null);
$this->assertEquals($bs->get_level(), backup_setting::COURSE_LEVEL);
@@ -14,6 +14,10 @@ Feature: Duplicate activities
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And I log in as "admin"
And I set the following administration settings values:
| backup_import_activities | 0 |
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add a "Database" to section "1" and I fill the form with:
+6 -5
View File
@@ -50,14 +50,15 @@ function badge_review_cron() {
if (empty($CFG->badges_allowcoursebadges)) {
$coursesql = '';
} else {
$coursesql = ' OR EXISTS (SELECT id FROM {course} WHERE visible = :visible AND startdate < :current) ';
$coursesql = ' OR EXISTS (SELECT c.id FROM {course} c WHERE c.visible = :visible AND c.startdate < :current'
. ' AND c.id = b.courseid)';
$courseparams = array('visible' => true, 'current' => time());
}
$sql = 'SELECT id
FROM {badge}
WHERE (status = :active OR status = :activelocked)
AND (type = :site ' . $coursesql . ')';
$sql = 'SELECT b.id
FROM {badge} b
WHERE (b.status = :active OR b.status = :activelocked)
AND (b.type = :site ' . $coursesql . ')';
$badgeparams = array(
'active' => BADGE_STATUS_ACTIVE,
'activelocked' => BADGE_STATUS_ACTIVE_LOCKED,
+1
View File
@@ -96,6 +96,7 @@ if (!has_any_capability(array(
'moodle/badges:viewawarded',
'moodle/badges:createbadge',
'moodle/badges:awardbadge',
'moodle/badges:configurecriteria',
'moodle/badges:configuremessages',
'moodle/badges:configuredetails',
'moodle/badges:deletebadge'), $PAGE->context)) {
+3 -3
View File
@@ -232,7 +232,7 @@ class block_base {
$bc->footer = $this->content->footer;
}
} else {
$bc->add_class('invisible');
$bc->add_class('invisibleblock');
}
if (!$this->hide_header()) {
@@ -396,13 +396,13 @@ class block_base {
function html_attributes() {
$attributes = array(
'id' => 'inst' . $this->instance->id,
'class' => 'block_' . $this->name(). ' block',
'class' => 'block_' . $this->name() . ' block',
'role' => $this->get_aria_role()
);
if ($this->hide_header()) {
$attributes['class'] .= ' no-header';
}
if ($this->instance_can_be_docked() && get_user_preferences('docked_block_instance_'.$this->instance->id, 0)) {
if ($this->instance_can_be_docked() && get_user_preferences('docked_block_instance_' . $this->instance->id, 0)) {
$attributes['class'] .= ' dock_on_load';
}
return $attributes;
@@ -27,7 +27,7 @@
$string['everything'] = 'Everything';
$string['courses'] = 'Categories and courses';
$string['coursestructures'] = 'Categories, courses, and course structures';
$string['courseactivities'] = 'Categories, courses, and course Activities';
$string['courseactivities'] = 'Categories, courses, and course activities';
$string['enabledockdesc'] = 'Allow the user to dock this block';
$string['expansionlimit'] = 'Generate navigation for the following';
$string['linkcategoriesdesc'] = 'Display categories as links';
@@ -114,12 +114,8 @@ class behat_block_site_main_menu extends behat_base {
protected function get_site_menu_activity_element($element, $selectortype, $activityname) {
$activitynode = $this->get_site_menu_activity_node($activityname);
// Transforming to Behat selector/locator.
list($selector, $locator) = $this->transform_selector($selectortype, $element);
$exception = new ElementNotFoundException($this->getSession(), '"' . $element . '" "' .
$selectortype . '" in "' . $activityname . '" ');
return $this->find($selector, $locator, $exception, $activitynode);
$exception = new ElementNotFoundException($this->getSession(), "'{$element}' '{$selectortype}' in '${activityname}'");
return $this->find($selectortype, $element, $exception, $activitynode);
}
/**
@@ -114,12 +114,8 @@ class behat_block_social_activities extends behat_base {
protected function get_social_block_activity_element($element, $selectortype, $activityname) {
$activitynode = $this->get_social_block_activity_node($activityname);
// Transforming to Behat selector/locator.
list($selector, $locator) = $this->transform_selector($selectortype, $element);
$exception = new ElementNotFoundException($this->getSession(), '"' . $element . '" "' .
$selectortype . '" in "' . $activityname . '" ');
return $this->find($selector, $locator, $exception, $activitynode);
$exception = new ElementNotFoundException($this->getSession(), "'{$element}' '{$selectortype}' in '${activityname}'");
return $this->find($selectortype, $element, $exception, $activitynode);
}
/**
+7
View File
@@ -1284,6 +1284,13 @@ class cache implements cache_loader {
return -1;
}
}
/**
* Subclasses may support purging cache of all data belonging to the
* current user.
*/
public function purge_current_user() {
}
}
/**
+2 -1
View File
@@ -150,7 +150,8 @@ class cachestore_redis extends cache_store implements cache_is_key_aware, cache_
*/
protected function new_redis($server, $prefix = '', $password = '') {
$redis = new Redis();
$port = null;
// Check if it isn't a Unix socket to set default port.
$port = ($server[0] === '/') ? null : 6379;
if (strpos($server, ':')) {
$serverconf = explode(':', $server);
$server = $serverconf[0];
+1
View File
@@ -49,6 +49,7 @@ class core_calendar_export_form extends moodleform {
$export = array();
$export[] = $mform->createElement('radio', 'exportevents', '', get_string('eventsall', 'calendar'), 'all');
$export[] = $mform->createElement('radio', 'exportevents', '', get_string('eventsrelatedtocategories', 'calendar'), 'categories');
$export[] = $mform->createElement('radio', 'exportevents', '', get_string('eventsrelatedtocourses', 'calendar'), 'courses');
$export[] = $mform->createElement('radio', 'exportevents', '', get_string('eventsrelatedtogroups', 'calendar'), 'groups');
$export[] = $mform->createElement('radio', 'exportevents', '', get_string('eventspersonal', 'calendar'), 'user');
+1 -2
View File
@@ -531,8 +531,7 @@ class provider implements
AND ctx.contextlevel = :categorycontext)
OR (e.courseid = ctx.instanceid
AND (e.eventtype = 'course'
OR e.eventtype = 'group'
OR e.modulename != '0')
OR e.eventtype = 'group')
AND ctx.contextlevel = :coursecontext)
OR (e.userid = ctx.instanceid
AND e.eventtype = 'user'
+13 -5
View File
@@ -40,8 +40,8 @@ $time = optional_param('preset_time', 'weeknow', PARAM_ALPHA);
$now = $calendartype->timestamp_to_date_array(time());
// Let's see if we have sufficient and correct data
$allowed_what = array('all', 'user', 'groups', 'courses');
$allowed_time = array('weeknow', 'weeknext', 'monthnow', 'monthnext', 'recentupcoming', 'custom');
$allowedwhat = ['all', 'user', 'groups', 'courses', 'categories'];
$allowedtime = ['weeknow', 'weeknext', 'monthnow', 'monthnext', 'recentupcoming', 'custom'];
if (!empty($generateurl)) {
$authtoken = sha1($user->id . $user->password . $CFG->calendar_exportsalt);
@@ -56,9 +56,9 @@ if (!empty($generateurl)) {
redirect($link->out());
die;
}
$paramcategory = false;
if(!empty($what) && !empty($time)) {
if(in_array($what, $allowed_what) && in_array($time, $allowed_time)) {
if(in_array($what, $allowedwhat) && in_array($time, $allowedtime)) {
$courses = enrol_get_users_courses($user->id, true, 'id, visible, shortname');
// Array of courses that we will pass to calendar_get_legacy_events() which
// is initially set to the list of the user's courses.
@@ -78,6 +78,7 @@ if(!empty($what) && !empty($time)) {
$courses[SITEID] = new stdClass;
$courses[SITEID]->shortname = get_string('globalevents', 'calendar');
$paramcourses[SITEID] = $courses[SITEID];
$paramcategory = true;
} else if ($what == 'groups') {
$users = false;
$paramcourses = array();
@@ -85,6 +86,11 @@ if(!empty($what) && !empty($time)) {
$users = $user->id;
$groups = false;
$paramcourses = array();
} else if ($what == 'categories') {
$users = $user->id;
$groups = false;
$paramcourses = array();
$paramcategory = true;
} else {
$users = false;
$groups = false;
@@ -180,7 +186,9 @@ if(!empty($what) && !empty($time)) {
die();
}
}
$events = calendar_get_legacy_events($timestart, $timeend, $users, $groups, array_keys($paramcourses), false);
$events = calendar_get_legacy_events($timestart, $timeend, $users, $groups, array_keys($paramcourses), false, true,
$paramcategory);
$ical = new iCalendar;
$ical->add_property('method', 'PUBLISH');
+8
View File
@@ -48,6 +48,14 @@ Feature: Export calendar events
When I click on "Get calendar URL" "button"
Then I should see "&preset_what=groups&"
Scenario: Generating calendar URL for category events
Given I follow "This month"
And I click on "Export calendar" "button"
And I set the field "Events related to categories" to "1"
And I set the field "Recent and next 60 days" to "1"
When I click on "Get calendar URL" "button"
Then I should see "&preset_what=categories&"
Scenario: Generating calendar URL for user events
Given I follow "This month"
And I click on "Export calendar" "button"
+13 -2
View File
@@ -365,12 +365,23 @@ class core_calendar_privacy_testcase extends provider_testcase {
// Delete all Calendar Events for all Users by Context for Course 2.
provider::delete_data_for_all_users_in_context($course2context);
// Verify all Calendar Events for Course 2 were deleted.
$events = $DB->get_records('event', array('courseid' => $course2->id));
// Verify all Calendar Events for Course 2 context were deleted.
$events = $DB->get_records('event', array('courseid' => $course2->id, 'modulename' => '0'));
$this->assertCount(0, $events);
// Verify all Calendar Subscriptions for Course 2 were deleted.
$subscriptions = $DB->get_records('event_subscriptions', array('courseid' => $course2->id));
$this->assertCount(0, $subscriptions);
// Verify all Calendar Events for the assignment exists still.
$events = $DB->get_records('event', array('modulename' => 'assign'));
$this->assertCount(2, $events);
// Delete all Calendar Events for all Users by Context for the assignment.
provider::delete_data_for_all_users_in_context($modulecontext);
// Verify all Calendar Events for the assignment context were deleted.
$events = $DB->get_records('event', array('modulename' => 'assign'));
$this->assertCount(0, $events);
}
/**
+2 -7
View File
@@ -28,7 +28,6 @@ require_once($CFG->dirroot.'/cohort/upload_form.php');
require_once($CFG->libdir . '/csvlib.class.php');
$contextid = optional_param('contextid', 0, PARAM_INT);
$returnurl = optional_param('returnurl', '', PARAM_URL);
require_login();
@@ -56,13 +55,9 @@ if ($context->contextlevel == CONTEXT_COURSECAT) {
navigation_node::override_active_url(new moodle_url('/cohort/index.php', array()));
}
$uploadform = new cohort_upload_form(null, array('contextid' => $context->id, 'returnurl' => $returnurl));
$uploadform = new cohort_upload_form(null, array('contextid' => $context->id));
if ($returnurl) {
$returnurl = new moodle_url($returnurl);
} else {
$returnurl = new moodle_url('/cohort/index.php', array('contextid' => $context->id));
}
$returnurl = new moodle_url('/cohort/index.php', array('contextid' => $context->id));
if ($uploadform->is_cancelled()) {
redirect($returnurl);
-3
View File
@@ -48,9 +48,6 @@ class cohort_upload_form extends moodleform {
$mform = $this->_form;
$data = (object)$this->_customdata;
$mform->addElement('hidden', 'returnurl');
$mform->setType('returnurl', PARAM_URL);
$mform->addElement('header', 'cohortfileuploadform', get_string('uploadafile'));
$filepickeroptions = array();
@@ -192,8 +192,8 @@ class course_module_competency extends persistent {
$sql = 'SELECT COUNT(comp.id)
FROM {' . self::TABLE . '} coursemodulecomp
JOIN {' . competency::TABLE . '} comp
ON coursecomp.competencyid = comp.id
WHERE coursecomp.cmid = ? ';
ON coursemodulecomp.competencyid = comp.id
WHERE coursemodulecomp.cmid = ? ';
$params = array($cmid);
$results = $DB->count_records_sql($sql, $params);

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