Compare commits

..

570 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7) d6cf0e56d1 Moodle release 2.7.18 2017-01-08 11:04:13 +01:00
Eloy Lafuente (stronk7) 6ee6517142 Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2017-01-08 11:04:10 +01:00
David Mudrák d88aa76c77 MDL-57580 mod_assign: Fix the incorrect type of some input parameters
The PARAM_TEXT has been misused in certain cases here. The 'action'
parameter seems to always be alphabetic, with values like
savesubmission, editsubmission and others as handled in assign::view().

Fixing the action handling fixes the reported XSS issue. While working
on it, I spotted two more places where PARAM_TEXT does not seem
appropriate. I include changes for them too, even if they are no
strictly related to the reported bug and there are no known ways to
abuse it.

* The 'plugin' looks like PARAM_PLUGIN and is even declared as such in
  some other parts of the assignment code (such as feedback forms).

* The 'workflowstate' is one of the ASSIGN_MARKING_WORKFLOW_STATE
  constants and is supposed to be alpha in external function input
  parameters handling, too.
2017-01-05 17:40:49 +01:00
Rajesh Taneja 3f3e62e4fc MDL-57531 behat: Set noreplyaddress to valid address
noreplyaddress should be a valid address, else
it will not be saved. For behat we don't send
email, so set it to noreply@example.com, to
avoid failing validation on localhost
2017-01-05 06:55:52 +00:00
Dan Poltawski 7815c64b0c Merge branch 'MDL-57531-27-phpmailer' of git://github.com/mudrd8mz/moodle into MOODLE_27_STABLE 2017-01-04 13:30:59 +00:00
David Mudrák a444a47d14 MDL-57531 mail: Validate the sender's email address
The patch adds validation for the noreplyaddress setting variable, for
the explicit $replyto parameter and for the sender's email. In case of
misconfigured noreplyaddress setting, it falls back to the default
noreply address value. In case of invalid email in the user's record,
the email is not sent.

The patch also adds unit test for the value returned by the function
generate_email_processing_address() so that it can be considered as a
valid email, too.

This is supposed to significantly minimise the risk of exploiting the
vulnerability in PHPMailer's Sender field.
2017-01-04 13:30:52 +01:00
David Mudrák 9267c05fb1 MDL-57531 mail: Do not let admins set invalid email addresses
The noreply and support emails should always be valid.
2017-01-04 13:26:58 +01:00
David Mudrák 172d31e9a5 MDL-56225 mod_forum: Fix inability to edit attachments
The 'attachments' is not a real DB field here. It comes from the form's
filepicker and holds the id of the attachments filearea. The function
forum_add_attachment() expects it as a property of the first argument.

There were two possible approaches here. Either to pass the raw $newpost
to forum_add_attachment(), or add the attachments into the list
modifiable fields. The second approach is safer.
2017-01-04 10:37:42 +00:00
Andrew Nicols 76523cdfa9 MDL-56225 mod_forum: Remove unnecessary attributes from update 2017-01-03 17:42:49 +00:00
AMOS bot 4733c7050b Automatically generated installer lang files 2016-12-01 00:06:42 +08:00
AMOS bot 98bb032ead Merge branch 'MOODLE_27_STABLE' into install_27_STABLE 2016-12-01 00:06:42 +08:00
AMOS bot 12eeadd914 Automatically generated installer lang files 2016-11-30 00:05:37 +08:00
Dan Poltawski 1504e9b81e weekly release 2.7.17+ 2016-11-29 13:36:11 +00:00
Dan Poltawski 7bef8b0693 Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2016-11-29 13:36:10 +00:00
Vladimir Zhirov 4120362395 MDL-57163 installation: fixed "Call to undefined function curl_version" 2016-11-27 12:20:22 +04:00
AMOS bot 8c35f12a8f Automatically generated installer lang files 2016-11-27 00:06:38 +08:00
AMOS bot f81c6fdec8 Automatically generated installer lang files 2016-11-23 00:06:12 +08:00
AMOS bot d92b0800d4 Automatically generated installer lang files 2016-11-17 00:05:45 +08:00
Eloy Lafuente (stronk7) 413f973528 Moodle release 2.7.17 2016-11-12 20:21:14 +01:00
Eloy Lafuente (stronk7) 9ebc70478c Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2016-11-12 20:21:11 +01:00
Andrew Nicols ec452fbb5c Merge branch 'MDL-55121-27' of git://github.com/lameze/moodle into MOODLE_27_STABLE 2016-11-11 15:15:41 +08:00
Simey Lameze d37bb7c46b MDL-55121 environment: check for unsuported php version 7.1 2016-11-11 12:36:29 +08:00
Dan Poltawski 8f4e115c4f Merge branch 'MDL-55777-27' of git://github.com/ankitagarwal/moodle into MOODLE_27_STABLE 2016-11-10 13:46:52 +00:00
Ankit Agarwal d4f9bdbcc1 MDL-55777 installation: Check libcurl version on install 2016-11-10 10:26:03 +05:30
AMOS bot cc1614d05f Automatically generated installer lang files 2016-11-07 00:05:43 +08:00
Simey Lameze b163efd07f MDL-51347 core_notes: check view notes capability by course context 2016-10-17 16:18:39 +08:00
AMOS bot 2678d6f078 Automatically generated installer lang files 2016-10-17 00:07:37 +08:00
AMOS bot 9d3e4f4340 Automatically generated installer lang files 2016-10-12 00:05:47 +08:00
Tim Hunt 2045bc333a MDL-53744 question file access: fix access checks 2016-10-10 11:11:39 +08:00
AMOS bot ecfb290941 Automatically generated installer lang files 2016-10-09 00:07:21 +08:00
AMOS bot 9ad7551401 Automatically generated installer lang files 2016-10-08 00:05:39 +08:00
AMOS bot 07c4ebe443 Automatically generated installer lang files 2016-10-05 00:07:20 +08:00
AMOS bot dc3655f55a Automatically generated installer lang files 2016-09-28 00:05:31 +08:00
Juan Leyva e552a8c7a2 MDL-56065 user: Fix update_users Web Service
Users won’t be updated if:
- They are admins and the user updating is not
- They are the guest user
- They are mnet users
- They are deleted users
2016-09-26 18:39:50 +02:00
AMOS bot 321e82a9a8 Automatically generated installer lang files 2016-09-17 00:05:36 +08:00
AMOS bot feb2e0bebd Automatically generated installer lang files 2016-09-16 00:06:01 +08:00
Dan Poltawski bf44038b22 weekly release 2.7.16+ 2016-09-15 11:15:14 +01:00
Jake Dallimore 607beb59b0 MDL-55945 login: fix https support for forgot_password.php 2016-09-15 09:24:24 +08:00
Eloy Lafuente (stronk7) 1f04e7c685 Moodle release 2.7.16 2016-09-10 22:50:03 +02:00
Eloy Lafuente (stronk7) f9705ee40a Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2016-09-10 22:49:58 +02:00
AMOS bot 9a866e798c Automatically generated installer lang files 2016-08-30 00:05:51 +08:00
Jake Dallimore ab924a2bdb MDL-50803 login: Remove token from URL in forgot password process
Store the token value in the session and redirect to self, thus
removing the token from the URL and eliminating the problem where
the token is exposed via the http referer header.
2016-08-16 10:29:36 +01:00
AMOS bot 2cbc50c4f2 Automatically generated installer lang files 2016-08-10 00:05:49 +08:00
AMOS bot ef1da08e16 Automatically generated installer lang files 2016-08-06 00:05:54 +08:00
Juan Leyva 53ae713302 MDL-49026 webservice: Remove tokens on password change 2016-08-02 09:35:12 +08:00
AMOS bot 686a1a8add Automatically generated installer lang files 2016-08-02 00:05:17 +08:00
AMOS bot 9d613188bf Automatically generated installer lang files 2016-07-20 00:06:10 +08:00
AMOS bot 64a011a163 Automatically generated installer lang files 2016-07-16 00:06:28 +08:00
AMOS bot 94e882e044 Automatically generated installer lang files 2016-07-13 00:05:40 +08:00
AMOS bot e75204b50f Automatically generated installer lang files 2016-07-11 00:06:48 +08:00
Eloy Lafuente (stronk7) 6480b0c1ea Moodle release 2.7.15 2016-07-10 00:29:03 +02:00
Eloy Lafuente (stronk7) 5b25976c77 Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2016-07-10 00:28:59 +02:00
Marina Glancy 80c861c1fe MDL-55069 core: escape special characters in email headers 2016-07-04 12:28:13 +01:00
Andrew Nicols 719293b5b0 Merge branch 'MDL-53019_27' of git://github.com/stronk7/moodle into MOODLE_27_STABLE 2016-07-04 09:15:13 +08:00
AMOS bot 24593b48cc Automatically generated installer lang files 2016-07-02 00:05:51 +08:00
Eloy Lafuente (stronk7) cd48d26b5a MDL-53019 environment: 3.2 requirements added
Changes:
 - PHP 5.6.5 required
2016-07-01 13:51:01 +02:00
AMOS bot cd69ae6435 Automatically generated installer lang files 2016-06-22 00:07:20 +08:00
AMOS bot 8bcdea8b9f Automatically generated installer lang files 2016-06-21 00:06:32 +08:00
AMOS bot 73acf1b228 Automatically generated installer lang files 2016-06-04 00:05:18 +08:00
AMOS bot fe1f8f6fbd Automatically generated installer lang files 2016-06-02 00:04:59 +08:00
AMOS bot d3a6608388 Automatically generated installer lang files 2016-05-24 00:05:13 +08:00
AMOS bot 9f8ac03403 Automatically generated installer lang files 2016-05-15 00:05:45 +08:00
AMOS bot 9127f98c56 Automatically generated installer lang files 2016-05-10 00:05:39 +08:00
Eloy Lafuente (stronk7) fb8bd4eefe Moodle release 2.7.14 2016-05-08 00:23:31 +02:00
Eloy Lafuente (stronk7) 764a377498 Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2016-05-08 00:23:27 +02:00
Simey Lameze a4bacca03b MDL-53913 core_user: make parameters consistent across versions 2016-05-06 09:50:52 +08:00
Andrew Nicols 0cc5fd542c MDL-53589 badges: Correct context 2016-05-06 09:50:51 +08:00
Eloy Lafuente (stronk7) 932572a65f MDL-54018 timezones: Updated to 2016d 2016-05-06 09:50:51 +08:00
Frederic Massart 188a3e7f70 MDL-51369 course: Adding tests to cover restoring course info 2016-05-06 09:50:50 +08:00
Frederic Massart 24b0c3c86a MDL-51369 backup: Respect capabilities when restoring course info
In short, when a user is creating a new course they can set
the ID number, shortname, fullname and summary. However, when
they merge a backup into a course they need the permissions to do so.
2016-05-06 09:50:50 +08:00
Frederic Massart 4c27175d35 MDL-53954 user: Prevent locked profile fields from being edited 2016-05-06 09:50:50 +08:00
Andrew Nicols 1f5c494f76 MDL-53755 forum: Check session when marking posts 2016-05-06 09:50:49 +08:00
Dan Marsden 3b0357ec11 MDL-53546 SCORM: Set window.opener to null 2016-05-06 09:50:49 +08:00
AMOS bot 3c3a2e5a9b Automatically generated installer lang files 2016-05-05 00:05:14 +08:00
David Monllao e7bca5e773 MDL-54008 tz: Avoid using Caracas tz
Changed in May 2016.
2016-05-02 16:45:19 +08:00
AMOS bot ea28e5c16f Automatically generated installer lang files 2016-05-02 00:04:56 +08:00
AMOS bot f85098f750 Automatically generated installer lang files 2016-04-30 00:07:31 +08:00
Dan Poltawski bf659cf992 weekly release 2.7.13+ 2016-04-29 15:55:15 +01:00
Dan Poltawski 3ac5c9214f Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2016-04-29 15:55:12 +01:00
Eloy Lafuente (stronk7) a33bcb1ad4 MDL-53928 environment: add xmlreader requirement for 3.1 2016-04-24 01:38:08 +02:00
AMOS bot 58bdad73f9 Automatically generated installer lang files 2016-04-13 00:04:52 +08:00
AMOS bot 4f3d703a04 Automatically generated installer lang files 2016-04-07 00:05:44 +08:00
AMOS bot dfe76fd4aa Automatically generated installer lang files 2016-04-01 00:05:29 +08:00
Dan Poltawski 3a775835f7 weekly release 2.7.13+ 2016-03-31 14:06:57 +08:00
Dan Poltawski 858d152f00 Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2016-03-31 14:06:54 +08:00
AMOS bot f507b978cb Automatically generated installer lang files 2016-03-30 00:04:55 +08:00
AMOS bot 83174c10ed Automatically generated installer lang files 2016-03-29 00:04:53 +08:00
AMOS bot 8b41f763fd Automatically generated installer lang files 2016-03-25 00:05:15 +08:00
Eloy Lafuente (stronk7) a5ea6951e4 MDL-53585 timezones: Updated to 2016b 2016-03-23 13:20:59 +01:00
Eloy Lafuente (stronk7) e7acb5cfca Moodle release 2.7.13 2016-03-12 00:37:46 +01:00
Eloy Lafuente (stronk7) 89a50ced1f Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2016-03-12 00:37:42 +01:00
Simey Lameze f4fcb1c4f7 MDL-50705 auth_db: apply standard cleaning to all fields
Also unit tests were added to cover the new clean_data() method.
2016-03-09 18:23:36 +01:00
Simey Lameze 3b214760fb MDL-50705 core_user: introduce new fill_properties_cache()
Also the get_property_definition() was created to get the property without retrieve the whole definition cache and
    unit tests were created to tests those new methods.
2016-03-09 18:23:31 +01:00
Simey Lameze 55ba3a26d2 MDL-53031 mod_assign: add session check on assignment plugins management 2016-03-08 19:55:02 +01:00
Jun Pataleta 089ab60017 MDL-52433 user: Remove unnecessary capability check 2016-03-08 12:25:05 +01:00
Cameron Ball 9f91c23536 MDL-52651 htmlpurifier: Append rel=noreferrer to links.
Thank you to Zachary Durber for originally working on this issue.
2016-03-08 02:09:13 +01:00
Krista Koivisto ea8987644f MDL-52774 ajax: Require authentication when getting nav branch
When getting the navigation branch data through AJAX, require
login if forcelogin is set.
2016-03-08 00:32:05 +01:00
Juan Leyva 11106f6cee MDL-52901 mod_assign: Check due dates in external save_submission 2016-03-08 00:14:49 +01:00
Juan Leyva c631b112d6 MDL-52808 calendar: Do not return events for hidden activities 2016-03-07 22:31:30 +01:00
David Mudrák 87e60e5299 MDL-52727 mod_data: Improve output of the form fields values
This issue mostly affects the search form fields. Submitted values for
these fields are typically obtained via optional_param() with
PARAM_NOTAGS specified as the parameter type - see parse_search_field()
methods. Such values themselves are not safe enough to be printed back
directly into the HTML as they might contain malicious code.

While working on the patch, some other places with weak protection were
detected and fixed.

In case of the itemid parameters, the s() seems to be unnecessary but it
was added anyway as an extra protection (just in case the code flow
changes or the parts of the code are re-used elsewhere).
2016-03-07 22:06:50 +01:00
AMOS bot 246a8720f4 Automatically generated installer lang files 2016-03-03 22:24:42 +08:00
AMOS bot 9d0328d512 Automatically generated installer lang files 2016-03-03 22:24:42 +08:00
AMOS bot 7816a936f4 Automatically generated installer lang files 2016-03-03 00:04:54 +08:00
AMOS bot 64c2c35e47 Automatically generated installer lang files 2016-02-28 00:04:47 +08:00
AMOS bot 77798e3ab5 Automatically generated installer lang files 2016-02-25 00:12:17 +08:00
AMOS bot c1b28f4c53 Automatically generated installer lang files 2016-02-24 00:05:05 +08:00
Dan Poltawski c8eb9ee629 weekly release 2.7.12+ 2016-02-22 09:11:08 +00:00
Dan Poltawski 958b261ba3 Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2016-02-22 09:11:07 +00:00
AMOS bot a927e80033 Automatically generated installer lang files 2016-02-13 00:04:58 +08:00
Eloy Lafuente (stronk7) 8459a1e0c9 MDL-51580 environment: 3.1 requirements added
Only important change is that Moodle 2.7 installed is
required to be able to upgrade to 3.1. See the issue
for opinions, votes and agreed outcomes.
2016-02-10 18:29:07 +01:00
AMOS bot 9f7e43b966 Automatically generated installer lang files 2016-02-10 00:04:50 +08:00
AMOS bot 467f7d4663 Automatically generated installer lang files 2016-02-06 00:04:45 +08:00
AMOS bot 6b1b3d6970 Automatically generated installer lang files 2016-02-04 00:04:50 +08:00
AMOS bot 5243e075d2 Automatically generated installer lang files 2016-01-28 00:04:58 +08:00
AMOS bot 5c8c9eb2b1 Automatically generated installer lang files 2016-01-26 00:04:42 +08:00
AMOS bot 048c1dfd12 Automatically generated installer lang files 2016-01-25 00:04:44 +08:00
AMOS bot 0b1befe942 Automatically generated installer lang files 2016-01-23 00:04:56 +08:00
AMOS bot 691048cf99 Automatically generated installer lang files 2016-01-19 00:05:26 +08:00
AMOS bot 314f6cfe4c Automatically generated installer lang files 2016-01-13 00:04:35 +08:00
Eloy Lafuente (stronk7) 3f85661e18 Moodle release 2.7.12 2016-01-09 00:49:38 +01:00
Eloy Lafuente (stronk7) 0d8f9cfa23 Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2016-01-09 00:49:34 +01:00
AMOS bot cbc01e026f Automatically generated installer lang files 2016-01-06 00:04:36 +08:00
Juan Leyva c14e2d624c MDL-52072 enrol: Fix course visibility checks in external functions 2016-01-05 10:31:42 +00:00
AMOS bot 6db07d4ba7 Automatically generated installer lang files 2016-01-04 00:04:59 +08:00
AMOS bot 0be0a9a6c6 Automatically generated installer lang files 2015-12-25 00:04:40 +08:00
AMOS bot 58224a3895 Automatically generated installer lang files 2015-12-20 00:05:52 +08:00
Dan Poltawski 25cc38fa1b weekly release 2.7.11+ 2015-12-18 12:27:21 +00:00
Dan Poltawski 9d5c4e3a31 Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2015-12-18 12:27:19 +00:00
Marina Glancy 44ecaa6858 MDL-52438 core: allow Moodle 3.0 to be used with PHP7 2015-12-10 17:58:06 +08:00
AMOS bot 476931bd9d Automatically generated installer lang files 2015-12-05 00:05:18 +08:00
AMOS bot a0a823432e Automatically generated installer lang files 2015-12-04 00:05:16 +08:00
AMOS bot a41b505a22 Automatically generated installer lang files 2015-11-25 00:04:54 +08:00
Dan Poltawski d27a325e72 weekly release 2.7.11+ 2015-11-19 09:20:43 +00:00
Dan Poltawski 39656c43ea Merge branch 'wip-MDL-52194-m27' of https://github.com/marinaglancy/moodle into MOODLE_27_STABLE 2015-11-19 06:49:41 +00:00
Marina Glancy 5486cc980c MDL-52194 flowplayer: do not check request
$_REQUEST variable may contain cookies in some php configurations. See also MDL-48085
2015-11-18 15:38:27 +08:00
Eloy Lafuente (stronk7) ab881c73e9 weekly release 2.7.11+ 2015-11-10 10:49:45 +01:00
Eloy Lafuente (stronk7) 9abe17f825 Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2015-11-10 10:49:38 +01:00
AMOS bot d503e1badd Automatically generated installer lang files 2015-11-10 00:04:44 +08:00
David Monllao a55bf44fc5 Merge branch 'MDL-49473-27' of git://github.com/danpoltawski/moodle into MOODLE_27_STABLE 2015-11-09 15:13:34 +08:00
Eloy Lafuente (stronk7) 059c03d494 Moodle release 2.7.11 2015-11-06 20:51:29 +01:00
rajesh Taneja d01512e36c MDL-50837 mod_scorm: include locallib to access function 2015-11-06 20:44:25 +01:00
Dan Poltawski 8f097731ad weekly release 2.7.10+ 2015-11-06 11:56:46 +00:00
Dan Poltawski cb550d707c Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2015-11-06 11:56:44 +00:00
Eloy Lafuente (stronk7) ff9f974ad8 MDL-51861 enrol: added missing external cleanup for formal compliance 2015-11-06 10:07:44 +00:00
Dani Palou 12bc713081 MDL-51861 enrol: Don't get all parts in get_enrolled_users with groups 2015-11-06 15:13:14 +08:00
Eloy Lafuente (stronk7) 3b6de196e5 MDL-51861 enrol: new unit test to verify all conditions and filters
This unit test does not verify contents, details, but only
that the returned users for every group mode, for every
filtering (active, groupid and withcapability) together
with permissions are correct.
2015-11-06 15:13:07 +08:00
John Okely fb2491effb MDL-51569 mod_choice: Prevent users from updating choices with curl 2015-11-06 14:53:46 +08:00
Damyon Wiese 97394274ee MDL-51569 mod_choice: Validate the submitted optionid
Make sure any submitted choice options actually belong to the current choice
module.
2015-11-05 10:56:36 +00:00
David Monllao d70f610615 MDL-51684 badges: Make sure 'moodle/badges:viewbadges' is respected
Credit to Yuliya Bozhko.
2015-11-04 13:02:58 +00:00
Juan Leyva 3d58fd5841 MDL-50837 mod_scorm: Fix availability checks 2015-11-04 12:56:34 +01:00
Juan Leyva bdaa571437 MDL-51569 mod_choice: Check choice availability prior to do any action 2015-11-04 11:08:59 +00:00
Cameron Ball a1168a7427 MDL-51091 core_registration: session key check in registration. 2015-11-04 18:46:29 +08:00
Simey Lameze fd14d2902f MDL-49940 mod_survey: Fix XSS on survey module 2015-11-04 18:46:29 +08:00
Hugh Davenport 86cec86942 MDL-49940 mod_survey: Escape user comments
This patch fixes a XSS vulnerability with surveys where a student user
    could inject arbitrary HTML in a comment on the survey. The fix is to
    escape the comment before displaying it to the teacher.
2015-11-04 18:46:29 +08:00
Simey Lameze f75333766c MDL-48109 mod_lesson: prevent CSRF on lesson
This commit add a new session key hidden field on the lesson password form
and confirm if the session key is valid on related pages to prevent CSRF on
password protected lessons.
2015-11-04 18:46:29 +08:00
Petr Skoda 26da47c704 MDL-48085 flowplayer: prevent flash parameters via url 2015-11-04 10:38:22 +00:00
Adrian Greeve 7d6e5d78d6 MDL-51486 mod_data: Unit test update for item ratings.
Additional checks that access is available for item ratings
on records that have a group id of zero (all participants).
2015-11-04 10:18:55 +08:00
AMOS bot b249fb78b1 Automatically generated installer lang files 2015-11-04 00:04:57 +08:00
Dan Poltawski 5be2cb4ffa MDL-49473 logs: ensure exported logs contain year 2015-11-03 11:38:45 +00:00
Adrian Greeve 9735a1a4a5 MDL-51486 mod_data: Can view rating information.
When students are given the appropriate permissions
to view ratings, in the situation where there are
separate groups. The students can view the ratings
of an entry that is in the all participants group.
2015-11-03 16:47:42 +08:00
Dan Poltawski d70a6a7235 weekly release 2.7.10+ 2015-10-30 21:08:50 +00:00
Dan Poltawski cbbbd25d60 Merge branch 'MDL-51939-27' of git://github.com/andrewnicols/moodle into MOODLE_27_STABLE 2015-10-29 14:16:22 +00:00
Eloy Lafuente (stronk7) f857f7c443 MDL-51939 mod_forum: all participants discussions are viewed by students
Added scenario to verify that "all participants" discussions, under
separate-groups mode are, by default, visible for students.
2015-10-29 21:04:24 +08:00
Andrew Nicols 14d3f19dd8 weekly release 2.7.10+ 2015-10-28 12:57:52 +08:00
Andrew Nicols 59b8d89ba8 MDL-51939 mod_forum: Correct empty groupinfo check 2015-10-28 12:11:34 +08:00
Eloy Lafuente (stronk7) ab937ab868 MDL-51863 packer: ensure empty zip files behavior remains consistent
With PHP bug #70322 fixed, ZipArchive::close() did start returning false
and throwing PHP Warnings with recent PHP versions (5.6.14 and up).
Previously (5.6.13 verified) it was returning true, and false in older
versions (5.4.x verified).

This change does silent the 2 "hacky" calls to close() that we perform
in core leaving the 3rd one (used for files having files) unmodified.

A new unit test has been created to cover the close() behavior, ideally
supporting both old and new PHP versions without harcoding any PHP
version.

Note that we don't use to rely much on results coming from close(), and
that's a good thing given the buggy behavior commented above. This just
keeps empty zips working like they were before.
2015-10-27 11:57:31 +00:00
Dan Poltawski 840ae905cc weekly release 2.7.10+ 2015-10-23 12:51:58 +01:00
David Monllao 77993ae5e4 MDL-51822 timezones: Update to IANA 2015g 2015-10-20 10:07:51 +08:00
Eloy Lafuente (stronk7) 69cde92e60 weekly release 2.7.10+ 2015-10-16 12:51:11 +02:00
Eloy Lafuente (stronk7) 364bcdcd10 Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2015-10-16 12:51:05 +02:00
Andrew Nicols c1e723b8e6 Merge branch 'MDL-50182_27' of git://github.com/stronk7/moodle into MOODLE_27_STABLE 2015-10-16 08:16:14 +08:00
Eloy Lafuente (stronk7) 730529d4f2 MDL-50182 core: add 3.0 environmental requirements
Only change from 2.9 is the modification of the slasharguments
admin setting string to recommend always to keep the setting enabled
and fix the problem in the server, warning about the drawbacks
of disabling it.

Also, there is a little phpdoc note added to one custom check
to have clearly specified when we can get rid of it.
2015-10-13 00:36:31 +02:00
Mifsud Gaël 3c6d9d5392 MDL-51083 admin: Prevent password autofill in authentication settings 2015-10-09 14:34:17 +08:00
AMOS bot bf4da5f6e6 Automatically generated installer lang files 2015-09-28 00:04:21 +08:00
Eloy Lafuente (stronk7) 8f64e05ae0 weekly release 2.7.10+ 2015-09-24 16:07:06 +02:00
Paul Nicholls 08e02452dc MDL-51190 javascript: Make "maximised embed" compatible with MS Edge
MS Edge exhibits strange behaviour when M.util.init_maximised_embed hides
the embedded document by setting its width and height to 0px.  Toggling
display:none instead achieves the intended goal without breaking Edge.
2015-09-15 16:25:43 +12:00
Eloy Lafuente (stronk7) c92478291f Moodle release 2.7.10 2015-09-12 02:02:53 +02:00
Eloy Lafuente (stronk7) d430445562 Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2015-09-12 02:02:47 +02:00
Marina Glancy 936facab28 MDL-50744 enrol_meta: fix incorrect role assign (#2) 2015-09-11 08:14:15 +08:00
rajesh Taneja 2ad7733c07 MDL-50516 behat: Back/next button reloads page
When next/back button is pressed in phantomjs/browserkit
it reload page, so adding a bug_phantomjs, so that we can
test the lesson re-attempt scenario
2015-09-10 14:53:17 +08:00
Andrew Nicols c3757ed868 Merge branch 'MDL-50852-27' of git://github.com/junpataleta/moodle into MOODLE_27_STABLE 2015-09-09 15:42:36 +08:00
Jun Pataleta f91ea3f848 MDL-50852 formslib: Fixed client-side form validation problem.
This patch fixes the problem of client validation being broken when
shortforms is not enabled. This issue is caused by moodle-core-event
module not being loaded and the broadcast parameter in the
Y.Global.publish set to 2 instead of true.
2015-09-09 15:40:39 +08:00
Mark Nelson 748d8a982b MDL-50516 mod_lesson: changes to existing behat tests 2015-09-09 15:33:05 +08:00
Mark Nelson 1d017fb8cd MDL-50516 mod_lesson: added behat tests 2015-09-09 15:33:05 +08:00
Mark Nelson b22e3e6170 MDL-50516 core_behat: added ability to go back, forward and reload the browser 2015-09-09 15:33:04 +08:00
Mark Nelson ca74203efd MDL-50516 mod_lesson: fixed issue with grade not using minquestions
It's possible to reach the end of the lesson, get your result,
click back until you get to the last question, answer it correctly
and then be awarded a result of 100%. This was because the grade
calculation would only include the questions answered, rather than
all of them in the lesson. However, you can not fix this by always
grading by the amount of questions in the lesson as some lessons
bypass certain questions depending on the answer to previous ones.
The minquestion setting can now successfully be used to prevent this
behaviour by rewording the misleading string and adding logic.
2015-09-09 15:33:04 +08:00
Mark Nelson e7288eaabe MDL-50516 mod_lesson: prevented deletion of previous attempts
The 'startlastseen' flag was removing any previous attempts
the user had from the DB. This meant that the user could
simply re-answer the question, regardless of the number
of attempts allowed.
2015-09-09 15:33:04 +08:00
Mark Nelson 3071f08591 MDL-50516 mod_lesson: prevented user from repeating question
It was possible in the lesson module for a user to
answer a question, get the result, then click back
in the browser and re-answer it, even if they exceeded
the number of attempts allowed per question.
2015-09-09 15:33:04 +08:00
Ankit Agarwal 4015226623 MDL-50173 ratings: Use proper checks to ensure ratings are viewable.
Mainly to verify groups visibility this new callback has been created.

Note this was originally 2 commits but for amending purposes they have
been squashed.
2015-09-09 04:53:35 +02:00
Andrew Nicols 0bbeac0d0d MDL-50576 mod_forum: Correct use of movedicussions cap when posting This is a partial backport of the logic added on MDL-50714 to post.php to prevent users to post to a forum without permission.
The ability to view the group dropdown was too closely related to the
movediscussions capability when posting, or editing a forum post.

The movedicussions capability should only be considered for some parts of
this logic. Users should be able to select the group to post to when
writing message, as long as they have access to that group.
2015-09-08 16:43:21 +02:00
Simey Lameze 7824b2f6d9 MDL-50576 mod_forum: prevent posting to a non-member group
Thanks Fred for the help on the issue.
2015-09-08 16:43:21 +02:00
John Okely 45f3b5302d MDL-50709 groups: Prevent XSS in grouping description 2015-09-08 12:50:12 +02:00
Petr Skoda 6e8224365f MDL-50860 core: improve creation of random strings 2015-09-08 01:09:28 +02:00
Eloy Lafuente (stronk7) a178221dcc MDL-42670 mod_assign: include missing assign/localib.php 2015-09-07 22:56:55 +02:00
Tim Lock acefd2e24f MDL-42670 mod_assign: Fix recent activity block when blind marking is on 2015-09-07 22:45:15 +02:00
Marina Glancy dff6cdc883 MDL-50744 enrol_meta: fix incorrect role assign 2015-09-07 10:29:12 +01:00
Adrian Greeve 78de2e86e8 MDL-48371 editors: Option for removing managefiles
We want to remove the managefiles button from the
editors in the wiki so that students don't delete
each others files.
2015-09-07 09:59:29 +01:00
AMOS bot e9cb74ea3c Automatically generated installer lang files 2015-09-04 00:04:17 +08:00
AMOS bot e0e0a2346a Automatically generated installer lang files 2015-09-02 00:05:38 +08:00
Marina Glancy ddd6ae29fb MDL-51131 tags: remove instances when course is deleted 2015-08-25 13:16:24 +08:00
Eloy Lafuente (stronk7) 7e5fc27be9 weekly release 2.7.9+ 2015-08-13 12:16:44 +02:00
Eloy Lafuente (stronk7) 68d9b2583a Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2015-08-13 12:16:39 +02:00
AMOS bot 029bb76641 Automatically generated installer lang files 2015-08-13 00:04:33 +08:00
AMOS bot b227a2c771 Automatically generated installer lang files 2015-08-13 00:04:33 +08:00
John Okely 826c79f4b2 MDL-51050 admin: Stop browsers from autofilling passwords incorrectly
Backport of MDL-45772.
2015-08-09 19:26:45 +02:00
AMOS bot 3f58ec1385 Automatically generated installer lang files 2015-08-07 00:04:12 +08:00
Andrew Nicols c66e940849 weekly release 2.7.9+ 2015-08-06 12:11:15 +08:00
Andrew Nicols 1bd23e0728 Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2015-08-06 12:11:09 +08:00
AMOS bot ca0366e03f Automatically generated installer lang files 2015-08-06 00:04:20 +08:00
AMOS bot d0ef635c4e Automatically generated installer lang files 2015-08-06 00:04:20 +08:00
Eloy Lafuente (stronk7) 2faa6cee53 Merge branch 'MDL-50416-27' of git://github.com/lameze/moodle into MOODLE_27_STABLE 2015-08-04 19:56:37 +02:00
Simey Lameze 578f992731 MDL-50416 environment: remove slasharguments warning from install 2015-08-04 09:53:05 +08:00
Ryan Wyllie 81d961ba3a MDL-50624 environment: add PHP7 as unsupported version
Added PHP7 as an unsupported version for Moodle 2.7, 2.8 and 2.9
in the environment checks
2015-08-04 01:36:33 +00:00
AMOS bot 2ef21fc1de Automatically generated installer lang files 2015-08-04 00:04:29 +08:00
AMOS bot 0b777c448a Automatically generated installer lang files 2015-07-26 00:04:10 +08:00
AMOS bot 76a37f3a42 Automatically generated installer lang files 2015-07-24 00:04:27 +08:00
AMOS bot e1a7d6b0c3 Automatically generated installer lang files 2015-07-21 00:04:43 +08:00
AMOS bot b9facf0b41 Automatically generated installer lang files 2015-07-20 00:05:16 +08:00
AMOS bot 447e895db9 Automatically generated installer lang files 2015-07-18 00:05:26 +08:00
AMOS bot 3dcc3440d1 Automatically generated installer lang files 2015-07-17 00:05:14 +08:00
Eloy Lafuente (stronk7) fa54db9c03 Moodle release 2.7.9 2015-07-03 13:38:11 +02:00
Eloy Lafuente (stronk7) a7c5b8b2c7 Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2015-07-03 13:38:05 +02:00
Juan Leyva ffe5c78488 MDL-50130 users: Filter profile fields data in external functions 2015-06-30 19:50:48 +02:00
AMOS bot 6ac71df086 Automatically generated installer lang files 2015-07-01 00:05:08 +08:00
Dan Marsden f3e7afedb9 MDL-50614 mod_scorm: Improve validation on currentorg 2015-06-30 10:14:56 +08:00
Eloy Lafuente (stronk7) 630b8fdaea MDL-50688 lib: small cleanup + http/https coverage. 2015-06-29 17:50:23 +02:00
Petr Skoda 5673aae914 MDL-50688 lib: fix local url validation bug
Change-Id: I350bb8c9ace5cc0403f083f728c100097be7aa7e
Reviewed-on: https://review.totaralms.com/8101
Tested-by: Jenkins Automation <jenkins@totaralms.com>
Reviewed-by: Sam Hemelryk <sam.hemelryk@totaralms.com>
Reviewed-by: Alastair Munro <alastair.munro@totaralms.com>
2015-06-29 17:50:16 +02:00
AMOS bot 5b25b33fa7 Automatically generated installer lang files 2015-06-19 00:04:18 +08:00
Dan Poltawski c8a1646ab8 weekly release 2.7.8+ 2015-06-18 16:11:43 +01:00
Dan Poltawski 76cd16e6e4 Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2015-06-18 16:11:41 +01:00
AMOS bot f886f76e7f Automatically generated installer lang files 2015-06-17 00:04:15 +08:00
AMOS bot 2d6c0ecd0d Automatically generated installer lang files 2015-06-17 00:04:14 +08:00
Andrew Nicols 920d2d9585 Merge branch 'MDL-50380-27' of git://github.com/lameze/moodle into MOODLE_27_STABLE 2015-06-16 07:59:12 +08:00
Simey Lameze 2bd8a55dfd MDL-50380 mod_wiki: fix missing parameter on wiki edit files page
Also fixing a typo on the $referer variable.
2015-06-03 16:49:55 +08:00
AMOS bot 2f6c18c88c Automatically generated installer lang files 2015-06-02 00:04:22 +08:00
AMOS bot baa9517b57 Automatically generated installer lang files 2015-05-30 00:04:15 +08:00
AMOS bot 5330c5c2d4 Automatically generated installer lang files 2015-05-29 00:04:08 +08:00
AMOS bot 30aeabb79e Automatically generated installer lang files 2015-05-27 00:03:57 +08:00
AMOS bot 2f63a6883f Automatically generated installer lang files 2015-05-23 00:04:11 +08:00
AMOS bot ebb8f60603 Automatically generated installer lang files 2015-05-22 00:03:58 +08:00
Eloy Lafuente (stronk7) 37fd0a3d81 weekly release 2.7.8+ 2015-05-21 12:37:12 +02:00
Eloy Lafuente (stronk7) 547932e130 Merge branch 'MDL-50275-27' of git://github.com/danpoltawski/moodle into MOODLE_27_STABLE 2015-05-19 17:45:33 +02:00
Dan Poltawski ee612f1ed2 MDL-50275 quiz: version bump for MDL-49941
Otherwise the new capability risk does not get loaded
2015-05-19 15:47:13 +01:00
Dan Poltawski 67ac2b0cee Merge branch 'MDL-50177_27' of git://github.com/dmonllao/moodle into MOODLE_27_STABLE 2015-05-18 13:05:02 +01:00
David Monllao a5155586fe MDL-50177 completion: Also accepting cm integer strings 2015-05-12 12:22:07 +08:00
Eloy Lafuente (stronk7) 12e29080e1 Moodle release 2.7.8 2015-05-10 11:39:14 +02:00
Eloy Lafuente (stronk7) 70a3da5396 weekly release 2.7.7+ 2015-05-08 12:14:24 +02:00
Eloy Lafuente (stronk7) 3109a202db Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2015-05-08 12:14:09 +02:00
Rajesh Taneja 3a22694267 MDL-50154 behat: Click on Grades link under navigation 2015-05-08 13:36:49 +08:00
Rajesh Taneja bda6ef6fe9 MDL-50154 behat: Resize pdf window so toolbar is always visible 2015-05-08 13:36:42 +08:00
Frederic Massart a13f667276 MDL-50128 mod_data: String needed escaping before being used in regex 2015-05-07 11:26:09 +08:00
Andrew Nicols 295fad3d07 Merge branch 'm27_MDL-50133' of https://github.com/danmarsden/moodle into MOODLE_27_STABLE 2015-05-07 10:26:45 +08:00
Andrew Nicols fee5de5adf Merge branch 'MDL-49783-27' of git://github.com/mastnym/moodle into MOODLE_27_STABLE 2015-05-07 09:43:58 +08:00
Martin Mastny dfea73010d MDL-49783 forms: Collapsed form section is opened on error 2015-05-07 09:28:22 +08:00
Dan Marsden 3c542cdda5 MDL-50133 mod_scorm: use correct captypes 2015-05-07 11:47:15 +12:00
Dan Poltawski 9f1cd92626 Merge branch 'MDL-49664' of git://github.com/stronk7/moodle into MOODLE_27_STABLE 2015-05-06 09:33:04 +01:00
Dan Poltawski 045be2b1a7 Merge branch 'MDL-49664-27' of https://github.com/LukeCarrier/moodle into MOODLE_27_STABLE 2015-05-06 08:04:38 +01:00
Marina Glancy b7d307e807 MDL-49788 navigation: Ensure we only check active enrolments 2015-05-06 08:02:47 +01:00
Salih Gedik 70bd537332 MDL-49789 mod_book: filter book chapter content 2015-05-06 13:55:21 +08:00
Marina Glancy b4da1e0ae4 MDL-49718 externallib: unittest correction 2015-05-06 13:02:02 +08:00
Marina Glancy 78ec6751fc MDL-50090 user: suspended user can login upon conrimation 2015-05-06 11:02:26 +08:00
Juan Leyva 28947c1d7d MDL-49718 webservices: Fix forced format and force external text cleaning 2015-05-06 10:56:23 +08:00
Juan Leyva 350397da93 MDL-49994 files: Prevent to browse private files when are disabled 2015-05-06 10:27:40 +08:00
AMOS bot 4068025c04 Automatically generated installer lang files 2015-05-06 00:04:03 +08:00
Marina Glancy 80eb5bc7b7 MDL-50099 auth: less verbose account confirmed message 2015-05-05 15:34:02 +01:00
Frederic Massart 19bf8ae268 MDL-49179 setuplib: print_error() uses local URLs exclusively 2015-05-05 18:31:14 +08:00
Frederic Massart 7f426dd24f MDL-49179 weblib: Secure the direct usage of $_SERVER['HTTP_REFERER'] 2015-05-05 18:31:14 +08:00
Frederic Massart 278cd8f20f MDL-49179 mod_forum, mod_quiz: Prevent misuse of get_referer() 2015-05-05 18:31:14 +08:00
Tim Hunt 39ae18a2f9 MDL-49941 quiz: mod/quiz:grade should declare RISK_XSS 2015-05-05 18:31:14 +08:00
Frederic Massart df96662b0e MDL-49401 moodlelib: PARAM_LOCALURL supports loginhttps 2015-05-05 18:31:14 +08:00
Eloy Lafuente (stronk7) 323f3745fe weekly release 2.7.7+ 2015-05-05 12:28:40 +02:00
David Monllao 8cad4af03e Merge branch 'MDL-50055-27' of git://github.com/andrewnicols/moodle into MOODLE_27_STABLE 2015-05-05 10:52:29 +08:00
John Okely afa1a8e3fb MDL-49848 message: Make messaging interface responsive 2015-05-05 10:31:08 +08:00
Andrew Nicols 0a2c4e7eca MDL-50055 enrol: Stop requiring javascript for behat tests 2015-05-05 10:25:18 +08:00
Andrew Nicols 79da0b1581 MDL-50055 tests: Add new step to deal with Single Selects 2015-05-05 10:25:13 +08:00
David Monllao 03e35c77fd Merge branch 'MDL-49954-27' of git://github.com/jleyva/moodle into MOODLE_27_STABLE 2015-05-04 15:16:47 +08:00
David Monllao 8e20b6da45 MDL-50103 mod_assign: Fixing behat test
The participant number is dynamically generated so it is not possible to
match known values.

Match on the submission text instead.
2015-05-04 09:36:15 +08:00
David Monllao dbfaa2da32 weekly release 2.7.7+ 2015-05-01 16:47:20 +08:00
David Monllao 7f99e1d1ea MDL-49232 enrol_self: Adapting unit test to new can_self_enrol() output 2015-05-01 15:49:44 +08:00
Andrew Nicols e534e99afd Merge branch 'MDL-49232_m27' of git://github.com/markn86/moodle into MOODLE_27_STABLE 2015-05-01 09:28:13 +08:00
Dan Poltawski 29b97d94bb Merge branch 'MDL-50028_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2015-04-30 16:07:01 +01:00
Andrew Nicols a25eef762f Merge branch 'MDL-49583-m27' of https://github.com/NeillM/moodle into MOODLE_27_STABLE 2015-04-30 15:23:21 +08:00
Andrew Nicols 5473b69ade Merge branch 'MDL-50038-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2015-04-30 14:56:54 +08:00
Andrew Nicols 4d711ff280 Merge branch 'MDL-50033-27-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_27_STABLE 2015-04-30 10:52:27 +08:00
Andrew Nicols 04b42e3077 MDL-49232 enrol_self: Add behat test for non-guest self-enrolment 2015-04-29 18:02:51 -07:00
Mark Nelson 1a8400f5eb MDL-49232 enrol_self: display continue button 2015-04-29 18:02:50 -07:00
David Mudrák a1b09ffb52 MDL-50033 lang: Update Behat scenario to use the new string 2015-04-29 23:49:38 +02:00
Helen Foster ffce507736 MDL-50033 lang: Merge English strings from the en_fix language pack 2015-04-29 23:48:24 +02:00
Frederic Massart f78f3fb749 MDL-50038 my: Redirect admin users to the notifications page when needed 2015-04-29 19:05:14 +08:00
Neill Magill e4e261bd7e MDL-49583 enrol: enrol/index.php page doesn't handle direct access well
Before this patch if a user who is not logged in to Moodle accesses the
enrol/index.php page directly they were redirected to the Moodle front
page after login, rather than back to a page that would allow them to
self enrol, if it is enabled on the course.

This change will cause a user who directly accesses the page to be
redirected back to it after they have logged in, unless the course has guest
access enabled.

Thanks to Marina Glancy for suggesting the use of get_referer()
2015-04-29 09:14:38 +01:00
David Monllao 1354593011 Merge branch 'MDL-49637-m27' of git://github.com/NeillM/moodle into MOODLE_27_STABLE 2015-04-29 12:05:36 +08:00
Tim Hunt be18b7c593 MDL-50028 qtype_match: fix correct answer display
Atto's stupid tendency to create HTML like
<p>You don't need a br at the end of a paragraph!</br></p>
was breaking it.
2015-04-28 13:08:23 +01:00
Tim Hunt f7db06401e MDL-50028 questions: split into one testcase class per file 2015-04-28 13:08:21 +01:00
Dan Poltawski 697929847f weekly release 2.7.7+ 2015-04-28 09:28:14 +01:00
Dan Poltawski bbeaad5052 Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2015-04-28 09:28:12 +01:00
Neill Magill 21c59d05e1 MDL-49637 assign: Workflow & blind marking do not always show feedback
Before this patch if an assignment has workflow and blind marking enabled if a teacher
sets a submission to have its grades released to students before they reveal student
identities the feedback they have given is not displayed to the student.

The patch causes the reveal_identities() method to pass the correct value to the
get_feedback_plugin_by_type() function in the assign class.
2015-04-28 09:12:12 +01:00
Neill Magill 62099b3be0 MDL-49637 assign: Behat test for blind marking with workflow
This test checks that that if reveal student identities is used before or after the submissions grades have
been set released that the teacher's feedback is displayed to students.
2015-04-28 09:11:59 +01:00
David Monllao 3a33d06d85 Merge branch 'MDL-42449-2.7' of git://github.com/andrewhancox/moodle into MOODLE_27_STABLE 2015-04-28 11:08:40 +08:00
David Monllao e22d6ad0ed Merge branch 'MDL-49911-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2015-04-28 09:47:16 +08:00
Eloy Lafuente (stronk7) a9074a2649 MDL-49664 renderers: Verify expected render methods are called.
For various renderables (core, plugin, namespaced), all them
against the base and plugin renderers.
2015-04-27 18:41:24 +02:00
Juan Leyva d89e4bc0e6 MDL-49954 forum: Use clean_returnvalue properly in external unit tests 2015-04-27 18:25:55 +02:00
AMOS bot df967d0185 Automatically generated installer lang files 2015-04-28 00:04:18 +08:00
Dan Poltawski d9f965c1e4 Merge branch 'MDL-49993_27' of git://github.com/grabs/moodle into MOODLE_27_STABLE 2015-04-27 14:48:01 +01:00
Dan Poltawski 2842b48847 Merge branch 'MDL-49913_27' of git://github.com/jmvedrine/moodle into MOODLE_27_STABLE 2015-04-27 14:28:36 +01:00
Dan Poltawski bba516205b Merge branch 'MDL-49977_m27' of git://github.com/markn86/moodle into MOODLE_27_STABLE 2015-04-27 10:53:21 +01:00
Andreas Grabs ade5a860b5 MDL-49993 mod_feedback: Question auto numbers have no space between number and question 2015-04-26 19:03:34 +02:00
AMOS bot 5452cc62f2 Automatically generated installer lang files 2015-04-25 00:04:12 +08:00
Andrew Hancox 9aae67ec07 MDL-42449 backup: Fix for activity grade category
Retain grade category when restoring an activity into the course that
it came from
2015-04-24 14:04:51 +01:00
Dan Poltawski e47d9d12c6 weekly release 2.7.7+ 2015-04-24 12:10:41 +01:00
Dan Poltawski e07cff97f1 Merge branch 'MDL-49960-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2015-04-24 09:06:38 +01:00
Frederic Massart 056e2ea0be MDL-49911 admin: Prevent notices when updatenotifications is disabled 2015-04-24 14:49:16 +08:00
Andrew Nicols 436463209e Merge branch 'MDL-49311-27' of git://github.com/lameze/moodle into MOODLE_27_STABLE 2015-04-24 11:53:00 +08:00
papillon 2a9e7de93c MDL-49311 user: fix default sorting problem 2015-04-24 09:12:06 +08:00
Mark Nelson 86a79e2578 MDL-49977 mod_assign: added missing page titles 2015-04-23 17:08:55 -07:00
Dan Poltawski 40d66dfdd0 Merge branch 'MDL-49946_27' of https://github.com/jmvedrine/moodle into MOODLE_27_STABLE 2015-04-23 13:32:36 +01:00
Andrew Nicols d2d64d0264 Merge branch 'MDL-49319_backport_27' of https://github.com/andyjdavis/moodle into MOODLE_27_STABLE 2015-04-23 15:24:28 +08:00
Frederic Massart 467fe2e4b1 MDL-49960 message: Adding behat test for recent conversations 2015-04-23 14:56:03 +08:00
Jean-Michel Vedrine 16ade9d88c MDL-49913 mod_lesson: studentanswer format should be HTML 2015-04-23 08:44:13 +02:00
Jean-Michel Vedrine b34be49db4 MDL-49913 mod_lesson: fix import scores and jumps 2015-04-23 08:44:11 +02:00
Jean-Michel Vedrine a5f4089c68 MDL-49913 mod_lesson: defaultanswer to avoid duplication 2015-04-23 08:39:05 +02:00
Jean-Michel Vedrine a6e090b15f MDL-49913 mod_lesson: round question grades on import 2015-04-23 08:31:05 +02:00
Andrew Nicols 26507a9a67 Merge branch 'MDL-49477-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2015-04-23 13:53:56 +08:00
Andrew Nicols 83180e040a Merge branch 'MDL-34921_27_unwanted-sitehome-redirects' of https://github.com/colin-umn/moodle into MOODLE_27_STABLE 2015-04-23 12:34:49 +08:00
Andrew Nicols 2ab166e39e Merge branch 'MDL-49613-m27' of https://github.com/NeillM/moodle into MOODLE_27_STABLE 2015-04-23 11:28:41 +08:00
Jean-Michel Vedrine 46ebedce58 MDL-49946 mod_lesson: improve qformat_default::defaultquestion 2015-04-22 19:57:17 +02:00
Dan Poltawski 70cb53466d Merge branch 'MDL-49921-27' of git://github.com/jleyva/moodle into MOODLE_27_STABLE 2015-04-22 16:40:58 +01:00
Andrew Davis a164589209 MDL-49319 core_registration: altered registration strings 2015-04-22 20:28:08 +08:00
Viduranga Wijesooriya 5ae7cc6255 MDL-49477 availability_grade-form: checkbox disable problem fixed
Signed-off-by: Viduranga Wijesooriya <vpowerrc@gmail.com>
2015-04-22 17:35:09 +08:00
Tony Butler 52cdd42a89 MDL-49933 mod_assign: Sort marker select lists alphabetically by name 2015-04-22 17:02:45 +08:00
Neill Magill 43f35d037e MDL-49613 access: count_role_users gives unexpected results
The count_role_users function in lib/accesslib.php gives the wrong results if a user has the
same role at multiple levels in a context path.

For example a user is a coursecreator on a course and the category that the course is in,
in this case they would be counted twice, rather than being recognised as the same user.

This change will make the function only count unique users.
2015-04-22 09:28:42 +01:00
Neill Magill 07f50b7284 MDL-49613 access: Unit test for count_role_users 2015-04-22 09:28:41 +01:00
Juan Leyva 852d96580b MDL-49921 forum: Handle exceptions correctly in get_forums_by_courses 2015-04-22 09:52:40 +02:00
Andrew Nicols 4d3bad7e51 Merge branch 'MDL-49753-m27' of https://github.com/alexmitin/moodle into MOODLE_27_STABLE 2015-04-22 11:07:04 +08:00
Dan Poltawski b4a592aa3b weekly release 2.7.7+ 2015-04-21 11:16:50 +01:00
Andrew Nicols a94e5a405d MDL-40811 uploaduser: Optimise testuser code 2015-04-21 11:38:58 +08:00
Andrew Nicols 3428cd4c9b Merge branch 'wip-mdl-40881-m27' of https://github.com/rajeshtaneja/moodle into MOODLE_27_STABLE 2015-04-21 11:38:45 +08:00
Brian Barnes 6cb449dc0f MDL-49782 general: removed uses of window.status 2015-04-21 10:46:22 +08:00
Nadav Kavalerchik de8958e8ac MDL-40881 uploaduser: Validate profile fields unique values 2015-04-21 10:21:23 +08:00
Andrew Nicols 267f12abe1 Merge branch 'wip-mdl-49799-m27' of https://github.com/rajeshtaneja/moodle into MOODLE_27_STABLE 2015-04-20 12:32:34 +08:00
Rajesh Taneja e69a1a6b6f MDL-49799 behat: use example.com as test email
asd.com is a valid domain, we should use reserved domain names for testing
2015-04-20 12:30:32 +08:00
David Monllao 83503c9838 Merge branch 'MDL-48187_m27' of git://github.com/markn86/moodle into MOODLE_27_STABLE 2015-04-20 12:19:50 +08:00
David Monllao fca58b02df Merge branch 'wip-MDL-49880-27' of git://github.com/abgreeve/moodle into MOODLE_27_STABLE 2015-04-20 12:13:10 +08:00
Mark Nelson c0ffc90640 MDL-48187 core_course: use updated '$grade_item' 2015-04-19 20:30:42 -07:00
David Monllao 5ee0d1d3ee Merge branch 'm27_MDL-49904' of git://github.com/totara/moodle into MOODLE_27_STABLE 2015-04-20 10:42:02 +08:00
Adrian Greeve fd6358feaa MDL-49880 mod_lesson: Fixed notice while importing questions.
Cloze questions (not supported by lesson) threw up a notice saying that
the course wasn't set.
2015-04-20 08:43:46 +08:00
Dan Poltawski 99a5af9eda weekly release 2.7.7+ 2015-04-17 10:53:49 +01:00
David Monllao e0caa3031d Merge branch 'MDL-48723_27_forum-plagiarism_errors' of git://github.com/colin-umn/moodle into MOODLE_27_STABLE 2015-04-17 10:41:48 +08:00
Brian Barnes 62990c9d11 MDL-49904 user: set title when editing another user 2015-04-17 11:46:58 +12:00
Dan Poltawski 0bbacc0e2f Merge branch 'MDL-49837-27' of git://github.com/jleyva/moodle into MOODLE_27_STABLE 2015-04-16 12:17:32 +01:00
David Monllao 300503ddd6 Merge branch 'MDL-45131-27' of git://github.com/jleyva/moodle into MOODLE_27_STABLE 2015-04-16 17:05:23 +08:00
Juan Leyva 3d1c374bd5 MDL-45131 notes: Add validation for returned parameters in WS tests 2015-04-16 10:31:19 +02:00
Juan Leyva 59061012b8 MDL-45131 user: Add validation for returned parameters in WS tests 2015-04-16 10:31:07 +02:00
Juan Leyva df2f832789 MDL-45131 message: Add validation for returned parameters in WS tests 2015-04-16 10:30:52 +02:00
Juan Leyva 3135752ba0 MDL-45131 files: Add validation for returned parameters in WS tests 2015-04-16 10:30:41 +02:00
Juan Leyva d6fd894a76 MDL-45131 enrol: Add validation for returned parameters in WS tests 2015-04-16 10:30:28 +02:00
Juan Leyva 433b5c28db MDL-45131 course: Add validation for returned parameters in WS tests 2015-04-16 10:30:12 +02:00
Juan Leyva ef394f5aa9 MDL-45131 cohort: Add validation for returned parameters in WS tests 2015-04-16 10:28:33 +02:00
Juan Leyva 982440c14f MDL-45131 calendar: Add validation for returned parameters in WS tests 2015-04-16 10:28:22 +02:00
Skylar Kelty 715d55c963 MDL-49489 caching: Prevent full coursecontact purge 2015-04-16 07:50:08 +08:00
Dan Poltawski 8b011c7b2e Merge branch 'MDL-49803_27' of git://github.com/dmonllao/moodle into MOODLE_27_STABLE 2015-04-15 15:06:20 +01:00
David Monllao 1106aa4c4c Revert "MDL-46963 core_upgrade: change the call to guess_antelope_row_size"
This reverts commit c85de44a7b.
2015-04-15 15:53:07 +08:00
David Monllao 840cb4e4d6 MDL-49803 mod_quiz: Fixing overrides restore 2015-04-15 15:31:18 +08:00
Simey Lameze c85de44a7b MDL-46963 core_upgrade: change the call to guess_antelope_row_size 2015-04-15 15:01:42 +08:00
David Monllao 59728f1a7c Merge branch 'MDL-46963-27' of git://github.com/lameze/moodle into MOODLE_27_STABLE 2015-04-15 13:37:00 +08:00
Dan Poltawski 6378ece404 weekly release 2.7.7+ 2015-04-14 16:49:08 +01:00
Dan Poltawski a82add34eb Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2015-04-14 16:49:06 +01:00
Rajesh Taneja 8a8ae4df07 MDL-44611 behat: Description is required field and should be set 2015-04-14 12:17:26 +08:00
AMOS bot 62f8da23af Automatically generated installer lang files 2015-04-14 00:04:19 +08:00
Juan Leyva 24eae8af65 MDL-49837 assign: Use correct assertions and fix return params cleaning 2015-04-13 17:36:54 +02:00
Juan Leyva 16dde93127 MDL-49837 assign: Fix external functions return declaration
Incorrect use of external_warnings function
2015-04-13 17:36:53 +02:00
Dan Poltawski 81c0cd9644 Merge branch 'MDL-48702_backport_log_27' of https://github.com/andyjdavis/moodle into MOODLE_27_STABLE 2015-04-13 16:26:50 +01:00
Dan Poltawski ab3ac68481 Merge branch 'MDL-49166_site_rego_27' of https://github.com/andyjdavis/moodle into MOODLE_27_STABLE 2015-04-13 15:34:48 +01:00
Dan Poltawski 55b5acd0a8 Merge branch 'MDL-49756-27' of git://github.com/mr-russ/moodle into MOODLE_27_STABLE 2015-04-13 15:05:58 +01:00
Andrew Nicols b0761ac9bd Merge branch 'MDL-49426-27' of git://github.com/jleyva/moodle into MOODLE_27_STABLE 2015-04-13 14:33:06 +08:00
Simey Lameze d0a74e4db9 MDL-46963 environment: add check for antelope row format 2015-04-13 14:30:55 +08:00
Andrew Nicols 91afdf5f61 Merge branch 'MDL-33328_search_enrol_users_MDL27' of https://github.com/barrysspace/moodle into MOODLE_27_STABLE 2015-04-13 13:49:35 +08:00
Andrew Nicols 9eb5bab913 Merge branch 'MDL-48836_m27' of https://github.com/markn86/moodle into MOODLE_27_STABLE 2015-04-13 13:33:15 +08:00
Ramindu Deshapriya 8ecc51ed61 MDL-44611 core_course: Added Behat test to automate MDLQA 5252 2015-04-13 11:13:21 +08:00
Russell Smith 409722bf2f MDL-49756 course: Add unit tests for section_options. 2015-04-11 08:07:43 +10:00
Russell Smith 3b19fb6319 MDL-49756 course: Allow unit tests to set course formats.
This is a backport of 2.8 changes that allows testing using custom
course format classes that aren't plugins.  It's required to add
unit tests in MDL-49756 for 2.7.
2015-04-11 08:07:43 +10:00
Russell Smith 3e7ae2b7da MDL-48836 backup: Use a trie for grouped path detection.
Backport of MDL-41674.
2015-04-10 14:10:33 -07:00
Juan Leyva b09e0ba6c4 MDL-49426 webservices: Allow upload to draft area always 2015-04-10 10:43:50 +02:00
Barry Oosthuizen e5e2a01924 MDL-33328 enrol_manual: use correct parameter in search function
Searching for user from "Enrol users" panel causes blocks to dock in IE
2015-04-09 18:58:43 +01:00
Dan Poltawski b0682b9333 weekly release 2.7.7+ 2015-04-09 10:27:02 +01:00
Dan Poltawski 5e5a7b24b3 Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2015-04-09 10:27:00 +01:00
Colin Campbell 2bcfe2567e MDL-48723 mod/forum: Fix cron task error on digest attachments. 2015-04-08 13:24:40 -05:00
Andrew Davis 70cbcfe454 MDL-49166 registration: now states whether or not site is registered 2015-04-08 20:45:59 +08:00
AMOS bot 68f9c67088 Automatically generated installer lang files 2015-04-08 00:04:18 +08:00
Eloy Lafuente (stronk7) 4f1e546cc7 Merge branch 'MDL-48205_27' of https://github.com/totara/openbadges into MOODLE_27_STABLE 2015-04-07 14:21:53 +02:00
Brendan Heywood 6d2f958fc5 MDL-49740 Lock: Fixed task lock release bugs 2015-04-07 13:09:45 +01:00
David Monllao 41fecc5d7f MDL-43558 theme_base: We don't need edit toggle if modeditingmenu is disabled 2015-04-07 16:25:37 +08:00
Alex Mitin c428924fbf MDL-49753 enrolments: preselct status filter if needed 2015-04-07 16:15:52 +08:00
David Monllao 3c5c1fc348 Merge branch 'MDL-37984-27' of git://github.com/mastnym/moodle into MOODLE_27_STABLE 2015-04-07 16:09:08 +08:00
Andrew Nicols bef2cf1d28 MDL-49395 core: add more unit tests for get_enrolled_sql 2015-04-07 15:28:16 +08:00
Andrew Nicols 52df0b99ee Merge branch 'suspended_userids_memory_27' of git://github.com/tlevi/moodle into MOODLE_27_STABLE 2015-04-07 15:28:14 +08:00
Dan Poltawski a0c267eaa8 Merge branch 'mdl38210-moodle27' of https://github.com/tlock/moodle into MOODLE_27_STABLE 2015-04-06 12:36:21 +01:00
Colin Campbell e9d861b105 MDL-34921 course/format: Fix unwanted redirects from Site home 2015-04-04 21:33:37 -05:00
Luke Carrier c57d132ebb MDL-49664 output: backport renderer namespacing fix 2015-04-02 16:16:16 +01:00
Eloy Lafuente (stronk7) 06d2bb239e weekly release 2.7.7+ 2015-04-02 11:48:54 +02:00
Tony Levi 5bc1cf85db MDL-49395 accesslib: Make get_suspended_userids more efficient 2015-04-02 13:55:17 +10:30
Andrew Nicols 8f59956765 Merge branch 'MDL-49686-27' of git://github.com/merrill-oakland/moodle into MOODLE_27_STABLE
Conflicts:
	lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js
2015-04-01 18:48:10 +08:00
Andrew Nicols 56e611331e Merge branch 'wip-mdl-49513-m27' of https://github.com/rajeshtaneja/moodle into MOODLE_27_STABLE 2015-04-01 18:32:55 +08:00
Rajesh Taneja a1952e8f70 MDL-49513 behat: Set admin config using php api
Added a new set to set config using set_config() api
to make steps faster and more efficient
2015-04-01 14:31:01 +08:00
Andrew Nicols e9a4047b81 Merge branch 'MDL-49693-27' of git://github.com/merrill-oakland/moodle into MOODLE_27_STABLE
Conflicts:
	lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js
2015-04-01 12:39:04 +08:00
Tim Lock 0f8a6f5696 MDL-38210 report_participation: implement get view/post actions 2015-04-01 10:29:08 +10:30
Eloy Lafuente (stronk7) 08c50738b3 Merge branch 'wip-mdl-48605-m27' of https://github.com/rajeshtaneja/moodle into MOODLE_27_STABLE 2015-04-01 01:13:28 +02:00
Dan Poltawski 55588fd82e Merge branch 'MDL-49564-27' of git://github.com/merrill-oakland/moodle into MOODLE_27_STABLE
Conflicts:
	lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js
2015-03-31 19:35:47 +01:00
Dan Poltawski ab0fb67e46 Merge branch 'MDL-49666_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2015-03-31 19:18:11 +01:00
Tim Hunt 39cf27cf64 MDL-49666 qbehaviour_informationitem: respect $options->readonly 2015-03-31 15:18:58 +01:00
Dan Poltawski 453a4c9202 Merge branch 'MDL-49671-27' of git://github.com/merrill-oakland/moodle into MOODLE_27_STABLE 2015-03-31 15:11:08 +01:00
Rajesh Taneja 9070a896ae MDL-48605 unit_test: Only touch real file/dir 2015-03-31 21:46:49 +08:00
Dan Poltawski 2003c6ef66 Merge branch 'MDL-49547_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2015-03-31 14:44:10 +01:00
Dan Poltawski d77da9c15a Merge branch 'MDL-49645_m27' of git://github.com/markn86/moodle into MOODLE_27_STABLE 2015-03-31 13:28:22 +01:00
Dan Poltawski 0edc188114 Merge branch 'MDL-49641-get_external_files_m27' of https://github.com/jpahullo/moodle into MOODLE_27_STABLE 2015-03-31 13:15:10 +01:00
Dan Poltawski aa6b26be8c Merge branch 'MDL-49674-27-commentformat' of git://github.com/mudrd8mz/moodle into MOODLE_27_STABLE 2015-03-31 12:17:27 +01:00
Dan Poltawski 1cd346e6a7 Merge branch 'MDL-48880_27' of git://github.com/jmvedrine/moodle into MOODLE_27_STABLE 2015-03-31 11:19:24 +01:00
Dan Poltawski 2bce61f247 Merge branch 'm27_MDL-43818_Unable_Download_Package_Via_URL' of https://github.com/scara/moodle into MOODLE_27_STABLE 2015-03-31 09:27:56 +01:00
Andrew Nicols 85978ff0d1 Merge branch 'MDL-49695_m27' of git://github.com/markn86/moodle into MOODLE_27_STABLE 2015-03-31 15:15:48 +08:00
Rajesh Taneja f679a1e068 MDL-48605 unit_test: Fixed file_temp_cleanup_task
touch should only work on temp and below
dir's. With path we get temp/.. and temp/.
So we were modfying moodledata dir as well
and it was failing because of permission issues.
2015-03-31 14:57:40 +08:00
Andrew Nicols ca92a72426 MDL-49294 logging: Improve cleanup tests 2015-03-31 14:15:38 +08:00
Andrew Nicols cdca415c62 Merge branch 'log_cleanup_27' of https://github.com/tlevi/moodle into MOODLE_27_STABLE 2015-03-31 14:15:32 +08:00
Andrew Nicols 9225863595 MDL-49669 badges: Add comment to explain CURLOPT_POSTREDIR 2015-03-31 12:26:19 +08:00
Andrew Nicols ebfb2e51e3 Merge branch 'MDL-49669_27' of https://github.com/totara/openbadges into MOODLE_27_STABLE 2015-03-31 12:25:40 +08:00
Yuliya Bozhko 4659117d2e MDL-48205 badges: Get rid of ucfirst() and make modnames translatable
Signed-off-by: Yuliya Bozhko <yuliya.bozhko@totaralms.com>
2015-03-31 16:46:41 +13:00
David Monllao 877ea00888 Merge branch 'MDL-49114-27' of git://github.com/lameze/moodle into MOODLE_27_STABLE 2015-03-31 11:29:42 +08:00
Andrew Nicols f6267b1f20 Merge branch 'm27_MDL-46805' of https://github.com/danmarsden/moodle into MOODLE_27_STABLE 2015-03-31 08:18:36 +08:00
Dan Marsden 847de86adf MDL-46805 SCORM: AICC restricts allowed characters in the username 2015-03-31 10:41:27 +13:00
Matteo Scaramuccia 1d86f3c18e MDL-43818 SCORM: unable to download the Package via URL. 2015-03-30 20:40:21 +02:00
Eloy Lafuente (stronk7) c2217dea2c Merge branch 'wip-mdl-49708-m27' of https://github.com/rajeshtaneja/moodle into MOODLE_27_STABLE 2015-03-30 13:27:45 +02:00
Dan Poltawski f5afe1acb0 Merge branch 'wip-MDL-47337-m27' of git://github.com/marinaglancy/moodle into MOODLE_27_STABLE 2015-03-30 11:06:40 +01:00
Rajesh Taneja 1280d41691 MDL-49708 behat: Resize window back to default
Leaving window size to large fails in chrome
Reset it to default size works to ensure stamp
is visible by selenium driver
2015-03-30 17:30:32 +08:00
Rajesh Taneja 7c6628941b MDL-49708 behat: Fix chromedriver failure
Chromedriver tries to click in center of link
As these links wrap on next line it fails to
click on links on small screen
2015-03-30 12:36:33 +08:00
David Monllao 38ebaa270d Merge branch 'mdl36506-moodle27' of git://github.com/tlock/moodle into MOODLE_27_STABLE 2015-03-30 10:32:32 +08:00
Simey Lameze 22335cfd9d MDL-49114 environment: add slasharguments warning message 2015-03-30 10:17:55 +08:00
Jean-Michel Vedrine 7198eb72d9 MDL-48880 mod_lesson: clean lesson_branch on update and restore 2015-03-29 21:53:26 +02:00
Jean-Michel Vedrine b582e4b1f1 MDL-48880 mod_lesson: clean lesson_branch when a page is deleted 2015-03-29 21:53:26 +02:00
Mark Nelson ba8240b429 MDL-49695 tool_behat: fixed URL 2015-03-27 16:54:51 -07:00
Eric Merrill c25f161423 MDL-49693 atto: Clean textarea contents before inserting into editor 2015-03-27 12:27:35 -04:00
Eric Merrill 737df5ca1b MDL-49686 atto: Process style and class attributes in sub-functions
To ensure we only clean style and classes, first we select the inside
of those attributes and "replace" them with handler functions. Those
functions scan the actual attribute values for class or styles that
we want to exclude.

The first level regex has 3 groups. group1 selects everything in the
tag leading up to the attribute values, group2 has the attributes,
group3 has the trailing quote mark. We work on group2 then return
the combination of group1, group2, and group3.
2015-03-27 11:36:39 -04:00
Eric Merrill 0fddb5735c MDL-49671 atto: Any pastes that don't have html should clean everything
Browsers may not provide html content in the clipboard object event
though it will really be pasted as such. This includes Firefox on
Windows, Internet Explorer, and some niche cases in Safari.

Because of this, we need to scrub the entire editor anytime we can't
intercept a paste event.

In some magical day in the future when there is better cross browser
support, we can undo this.
2015-03-26 23:58:35 -04:00
Eric Merrill b365d5cc2d MDL-49564 atto: Improve empty span removal
Paste from MS word, followed by cleaning, may leave many many unused
spans. Try to remove them.
2015-03-26 23:09:33 -04:00
Marina Glancy c301086a1f MDL-47337 course: merge section options during restore 2015-03-27 08:49:58 +08:00
Mark Nelson 412b144b98 MDL-49645 core_backup: fixed 'expirythreshold' setting not being saved 2015-03-26 16:38:55 -07:00
Yuliya Bozhko 51a31cbec1 MDL-49669 badges: Handle curl redirects when posting to backpack
Signed-off-by: Yuliya Bozhko <yuliya.bozhko@totaralms.com>
2015-03-27 09:31:24 +13:00
Tim Hunt 3142069285 MDL-49547 question restore: avoid tag-related notices. 2015-03-26 15:30:08 +00:00
David Mudrák e34d82ac30 MDL-49674 comment: Use correct format when displaying the comment
The plugin callback executed above can eventually change the format. We
need to use that one to have the formatting of the first AJAX response
consistent with following displays.
2015-03-26 13:02:23 +01:00
Eloy Lafuente (stronk7) 0582523ced weekly release 2.7.7+ 2015-03-26 10:47:59 +01:00
Eloy Lafuente (stronk7) a1f4486b19 Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2015-03-26 10:47:53 +01:00
David Monllao 5aa2e6a6c8 MDL-47002 editor_atto: Remove all after html when pasting 2015-03-26 10:09:35 +01:00
David Monllao dd504eded3 MDL-47002 editor_atto: Clean the comments separately 2015-03-26 14:51:20 +08:00
Tony Levi 036c72ea8a MDL-49294 logging: Cleanup runs in smaller chunks
Just running a huge log cleanup will probably cause big problems on large sites.
So we break this down into smaller day-by-day chunks until reaching the target.
2015-03-26 12:02:08 +10:30
Eloy Lafuente (stronk7) 87f1d0aeab Merge branch 'MDL-47002-int-27' of git://github.com/merrill-oakland/moodle into MOODLE_27_STABLE 2015-03-25 18:23:13 +01:00
Eric Merrill 7cf70d686e MDL-47002 atto: Prevent removal of Rangy spans 2015-03-25 10:03:08 -04:00
Martin Mastny e532ca42e5 MDL-37984 portfolio: using older Google libraries 2015-03-25 17:22:31 +08:00
Eric Merrill 8885056125 MDL-47003 atto: Update behat test for copyright symbol 2015-03-25 15:21:12 +08:00
Jordi Pujol Ahulló 16d070960d MDL-49641 repository_dropbox: preventing poor performance.
get_external_files placed with second argument as '' to prevent poor performance.
2015-03-25 07:59:12 +01:00
Martin Mastny 6d20d0f39e MDL-37984 portfolio: Google drive using official client library 2015-03-25 12:40:43 +08:00
David Monllao e2ac2c6692 MDL-45619 repository: Don't allow repository_recent to be uninstalled
We have tests that depends on it and it
is a simple repo that can just be disabled.
2015-03-25 09:40:26 +08:00
David Monllao bcecb03bbf Merge branch 'MDL-45619_m27' of git://github.com/sbourget/moodle into MOODLE_27_STABLE 2015-03-25 09:40:13 +08:00
David Monllao 7a9544773f Merge branch 'MDL-49558_M27' of git://github.com/nadavkav/moodle into MOODLE_27_STABLE 2015-03-25 08:36:46 +08:00
Nadav Kavalerchik 225526cd29 MDL-49558 user grades: Fix range & percent grade display in RTL mode 2015-03-24 19:55:23 +02:00
Dan Poltawski 83bcf92ca4 Merge branch 'MDL-49354-27' of https://github.com/mtavella-netspot/moodle into MOODLE_27_STABLE 2015-03-24 15:14:12 +00:00
Dan Poltawski 1c21735b18 Merge branch 'MDL-48918-27' of git://github.com/andrewnicols/moodle into MOODLE_27_STABLE 2015-03-24 15:10:56 +00:00
Eloy Lafuente (stronk7) 32fae6b5e3 Merge branch 'MDL-48795_27' of https://github.com/apsdehal/moodle into MOODLE_27_STABLE 2015-03-24 15:45:11 +01:00
Dan Poltawski a45058e2a4 Merge branch 'wip-mdl-49374-m27' of https://github.com/rajeshtaneja/moodle into MOODLE_27_STABLE 2015-03-24 13:36:57 +00:00
Dan Poltawski 6eac74a233 Merge branch 'MDL-49070_scheduled_27' of https://github.com/andyjdavis/moodle into MOODLE_27_STABLE 2015-03-24 13:33:54 +00:00
Dan Poltawski a4546be3a8 Merge branch 'wip_MDL-49631_27_utfregex' of https://github.com/skodak/moodle into MOODLE_27_STABLE 2015-03-24 11:11:39 +00:00
Dan Poltawski a3aa563b60 Merge branch 'MDL-46746-27' of git://github.com/merrill-oakland/moodle into MOODLE_27_STABLE
Conflicts:
	lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js
2015-03-24 11:04:29 +00:00
Dan Poltawski 1fad87a81c Merge branch 'MDL-49565-27' of git://github.com/merrill-oakland/moodle into MOODLE_27_STABLE 2015-03-24 09:57:22 +00:00
Dan Poltawski 83190c6188 Merge branch 'wip_MDL-49327_2.7_guide_getinstance' of https://github.com/nixorv/moodle into MOODLE_27_STABLE
Conflicts:
	grade/grading/form/guide/tests/guide_test.php
2015-03-24 09:31:41 +00:00
David Monllao f33400b3a8 Merge branch 'MDL-49555-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2015-03-24 11:00:39 +08:00
David Monllao 299ea13687 Merge branch 'MDL-47003-27' of git://github.com/merrill-oakland/moodle into MOODLE_27_STABLE 2015-03-24 10:17:49 +08:00
Tim Lock 9ad24a034e MDL-36506 mod_book: Skip legacy files migration if missing a CM record 2015-03-24 12:47:48 +10:30
Mohamed Alsharaf 9c1a586e4c MDL-35482 lesson: return to previous page after edit and page save 2015-03-24 00:41:32 +01:00
Nikita Kalinin 82c8214fdd MDL-49327 marking guide: Added condition on definitionid. 2015-03-24 00:10:16 +03:00
AMOS bot 72ca43735f Automatically generated installer lang files 2015-03-24 00:06:36 +08:00
Dan Poltawski 7e39143012 Merge branch 'wip_MDL-49327_2.7_guide_getinstance' of https://github.com/nixorv/moodle into MOODLE_27_STABLE 2015-03-23 15:49:07 +00:00
Dan Poltawski 51b1d8cb99 Merge branch 'MDL-48443-27' of git://github.com/jleyva/moodle into MOODLE_27_STABLE 2015-03-23 15:04:00 +00:00
Dan Poltawski 061bfe9071 Merge branch 'wip-mdl-49432-m27' of https://github.com/rajeshtaneja/moodle into MOODLE_27_STABLE 2015-03-23 12:37:09 +00:00
Dan Poltawski 01cf3fc45e Merge branch 'MDL-48787-27' of https://github.com/pauln/moodle into MOODLE_27_STABLE 2015-03-23 11:58:12 +00:00
Dan Poltawski 194f690f1b Merge branch 'm27_MDL-48419' of https://github.com/danmarsden/moodle into MOODLE_27_STABLE 2015-03-23 11:17:15 +00:00
Dan Poltawski a1df482ac4 Merge branch 'MDL-21201-27-feedback_anon' of https://github.com/DSI-Universite-Rennes2/moodle into MOODLE_27_STABLE 2015-03-23 11:03:31 +00:00
David Monllao 55211a8d66 MDL-48456 course: Using default max int value 2015-03-23 15:18:27 +08:00
David Monllao 2608c20590 Merge branch 'MDL-48456-27' of git://github.com/dkns/moodle into MOODLE_27_STABLE 2015-03-23 15:18:20 +08:00
David Monllao aea1c25f07 Merge branch 'MDL-47002-27' of git://github.com/merrill-oakland/moodle into MOODLE_27_STABLE 2015-03-23 14:59:45 +08:00
Petr Skoda 36d5d6d51b MDL-49631 fix incorrect whitespace remplacements 2015-03-23 17:41:26 +13:00
AMOS bot ed18a447b1 Automatically generated installer lang files 2015-03-23 00:04:22 +08:00
Daniel Kosinski f70f73517c MDL-48456 course: increase timeout when deleting all courses in category 2015-03-22 16:25:00 +01:00
AMOS bot 5ffcd725ce Automatically generated installer lang files 2015-03-21 00:04:11 +08:00
Julien Boulen baf58176f0 MDL-21201 Feedback: hide anonymous responses in recent activity reports 2015-03-20 16:25:14 +01:00
Nikita Kalinin 1a27d1b1fa MDL-49327 marking guide: Added condition on definitionid. 2015-03-20 12:19:24 +03:00
Rajesh Taneja 5cc5164228 MDL-49374 behat: Get install or re-install error code after composer
After composer is installed make sure we just process only
install or re-install
2015-03-20 14:06:20 +08:00
Rajesh Taneja e4643add2f MDL-49432 behat: guzzle packages has been unified
Current version of goutte is pointing to old guzzle packages
guzzle/common, guzzle/stream, guzzle/parser and guzzle/http.
They have been unified to guzzlehttp/guzzle, so include it to
avoid using old packages
2015-03-20 12:18:05 +08:00
Eloy Lafuente (stronk7) bac2631892 weekly release 2.7.7+ 2015-03-19 12:42:05 +01:00
Eloy Lafuente (stronk7) cfc17e4d61 NOBUG: Fixed file access permissions 2015-03-19 12:42:05 +01:00
Marina Glancy f1a1e58f91 MDL-45619 repository: corrections to uninstall, display link 2015-03-18 13:46:01 -04:00
Stephen Bourget 86fdfa6e6e MDL-45619 Repository: Allow repositories to be uninstalled 2015-03-18 13:45:57 -04:00
Eric Merrill 5cb340368f MDL-49565 atto: Allow html comments in editor code 2015-03-18 12:29:47 -04:00
Eric Merrill 0a45b86dca MDL-46746 atto: Remove unnecessary filtering of unicode characters 2015-03-18 12:09:21 -04:00
Eric Merrill 111141b38a MDL-47003 atto: Make code cleanup more targeted
Apply different, stricter, code cleanup when we receive HTML (WYSIWYG)
paste events, but be more lax the rest of the time.

Also, update the regexes to be more targeted for specific code patterns
pasted from office packages.
2015-03-18 11:47:54 -04:00
Eric Merrill b199c83c3a MDL-47002 atto: Improve paste behaviour to ensure propper cleanup
Old code failed to clean the editor div which resulted in
undesirable code being being left in the div for editing. To properly
handel incoming code, we should try to intercept and clean before the
paste, or clean the entire editable div.
2015-03-18 09:30:57 -04:00
info@ewallah.net 1359e4db0b MDL-49555 enrol_paypal: Only display icon if method available 2015-03-18 14:23:14 +01:00
Juan Leyva 37dadfe23e MDL-48443 webservices: Prevent duplicated user devices 2015-03-18 11:45:54 +01:00
Dan Marsden 7df2c28ca4 MDL-48419 mod_scorm: Check net script too agressive
in some cases high latency and network issues result in longer
than 2 sec responses from a server, increase this to avoid
excessive warnings.
2015-03-18 20:04:38 +13:00
David Monllao cc2957a8b8 Revert "Merge branch 'MDL-49445_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE"
This reverts commit b8062ad45c, reversing
changes made to d856439a71.
2015-03-18 10:51:47 +08:00
Adam Olley 788ca28e2a MDL-48787 quiz: Fix css of random question on order and paging screen 2015-03-18 14:52:14 +13:00
Eloy Lafuente (stronk7) 4e47cc03ac Merge branch 'MDL-49296_m27v3' of https://github.com/sbourget/moodle into MOODLE_27_STABLE 2015-03-17 12:05:36 +01:00
Dan Poltawski 93971a7435 Merge branch 'MDL-49359_m27' of https://github.com/markn86/moodle into MOODLE_27_STABLE 2015-03-17 08:53:33 +00:00
Mark Nelson b71319ecff MDL-49359 install: warn against using MyISAM 2015-03-16 20:47:22 -07:00
Stephen Bourget 38335b585e MDL-49296 Lesson: Add titles to action links 2015-03-16 20:37:17 -04:00
Eloy Lafuente (stronk7) 883bf7b4ba Merge branch 'MDL-49389_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2015-03-17 00:30:00 +01:00
Mike Grant dad3040e87 MDL-49276 config-dist: Removed legacy config options
Both $CFG->logsql and $CFG->dblogerror had no use in moodle core
since ages ago (just the former had one use for nothing). Good time
to get rid of both as they are 100% misleading.
2015-03-16 23:43:38 +01:00
Dan Poltawski a264c46f06 Merge branch 'MDL-48965_27' of git://github.com/jmvedrine/moodle into MOODLE_27_STABLE 2015-03-16 21:05:59 +00:00
Dan Poltawski 2c4557c760 Merge branch 'wip-MDL-49267-m27' of git://github.com/marinaglancy/moodle into MOODLE_27_STABLE 2015-03-16 15:52:40 +00:00
Dan Poltawski d7bbbdcd39 Merge branch 'MDL-49104-27' of git://github.com/DanBennettUK/moodle into MOODLE_27_STABLE 2015-03-16 15:05:16 +00:00
Dan Poltawski e8c6bca2c8 Merge branch 'MDL-49187-27' of https://github.com/spvickers/moodle into MOODLE_27_STABLE 2015-03-16 14:48:11 +00:00
Dan Poltawski ce980d24f4 Merge branch 'MDL-49442-27' of git://github.com/jethac/moodle into MOODLE_27_STABLE 2015-03-16 13:31:09 +00:00
David Monllao b8062ad45c Merge branch 'MDL-49445_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2015-03-16 15:38:23 +08:00
David Monllao d856439a71 MDL-47712 question_multianswer: Concat as string 2015-03-16 13:51:31 +08:00
David Monllao cda5471399 Merge branch 'MDL-47712-m27-master' of git://github.com/dthies/moodle into MOODLE_27_STABLE 2015-03-16 10:33:52 +08:00
David Monllao 5dcc5dc2ba Merge branch 'm27_MDL-44548' of git://github.com/danmarsden/moodle into MOODLE_27_STABLE 2015-03-16 10:04:51 +08:00
David Monllao 1164d83897 Merge branch 'wip-MDL-47729-m27' of git://github.com/marinaglancy/moodle into MOODLE_27_STABLE 2015-03-16 09:50:43 +08:00
Dan Marsden 65c0f42251 MDL-44548 mod_scorm: force an external sync to check for updated files. 2015-03-16 09:03:29 +13:00
Daniel Thies 393f5575b0 MDL-47712 qtype_multianswer: Move mathjaxloader spans to outer question 2015-03-13 21:35:05 -05:00
Tim Hunt 41f5bf1300 MDL-49446 behat: should_not_be_visible steps were not working
I fixed all similar problems in this class, even ones where it did
actually work becuase the two exceptions were of different types.
This pattern seems to have been copied and pasted a lot in this class,
and I am sure that will happen again, so I did not want to leave any
dangerous potential examples around.
2015-03-13 14:21:19 +00:00
Tim Hunt 67f6370208 MDL-49445 behat: selectors should match the most specific tr or li
I also fixed the text rule, which already did this, to use the same
idiom. It is unnecessarily inefficient to count all the things and
compare to 0. Not exists should be faster.

Also, updated all the selectors here to consistently start relative to
the current node (.//, not //).
2015-03-13 14:21:11 +00:00
Tim Hunt 9b3049630d MDL-49389 blocklib: avoid notices when moving blocks to the bottom 2015-03-13 14:21:03 +00:00
Marina Glancy c957fdc649 MDL-47729 repository_filesystem: smarter sync of references
It was noticed that if file content was once imported the following
synchronisations do not discover the changes
2015-03-13 11:21:30 +08:00
David Monllao c228f82bbb weekly release 2.7.7+ 2015-03-13 10:27:32 +08:00
David Monllao a0f47922fc Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2015-03-13 10:27:30 +08:00
AMOS bot 784fe082be Automatically generated installer lang files 2015-03-12 00:04:11 +08:00
David Monllao e495eb5a52 Merge branch 'MDL-48897_27' of git://github.com/jmvedrine/moodle into MOODLE_27_STABLE 2015-03-11 08:52:47 +08:00
David Monllao 8c4d6cc3a7 Merge branch 'MDL-48858-27' of git://github.com/mastnym/moodle into MOODLE_27_STABLE 2015-03-11 08:47:30 +08:00
Tim Hunt 4aee467e1b MDL-49315 questions: unit tests for each behaviour type class 2015-03-11 08:28:28 +08:00
Dan Poltawski 1cdc355053 Merge branch 'wip_MDL-49074_M27' of git://github.com/gjb2048/moodle into MOODLE_27_STABLE 2015-03-10 11:51:47 +00:00
Dan Poltawski 3478cf2337 Merge branch 'wip-mdl-49402-m27' of https://github.com/rajeshtaneja/moodle into MOODLE_27_STABLE 2015-03-10 08:33:35 +00:00
Dan Poltawski cd5be28db8 Merge branch 'MDL-49376_27' of git://github.com/dmonllao/moodle into MOODLE_27_STABLE 2015-03-10 08:27:33 +00:00
David Monllao 928f68efc6 Merge branch 'MDL-49346-27' of git://github.com/jleyva/moodle into MOODLE_27_STABLE 2015-03-10 15:32:17 +08:00
David Monllao 69067fb44b Merge branch 'MDL-49351-27' of git://github.com/jleyva/moodle into MOODLE_27_STABLE 2015-03-10 15:21:39 +08:00
David Monllao 723e307909 Merge branch 'MDL-49366_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2015-03-10 14:42:08 +08:00
Jetha Chan d3c05d5bab MDL-49442 javascript: add handlebars hashtable to support get_string 2015-03-10 13:07:38 +08:00
David Monllao 28a33650aa Merge branch 'MDL-49107-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2015-03-10 11:43:41 +08:00
David Monllao 154356ede5 Merge branch 'MDL-49332-27' of git://github.com/merrill-oakland/moodle into MOODLE_27_STABLE 2015-03-10 10:43:23 +08:00
David Monllao 9de52c1c5b Merge branch 'MDL-48572_27' of git://github.com/rlorenzo/moodle into MOODLE_27_STABLE 2015-03-10 10:35:48 +08:00
David Monllao 8581b4aaa0 Merge branch 'MDL-39262_27' of git://github.com/jmvedrine/moodle into MOODLE_27_STABLE 2015-03-10 10:13:14 +08:00
Eloy Lafuente (stronk7) fad0937a82 Moodle release 2.7.7 2015-03-10 00:42:36 +01:00
Dan Bennett 5b1e0822ac MDL-49104 repository_s3: backport of MDL-43725 2015-03-09 16:13:52 +00:00
Eloy Lafuente (stronk7) c1106792b1 weekly release 2.7.6+ 2015-03-09 16:47:46 +01:00
Marina Glancy 44b789cc6d MDL-49418 core: partial revert of MDL-48804
this is a quick fix for the issue 'Course module with two or more availability restrictions is not accessible'
MDL-49434 is created to deal with the renderer access inside availability check
2015-03-09 11:32:19 +08:00
Jean-Michel Vedrine ffd413d436 MDL-39262 mod_lesson: disable shortforms in lesson question display
Conflicts:
	mod/lesson/pagetypes/shortanswer.php
2015-03-08 11:25:07 +01:00
Amanpreet Singh cbf87a42c8 MDL-48795 lang: Update message for nothingnew
In lang/en/moodle.php file
2015-03-08 10:05:53 +05:30
Jean-Michel Vedrine 52f5987d67 MDL-48897 mod_lesson: behat tests for pages edition
This is a backport of MDL-48675.
2015-03-07 22:16:49 +01:00
Jean-Michel Vedrine f911807a10 MDL-48897 mod_lesson: Error displayed while editing content page jumps
This change also fix MDL-32343 and MDL-31778 related to problems
when editing cluster pages.

This is a backport of MDL-48675.
2015-03-07 22:16:48 +01:00
Jean-Michel Vedrine 9ab0b3da2b MDL-48965 mod_lesson: avoid short answer question without any answers 2015-03-07 22:09:10 +01:00
spvickers 37a00d0eae MDL-49187 mod_lti: Fix tool config lookup
Changed code to look for a tool ID before then matching on the URL.
2015-03-06 20:57:05 -07:00
Juan Leyva 86b1847c71 MDL-49346 ratings: ratingarea should be a required parameter 2015-03-06 11:44:59 +01:00
Juan Leyva 5f6ae21a57 MDL-49351 ratings: Correct check of viewallratings permission 2015-03-06 11:43:00 +01:00
Marina Glancy 4a3d2cf9ff MDL-49267 mod_wiki: always apply filters to the wiki name 2015-03-06 13:58:15 +08:00
Andrew Nicols 4e482832b3 MDL-48918 course: Fix keyboard drag/drop after dropped resource 2015-03-06 12:38:42 +08:00
Rajesh Taneja 6af3c65f4f MDL-49402 behat: Fixed feature file with same scenario name
1. We should not have same scanrio name in 1 feature file
   As it doesn't explain what is being tested. So modified.
2. Removed empty line, to keep it consistnet with other features
2015-03-06 11:49:21 +08:00
David Monllao ef381fdae1 MDL-49376 behat: Fixing resize step regex 2015-03-06 11:00:12 +08:00
Rex Lorenzo 4e54faadc0 MDL-48572 gradereport_grader: Average wrong with suspended users 2015-03-05 11:38:53 -08:00
Eric Merrill 69031e3e1d MDL-49332 gradebook: Raise time limit if we get into regrade
Because all regrading should (and does) start from this point, it
is safe and best to call it just once, from this point.
2015-03-05 10:10:19 -05:00
Tim Hunt 002f6fe9c0 MDL-49366 questions: avoid PHP notices from bad pluginfile URLs 2015-03-05 12:14:46 +00:00
Gareth J Barnard 4ea8fc0a7e MDL-49074 themes: WOFF2 fonts are not supported. Backport of MDL-46728. 2015-03-03 10:43:18 +00:00
Adrian Greeve e1e21e55e6 MDL-48858 mod_data: Update to behat tests
A bulk delete of entries has been added to
the behat tests.
2015-03-03 11:27:35 +08:00
Matthew Tavella b4c0270557 MDL-49354 YUI: Remove event-autohide module from yui-moodlesimple rollup 2015-03-03 10:30:47 +10:30
Frederic Massart ac5e89c4f4 MDL-49107 atto_link: Insert link even when selection is empty 2015-02-25 16:37:38 +01:00
Andrew Davis a1d4beea54 MDL-49070 core_registration: improved site registration scheduled task 2015-02-18 09:42:11 +01:00
Andrew Davis 9f1149e66a MDL-48702 logs: switched retrieval to get_recordset_select() 2015-01-08 08:54:07 +01:00
585 changed files with 12426 additions and 4468 deletions
+2
View File
@@ -64,6 +64,8 @@ echo "<form id=\"authmenu\" method=\"post\" action=\"auth_config.php\">\n";
echo "<div>\n";
echo "<input type=\"hidden\" name=\"sesskey\" value=\"".sesskey()."\" />\n";
echo "<input type=\"hidden\" name=\"auth\" value=\"".$auth."\" />\n";
// HACK to prevent browsers from automatically inserting the user's password into the wrong fields.
echo prevent_form_autofill_password();
// auth plugin description
echo $OUTPUT->box_start();
+611
View File
@@ -1027,6 +1027,7 @@
<VENDOR name="oracle" version="10.2" />
</DATABASE>
<PHP version="5.4.4" level="required">
<RESTRICT function="restrict_php_version_7" message="unsupportedphpversion7" />
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
@@ -1134,6 +1135,21 @@
<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_libcurl_version" level="optional">
<FEEDBACK>
<ON_CHECK message="libcurlwarning" />
</FEEDBACK>
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
<MOODLE version="2.8" requires="2.2">
@@ -1150,6 +1166,7 @@
<VENDOR name="oracle" version="10.2" />
</DATABASE>
<PHP version="5.4.4" level="required">
<RESTRICT function="restrict_php_version_7" message="unsupportedphpversion7" />
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
@@ -1257,6 +1274,600 @@
<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_CHECKS>
</MOODLE>
<MOODLE version="2.9" requires="2.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.5.31" />
<VENDOR name="postgres" version="9.1" />
<VENDOR name="mssql" version="10.0" />
<VENDOR name="oracle" version="10.2" />
</DATABASE>
<PHP version="5.4.4" level="required">
<RESTRICT function="restrict_php_version_7" message="unsupportedphpversion7" />
</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="optional">
<FEEDBACK>
<ON_CHECK message="opensslrecommended" />
</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="intl" level="optional">
<FEEDBACK>
<ON_CHECK message="intlrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="json" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="hash" 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_libcurl_version" level="optional">
<FEEDBACK>
<ON_CHECK message="libcurlwarning" />
</FEEDBACK>
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
<MOODLE version="3.0" requires="2.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.5.31" />
<VENDOR name="postgres" version="9.1" />
<VENDOR name="mssql" version="10.0" />
<VENDOR name="oracle" version="10.2" />
</DATABASE>
<PHP version="5.4.4" level="required">
<RESTRICT function="restrict_php_version_71" message="unsupportedphpversion71" />
</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="optional">
<FEEDBACK>
<ON_CHECK message="opensslrecommended" />
</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="intl" level="optional">
<FEEDBACK>
<ON_CHECK message="intlrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="json" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="hash" 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_libcurl_version" level="optional">
<FEEDBACK>
<ON_CHECK message="libcurlwarning" />
</FEEDBACK>
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
<MOODLE version="3.1" requires="2.7">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mariadb" version="5.5.31" />
<VENDOR name="mysql" version="5.5.31" />
<VENDOR name="postgres" version="9.1" />
<VENDOR name="mssql" version="10.0" />
<VENDOR name="oracle" version="10.2" />
</DATABASE>
<PHP version="5.4.4" level="required">
<RESTRICT function="restrict_php_version_71" message="unsupportedphpversion71" />
</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="optional">
<FEEDBACK>
<ON_CHECK message="opensslrecommended" />
</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="optional">
<FEEDBACK>
<ON_CHECK message="intlrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="json" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="hash" 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_libcurl_version" level="optional">
<FEEDBACK>
<ON_CHECK message="libcurlwarning" />
</FEEDBACK>
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
<MOODLE version="3.2" requires="2.7">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mariadb" version="5.5.31" />
<VENDOR name="mysql" version="5.5.31" />
<VENDOR name="postgres" version="9.1" />
<VENDOR name="mssql" version="10.0" />
<VENDOR name="oracle" version="10.2" />
</DATABASE>
<PHP version="5.6.5" 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="optional">
<FEEDBACK>
<ON_CHECK message="opensslrecommended" />
</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="optional">
<FEEDBACK>
<ON_CHECK message="intlrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="json" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="hash" 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_CHECKS>
</MOODLE>
</COMPATIBILITY_MATRIX>
+21 -16
View File
@@ -561,31 +561,36 @@ $cronoverdue = ($lastcron < time() - 3600 * 24);
$dbproblems = $DB->diagnose();
$maintenancemode = !empty($CFG->maintenance_enabled);
// Available updates for Moodle core
// Available updates for Moodle core.
$updateschecker = \core\update\checker::instance();
$availableupdates = array();
$availableupdates['core'] = $updateschecker->get_update_info('core',
array('minmaturity' => $CFG->updateminmaturity, 'notifybuilds' => $CFG->updatenotifybuilds));
$availableupdatesfetch = null;
// Available updates for contributed plugins
$pluginman = core_plugin_manager::instance();
foreach ($pluginman->get_plugins() as $plugintype => $plugintypeinstances) {
foreach ($plugintypeinstances as $pluginname => $plugininfo) {
if (!empty($plugininfo->availableupdates)) {
foreach ($plugininfo->availableupdates as $pluginavailableupdate) {
if ($pluginavailableupdate->version > $plugininfo->versiondisk) {
if (!isset($availableupdates[$plugintype.'_'.$pluginname])) {
$availableupdates[$plugintype.'_'.$pluginname] = array();
if (empty($CFG->disableupdatenotifications)) {
// Only compute the update information when it is going to be displayed to the user.
$availableupdates['core'] = $updateschecker->get_update_info('core',
array('minmaturity' => $CFG->updateminmaturity, 'notifybuilds' => $CFG->updatenotifybuilds));
// Available updates for contributed plugins
$pluginman = core_plugin_manager::instance();
foreach ($pluginman->get_plugins() as $plugintype => $plugintypeinstances) {
foreach ($plugintypeinstances as $pluginname => $plugininfo) {
if (!empty($plugininfo->availableupdates)) {
foreach ($plugininfo->availableupdates as $pluginavailableupdate) {
if ($pluginavailableupdate->version > $plugininfo->versiondisk) {
if (!isset($availableupdates[$plugintype.'_'.$pluginname])) {
$availableupdates[$plugintype.'_'.$pluginname] = array();
}
$availableupdates[$plugintype.'_'.$pluginname][] = $pluginavailableupdate;
}
$availableupdates[$plugintype.'_'.$pluginname][] = $pluginavailableupdate;
}
}
}
}
}
// The timestamp of the most recent check for available updates
$availableupdatesfetch = $updateschecker->get_last_timefetched();
// The timestamp of the most recent check for available updates
$availableupdatesfetch = $updateschecker->get_last_timefetched();
}
$buggyiconvnomb = (!function_exists('mb_convert_encoding') and @iconv('UTF-8', 'UTF-8//IGNORE', '100'.chr(130).'€') !== '100€');
//check if the site is registered on Moodle.org
+1 -1
View File
@@ -65,7 +65,7 @@ if (!empty($registeredhub) and $registeredhub->token == $token) {
$registeredhub->hubname = $hubname;
$registrationmanager->update_registeredhub($registeredhub);
//display notficiation message
// Display notification message.
$notificationmessage = $OUTPUT->notification(
get_string('registrationconfirmedon', 'hub', $hublink), 'notifysuccess');
echo $notificationmessage;
+3 -3
View File
@@ -22,9 +22,9 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
* @copyright (C) 1999 onwards Martin Dougiamas http://dougiamas.com
*
* On this page the administrator selects which hub he wants to register,
* except for MOOCH. Admins can register with MOOCH with the top admin menu "Registration" link.
* On this page the administrator can also unregister from any hubs, including MOOCH.
* On this page the administrator selects which hub he wants to register (except for moodle.net)
* Admins can register with moodle.net via the site admin menu "Registration" link.
* On this page the administrator can also unregister from any hubs including moodle.net.
*/
require('../../config.php');
+28 -24
View File
@@ -53,32 +53,36 @@ class registration_manager {
public function cron() {
global $CFG;
if (extension_loaded('xmlrpc')) {
//check if the last registration cron update was less than a week ago
$lastcron = get_config('registration', 'crontime');
if ($lastcron === false or $lastcron < strtotime("-7 day")) { //set to a week, see MDL-23704
$function = 'hub_update_site_info';
require_once($CFG->dirroot . "/webservice/xmlrpc/lib.php");
//update all hub where the site is registered on
$hubs = $this->get_registered_on_hubs();
foreach ($hubs as $hub) {
//update the registration
$siteinfo = $this->get_site_info($hub->huburl);
$params = array('siteinfo' => $siteinfo);
$serverurl = $hub->huburl . "/local/hub/webservice/webservices.php";
$xmlrpcclient = new webservice_xmlrpc_client($serverurl, $hub->token);
try {
$result = $xmlrpcclient->call($function, $params);
mtrace(get_string('siteupdatedcron', 'hub', $hub->hubname));
} catch (Exception $e) {
$errorparam = new stdClass();
$errorparam->errormessage = $e->getMessage();
$errorparam->hubname = $hub->hubname;
mtrace(get_string('errorcron', 'hub', $errorparam));
}
}
set_config('crontime', time(), 'registration');
if ($lastcron > strtotime("-7 day")) { // Prevent this happening more than once a week.
return;
}
$function = 'hub_update_site_info';
require_once($CFG->dirroot . "/webservice/xmlrpc/lib.php");
// Update all hubs where the site is registered.
$hubs = $this->get_registered_on_hubs();
if (empty($hubs)) {
mtrace(get_string('registrationwarning', 'admin'));
}
foreach ($hubs as $hub) {
// Update the registration.
$siteinfo = $this->get_site_info($hub->huburl);
$params = array('siteinfo' => $siteinfo);
$serverurl = $hub->huburl . "/local/hub/webservice/webservices.php";
$xmlrpcclient = new webservice_xmlrpc_client($serverurl, $hub->token);
try {
$result = $xmlrpcclient->call($function, $params);
mtrace(get_string('siteupdatedcron', 'hub', $hub->hubname));
} catch (Exception $e) {
$errorparam = new stdClass();
$errorparam->errormessage = $e->getMessage();
$errorparam->hubname = $hub->hubname;
mtrace(get_string('errorcron', 'hub', $errorparam));
}
}
set_config('crontime', time(), 'registration');
} else {
mtrace(get_string('errorcronnoxmlrpc', 'hub'));
}
+9
View File
@@ -39,6 +39,8 @@ require_once($CFG->dirroot . '/' . $CFG->admin . '/registration/forms.php');
require_once($CFG->dirroot . '/webservice/lib.php');
require_once($CFG->dirroot . '/' . $CFG->admin . '/registration/lib.php');
require_sesskey();
$huburl = required_param('huburl', PARAM_URL);
$huburl = rtrim($huburl, "/");
@@ -177,6 +179,13 @@ if (!empty($error)) {
//some Moodle.org resitration explanation
if ($huburl == HUB_MOODLEORGHUBURL) {
if (!empty($registeredhub->token)) {
$registrationmessage = get_string('pleaserefreshregistration', 'admin');
} else {
$registrationmessage = get_string('registrationwarning', 'admin');
}
echo $OUTPUT->notification($registrationmessage);
echo $OUTPUT->heading(get_string('registerwithmoodleorg', 'admin'));
$renderer = $PAGE->get_renderer('core', 'register');
echo $renderer->moodleorg_registration_message();
+11 -6
View File
@@ -36,13 +36,18 @@ class core_register_renderer extends plugin_renderer_base {
* @return string
*/
public function moodleorg_registration_message() {
$moodleorgurl = html_writer::link('http://moodle.org', 'Moodle.org');
$moodleorgstatsurl = html_writer::link('http://moodle.org/stats', get_string('statsmoodleorg', 'admin'));
$moochurl = html_writer::link(HUB_MOODLEORGHUBURL, get_string('moodleorghubname', 'admin'));
$moodleorgregmsg = get_string('registermoodleorg', 'admin', $moodleorgurl);
$moodleorgstatslink = html_writer::link('http://moodle.net/stats',
get_string('statsmoodleorg', 'admin'),
array('target' => '_blank'));
$hublink = html_writer::link('https://moodle.net/mod/page/view.php?id=1',
get_string('moodleorghubname', 'admin'),
array('target' => '_blank'));
$moodleorgregmsg = get_string('registermoodleorg', 'admin', $hublink);
$items = array(get_string('registermoodleorgli1', 'admin'),
get_string('registermoodleorgli2', 'admin', $moodleorgstatsurl),
get_string('registermoodleorgli3', 'admin', $moochurl));
get_string('registermoodleorgli2', 'admin', $moodleorgstatslink));
$moodleorgregmsg .= html_writer::alist($items);
return $moodleorgregmsg;
}
+14 -4
View File
@@ -264,6 +264,7 @@ if (($action == 'edit') || ($action == 'new')) {
$strshow = get_string('on', 'repository');
$strhide = get_string('off', 'repository');
$strdelete = get_string('disabled', 'repository');
$struninstall = get_string('uninstallplugin', 'core_admin');
$actionchoicesforexisting = array(
'show' => $strshow,
@@ -286,9 +287,9 @@ if (($action == 'edit') || ($action == 'new')) {
// Table to list plug-ins
$table = new html_table();
$table->head = array(get_string('name'), get_string('isactive', 'repository'), get_string('order'), $settingsstr);
$table->head = array(get_string('name'), get_string('isactive', 'repository'), get_string('order'), $settingsstr, $struninstall);
$table->colclasses = array('leftalign', 'centeralign', 'centeralign', 'centeralign', 'centeralign');
$table->colclasses = array('leftalign', 'centeralign', 'centeralign', 'centeralign', 'centeralign', 'centeralign');
$table->id = 'repositoriessetting';
$table->data = array();
$table->attributes['class'] = 'admintable generaltable';
@@ -384,7 +385,12 @@ if (($action == 'edit') || ($action == 'new')) {
$updowncount++;
$table->data[] = array($i->get_readablename(), $OUTPUT->render($select), $updown, $settings);
$uninstall = '';
if ($uninstallurl = core_plugin_manager::instance()->get_uninstall_url('repository_' . $typename, 'manage')) {
$uninstall = html_writer::link($uninstallurl, $struninstall);
}
$table->data[] = array($i->get_readablename(), $OUTPUT->render($select), $updown, $settings, $uninstall);
if (!in_array($typename, $alreadyplugins)) {
$alreadyplugins[] = $typename;
@@ -400,7 +406,11 @@ if (($action == 'edit') || ($action == 'new')) {
if (!in_array($plugin, $alreadyplugins)) {
$select = new single_select(repository_action_url($plugin, 'repos'), 'action', $actionchoicesfornew, 'delete', null, 'applyto' . basename($plugin));
$select->set_label(get_string('action'), array('class' => 'accesshide'));
$table->data[] = array(get_string('pluginname', 'repository_'.$plugin), $OUTPUT->render($select), '', '');
$uninstall = '';
if ($uninstallurl = core_plugin_manager::instance()->get_uninstall_url('repository_' . $plugin, 'manage')) {
$uninstall = html_writer::link($uninstallurl, $struninstall);
}
$table->data[] = array(get_string('pluginname', 'repository_'.$plugin), $OUTPUT->render($select), '', '', $uninstall);
}
}
}
+2
View File
@@ -46,6 +46,8 @@ $resultshtml = admin_search_settings_html($query); // case insensitive search on
echo '<form action="' . $PAGE->url->out(true) . '" method="post" id="adminsettings">';
echo '<div>';
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
// HACK to prevent browsers from automatically inserting the user's password into the wrong fields.
echo prevent_form_autofill_password();
echo '</div>';
echo '<fieldset>';
echo '<div class="clearer"><!-- --></div>';
+4
View File
@@ -77,6 +77,8 @@ if (empty($SITE->fullname)) {
echo html_writer::input_hidden_params($PAGE->url);
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
echo '<input type="hidden" name="return" value="'.$return.'" />';
// HACK to prevent browsers from automatically inserting the user's password into the wrong fields.
echo prevent_form_autofill_password();
echo $settingspage->output_html();
@@ -119,6 +121,8 @@ if (empty($SITE->fullname)) {
echo html_writer::input_hidden_params($PAGE->url);
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
echo '<input type="hidden" name="return" value="'.$return.'" />';
// HACK to prevent browsers from automatically inserting the user's password into the wrong fields.
echo prevent_form_autofill_password();
echo $OUTPUT->heading($settingspage->visiblename);
echo $settingspage->output_html();
+6 -3
View File
@@ -27,9 +27,12 @@ if (isloggedin()) {
$primaryadminemail = NULL;
$primaryadminname = NULL;
}
$temp->add(new admin_setting_configtext('supportname', new lang_string('supportname', 'admin'), new lang_string('configsupportname', 'admin'), $primaryadminname, PARAM_NOTAGS));
$temp->add(new admin_setting_configtext('supportemail', new lang_string('supportemail', 'admin'), new lang_string('configsupportemail', 'admin'), $primaryadminemail, PARAM_NOTAGS));
$temp->add(new admin_setting_configtext('supportpage', new lang_string('supportpage', 'admin'), new lang_string('configsupportpage', 'admin'), '', PARAM_URL));
$temp->add(new admin_setting_configtext('supportname', new lang_string('supportname', 'admin'),
new lang_string('configsupportname', 'admin'), $primaryadminname, PARAM_NOTAGS));
$temp->add(new admin_setting_configtext('supportemail', new lang_string('supportemail', 'admin'),
new lang_string('configsupportemail', 'admin'), $primaryadminemail, PARAM_EMAIL));
$temp->add(new admin_setting_configtext('supportpage', new lang_string('supportpage', 'admin'),
new lang_string('configsupportpage', 'admin'), '', PARAM_URL));
$ADMIN->add('server', $temp);
+1 -1
View File
@@ -11,7 +11,7 @@ $hassiteconfig = has_capability('moodle/site:config', $systemcontext);
$ADMIN->add('root', new admin_externalpage('adminnotifications', new lang_string('notifications'), "$CFG->wwwroot/$CFG->admin/index.php"));
$ADMIN->add('root', new admin_externalpage('registrationmoodleorg', new lang_string('registration', 'admin'),
"$CFG->wwwroot/$CFG->admin/registration/register.php?huburl=" . HUB_MOODLEORGHUBURL . "&hubname=Moodle.org"));
"$CFG->wwwroot/$CFG->admin/registration/register.php?huburl=" . HUB_MOODLEORGHUBURL . "&hubname=Moodle.org&sesskey=" . sesskey()));
$ADMIN->add('root', new admin_externalpage('registrationhub', new lang_string('registerwith', 'hub'),
"$CFG->wwwroot/$CFG->admin/registration/register.php", 'moodle/site:config', true));
$ADMIN->add('root', new admin_externalpage('registrationhubs', new lang_string('hubs', 'admin'),
+24
View File
@@ -114,6 +114,30 @@ class behat_admin extends behat_base {
}
}
/**
* Sets the specified site settings. A table with | config | value | (optional)plugin | is expected.
*
* @Given /^the following config values are set as admin:$/
* @param TableNode $table
*/
public function the_following_config_values_are_set_as_admin(TableNode $table) {
if (!$data = $table->getRowsHash()) {
return;
}
foreach ($data as $config => $value) {
// Default plugin value is null.
$plugin = null;
if (is_array($value)) {
$plugin = $value[1];
$value = $value[0];
}
set_config($config, $value, $plugin);
}
}
/**
* Waits with the provided params if we are running a JS session.
*
+6 -6
View File
@@ -7,10 +7,10 @@ Feature: An administrator can filter user accounts by role, cohort and other pro
Background:
Given the following "users" exist:
| username | firstname | lastname | email | auth | confirmed |
| user1 | User | One | one@asd.com | manual | 0 |
| user2 | User | Two | two@asd.com | ldap | 1 |
| user3 | User | Three | three@asd.com | manual | 1 |
| user4 | User | Four | four@asd.com | ldap | 0 |
| user1 | User | One | one@example.com | manual | 0 |
| user2 | User | Two | two@example.com | ldap | 1 |
| user3 | User | Three | three@example.com | manual | 1 |
| user4 | User | Four | four@example.com | ldap | 0 |
And the following "cohorts" exist:
| name | idnumber |
| Cohort 1 | CH1 |
@@ -23,8 +23,8 @@ Feature: An administrator can filter user accounts by role, cohort and other pro
| user2 | C1 | student |
| user3 | C1 | student |
And I log in as "admin"
And I add "User Two (two@asd.com)" user to "CH1" cohort members
And I add "User Three (three@asd.com)" user to "CH1" cohort members
And I add "User Two (two@example.com)" user to "CH1" cohort members
And I add "User Three (three@example.com)" user to "CH1" cohort members
And I follow "Browse list of users"
@javascript
@@ -13,15 +13,13 @@ Feature: Set admin settings value
And I should not see "C_shortname Course fullname"
Scenario: set admin value with full name
Given I set the following administration settings values:
| Display extended course names | 1 |
When I press "Save changes"
Given the following config values are set as admin:
| courselistshortnames | 1 |
And I am on homepage
Then I should see "C_shortname Course fullname"
Scenario: set admin value with short name
Given I set the following administration settings values:
Given the following config values are set as admin:
| courselistshortnames | 1 |
When I press "Save changes"
And I am on homepage
Then I should see "C_shortname Course fullname"
+2 -2
View File
@@ -21,7 +21,7 @@ Feature: Upload users
And I should see "Tom"
And I should see "Jones"
And I should see "verysecret"
And I should see "jonest@someplace.edu"
And I should see "jonest@example.com"
And I should see "Reznor"
And I should see "course1"
And I should see "math102"
@@ -32,7 +32,7 @@ Feature: Upload users
And I follow "Browse list of users"
And I should see "Tom Jones"
And I should see "Trent Reznor"
And I should see "reznor@someplace.edu"
And I should see "reznor@example.com"
And I am on homepage
And I follow "Maths"
And I expand "Users" node
@@ -13,8 +13,8 @@ Feature: Manage availability conditions
Then I should not see "Availability restrictions"
# Enable it and check I can now see and click on it.
And I set the following administration settings values:
| Enable conditional access | 1 |
And the following config values are set as admin:
| enableavailability | 1 |
And I am on homepage
And I navigate to "Manage restrictions" node in "Site administration > Plugins > Availability restrictions"
@@ -28,9 +28,9 @@ Feature: Manage availability conditions
Given the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
And the following config values are set as admin:
| enableavailability | 1 |
And I log in as "admin"
And I set the following administration settings values:
| Enable conditional access | 1 |
And I am on homepage
When I navigate to "Manage restrictions" node in "Site administration > Plugins > Availability restrictions"
+8 -16
View File
@@ -44,13 +44,19 @@ require_once(__DIR__ . '/../../../../lib/behat/lib.php');
chdir(__DIR__);
$output = null;
exec("php util.php --diag", $output, $code);
// Ensure we have composer installed, before we install or re-install test site.
if ($code == BEHAT_EXITCODE_COMPOSER || $code == BEHAT_EXITCODE_INSTALL || $code == BEHAT_EXITCODE_REINSTALL) {
testing_update_composer_dependencies();
chdir(__DIR__);
exec("php util.php --diag", $output, $code);
}
if ($code == 0) {
echo "Behat test environment already installed\n";
} else if ($code == BEHAT_EXITCODE_INSTALL) {
testing_update_composer_dependencies();
// Behat and dependencies are installed and we need to install the test site.
chdir(__DIR__);
passthru("php util.php --install", $code);
@@ -60,8 +66,6 @@ if ($code == 0) {
} else if ($code == BEHAT_EXITCODE_REINSTALL) {
testing_update_composer_dependencies();
// Test site data is outdated.
chdir(__DIR__);
passthru("php util.php --drop", $code);
@@ -74,18 +78,6 @@ if ($code == 0) {
exit($code);
}
} else if ($code == BEHAT_EXITCODE_COMPOSER) {
// Missing Behat dependencies.
testing_update_composer_dependencies();
// Returning to admin/tool/behat/cli.
chdir(__DIR__);
passthru("php util.php --install", $code);
if ($code != 0) {
exit($code);
}
} else {
// Generic error, we just output it.
echo implode("\n", $output)."\n";
+1 -1
View File
@@ -165,7 +165,7 @@ class tool_behat_renderer extends plugin_renderer_base {
// Info.
$installurl = behat_command::DOCS_URL . '#Installation';
$installlink = html_writer::tag('a', $installurl, array('href' => $installurl, 'target' => '_blank'));
$writetestsurl = behat_command::DOCS_URL . '#Writting_features';
$writetestsurl = behat_command::DOCS_URL . '#Writing_features';
$writetestslink = html_writer::tag('a', $writetestsurl, array('href' => $writetestsurl, 'target' => '_blank'));
$writestepsurl = behat_command::DOCS_URL . '#Adding_steps_definitions';
$writestepslink = html_writer::tag('a', $writestepsurl, array('href' => $writestepsurl, 'target' => '_blank'));
@@ -69,8 +69,8 @@ Feature: Set up contextual data for tests
Scenario: Role overrides
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@asd.com |
| student1 | Student | 1 | student1@asd.com |
| teacher1 | Teacher | 1 | teacher1@example.com |
| student1 | Student | 1 | student1@example.com |
And the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
@@ -99,7 +99,7 @@ Feature: Set up contextual data for tests
Scenario: Add course enrolments
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | Student | 1 | student1@asd.com |
| student1 | Student | 1 | student1@example.com |
And the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
@@ -117,11 +117,11 @@ Feature: Set up contextual data for tests
| Custom student | custom2 | | |
And the following "users" exist:
| username | firstname | lastname | email |
| user1 | User | 1 | user1@moodlemoodle.com |
| user2 | User | 2 | user2@moodlemoodle.com |
| user3 | User | 3 | user3@moodlemoodle.com |
| user4 | User | 4 | user4@moodlemoodle.com |
| user5 | User | 5 | user5@moodlemoodle.com |
| user1 | User | 1 | user1@example.com |
| user2 | User | 2 | user2@example.com |
| user3 | User | 3 | user3@example.com |
| user4 | User | 4 | user4@example.com |
| user5 | User | 5 | user5@example.com |
And the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
@@ -219,8 +219,8 @@ Feature: Set up contextual data for tests
Scenario: Add relations between users and groups
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | Student | 1 | student1@asd.com |
| student2 | Student | 2 | student2@asd.com |
| student1 | Student | 1 | student1@example.com |
| student2 | Student | 2 | student2@example.com |
And the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
@@ -259,8 +259,8 @@ Feature: Set up contextual data for tests
| Cat 1 | 0 | CAT1 |
And the following "users" exist:
| username | firstname | lastname | email |
| student1 | Student | 1 | student1@asd.com |
| student2 | Student | 2 | student2@asd.com |
| student1 | Student | 1 | student1@example.com |
| student2 | Student | 2 | student2@example.com |
And the following "cohorts" exist:
| name | idnumber |
| System cohort A | CHSA |
@@ -7,7 +7,7 @@ Feature: Edit capabilities
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@asd.com |
| teacher1 | Teacher | 1 | teacher1@example.com |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
@@ -10,9 +10,9 @@ Feature: Verify that all form fields values can be get and set
| Course 1 | C1 | 0 |
And the following "users" exist:
| username | email | firstname | lastname |
| student1 | s1@asd.com | Student | 1 |
| student2 | s2@asd.com | Student | 2 |
| student3 | s3@asd.com | Student | 3 |
| student1 | s1@example.com | Student | 1 |
| student2 | s2@example.com | Student | 2 |
| student3 | s3@example.com | Student | 3 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
@@ -91,19 +91,24 @@ class store implements \tool_log\log\store, \core\log\sql_select_reader {
// Replace the query with hardcoded mappings required for core.
list($selectwhere, $params, $sort) = self::replace_sql_legacy($selectwhere, $params, $sort);
$events = array();
$records = array();
try {
$records = $DB->get_records_select('log', $selectwhere, $params, $sort, '*', $limitfrom, $limitnum);
// A custom report + on the fly SQL rewriting = a possible exception.
$records = $DB->get_recordset_select('log', $selectwhere, $params, $sort, '*', $limitfrom, $limitnum);
} catch (\moodle_exception $ex) {
debugging("error converting legacy event data " . $ex->getMessage() . $ex->debuginfo, DEBUG_DEVELOPER);
return array();
}
$events = array();
foreach ($records as $data) {
$events[$data->id] = \logstore_legacy\event\legacy_logged::restore_legacy($data);
}
$records->close();
return $events;
}
@@ -44,11 +44,26 @@ class cleanup_task extends \core\task\scheduled_task {
public function execute() {
global $CFG, $DB;
// Delete old logs to save space (this might need a timer to slow it down...).
if (!empty($CFG->loglifetime)) { // Value in days.
$loglifetime = time(0) - ($CFG->loglifetime * 3600 * 24);
$DB->delete_records_select("log", "time < ?", array($loglifetime));
mtrace(" Deleted old legacy log records");
if (empty($CFG->loglifetime)) {
return;
}
$loglifetime = time() - ($CFG->loglifetime * 3600 * 24); // Value in days.
$lifetimep = array($loglifetime);
$start = time();
while ($min = $DB->get_field_select("log", "MIN(time)", "time < ?", $lifetimep)) {
// Break this down into chunks to avoid transaction for too long and generally thrashing database.
// Experiments suggest deleting one day takes up to a few seconds; probably a reasonable chunk size usually.
// If the cleanup has just been enabled, it might take e.g a month to clean the years of logs.
$params = array(min($min + 3600 * 24, $loglifetime));
$DB->delete_records_select("log", "time < ?", $params);
if (time() > $start + 300) {
// Do not churn on log deletion for too long each run.
break;
}
}
mtrace(" Deleted old legacy log records");
}
}
@@ -273,4 +273,33 @@ class logstore_legacy_store_testcase extends advanced_testcase {
$this->assertContains($expectedreport, $reports);
}
}
/**
* Test that the legacy log cleanup works correctly.
*/
public function test_cleanup_task() {
global $DB;
$this->resetAfterTest();
// Create some records spread over various days; test multiple iterations in cleanup.
$record = (object) array('time' => time());
$DB->insert_record('log', $record);
$record->time -= 3600 * 24 * 30;
$DB->insert_record('log', $record);
$record->time -= 3600 * 24 * 30;
$DB->insert_record('log', $record);
$record->time -= 3600 * 24 * 30;
$DB->insert_record('log', $record);
$this->assertEquals(4, $DB->count_records('log'));
// Remove all logs before "today".
set_config('loglifetime', 1);
$this->expectOutputString(" Deleted old legacy log records\n");
$clean = new \logstore_legacy\task\cleanup_task();
$clean->execute();
$this->assertEquals(1, $DB->count_records('log'));
}
}
@@ -72,7 +72,7 @@ class store implements \tool_log\log\writer, \core\log\sql_internal_reader {
$sort = self::tweak_sort_by_id($sort);
$events = array();
$records = $DB->get_records_select('logstore_standard_log', $selectwhere, $params, $sort, '*', $limitfrom, $limitnum);
$records = $DB->get_recordset_select('logstore_standard_log', $selectwhere, $params, $sort, '*', $limitfrom, $limitnum);
foreach ($records as $data) {
$extra = array('origin' => $data->origin, 'ip' => $data->ip, 'realuserid' => $data->realuserid);
@@ -94,6 +94,8 @@ class store implements \tool_log\log\writer, \core\log\sql_internal_reader {
}
}
$records->close();
return $events;
}
@@ -43,12 +43,29 @@ class cleanup_task extends \core\task\scheduled_task {
*/
public function execute() {
global $DB;
$loglifetime = (int)get_config('logstore_standard', 'loglifetime');
if ($loglifetime > 0) {
$loglifetime = time() - ($loglifetime * 3600 * 24); // Value in days.
$DB->delete_records_select("logstore_standard_log", "timecreated < ?", array($loglifetime));
mtrace(" Deleted old log records from standard store.");
if (empty($loglifetime) || $loglifetime < 0) {
return;
}
$loglifetime = time() - ($loglifetime * 3600 * 24); // Value in days.
$lifetimep = array($loglifetime);
$start = time();
while ($min = $DB->get_field_select("logstore_standard_log", "MIN(timecreated)", "timecreated < ?", $lifetimep)) {
// Break this down into chunks to avoid transaction for too long and generally thrashing database.
// Experiments suggest deleting one day takes up to a few seconds; probably a reasonable chunk size usually.
// If the cleanup has just been enabled, it might take e.g a month to clean the years of logs.
$params = array(min($min + 3600 * 24, $loglifetime));
$DB->delete_records_select("logstore_standard_log", "timecreated < ?", $params);
if (time() > $start + 300) {
// Do not churn on log deletion for too long each run.
break;
}
}
mtrace(" Deleted old log records from standard store.");
}
}
@@ -218,4 +218,41 @@ class logstore_standard_store_testcase extends advanced_testcase {
$this->assertContains($expectedreport, $reports);
}
}
/**
* Test that the standard log cleanup works correctly.
*/
public function test_cleanup_task() {
global $DB;
$this->resetAfterTest();
// Create some records spread over various days; test multiple iterations in cleanup.
$ctx = context_course::instance(1);
$record = (object) array(
'edulevel' => 0,
'contextid' => $ctx->id,
'contextlevel' => $ctx->contextlevel,
'contextinstanceid' => $ctx->instanceid,
'userid' => 1,
'timecreated' => time(),
);
$DB->insert_record('logstore_standard_log', $record);
$record->timecreated -= 3600 * 24 * 30;
$DB->insert_record('logstore_standard_log', $record);
$record->timecreated -= 3600 * 24 * 30;
$DB->insert_record('logstore_standard_log', $record);
$record->timecreated -= 3600 * 24 * 30;
$DB->insert_record('logstore_standard_log', $record);
$this->assertEquals(4, $DB->count_records('logstore_standard_log'));
// Remove all logs before "today".
set_config('loglifetime', 1, 'logstore_standard');
$this->expectOutputString(" Deleted old log records from standard store.\n");
$clean = new \logstore_standard\task\cleanup_task();
$clean->execute();
$this->assertEquals(1, $DB->count_records('logstore_standard_log'));
}
}
+22 -18
View File
@@ -104,25 +104,29 @@ if ($execute = $options['execute']) {
$predbqueries = $DB->perf_get_queries();
$pretime = microtime(true);
mtrace("Scheduled task: " . $task->get_name());
// NOTE: it would be tricky to move this code to \core\task\manager class,
// because we want to do detailed error reporting.
$cronlockfactory = \core\lock\lock_config::get_lock_factory('cron');
if (!$cronlock = $cronlockfactory->get_lock('core_cron', 10)) {
mtrace('Cannot obtain cron lock');
exit(129);
}
if (!$lock = $cronlockfactory->get_lock('\\' . get_class($task), 10)) {
$cronlock->release();
mtrace('Cannot obtain task lock');
exit(130);
}
$task->set_lock($lock);
if (!$task->is_blocking()) {
$cronlock->release();
} else {
$task->set_cron_lock($cronlock);
}
try {
mtrace("Scheduled task: " . $task->get_name());
// NOTE: it would be tricky to move this code to \core\task\manager class,
// because we want to do detailed error reporting.
$cronlockfactory = \core\lock\lock_config::get_lock_factory('cron');
if (!$cronlock = $cronlockfactory->get_lock('core_cron', 10)) {
mtrace('Cannot obtain cron lock');
exit(129);
}
if (!$lock = $cronlockfactory->get_lock('\\' . get_class($task), 10)) {
mtrace('Cannot obtain task lock');
exit(130);
}
$task->set_lock($lock);
if (!$task->is_blocking()) {
$cronlock->release();
} else {
$task->set_cron_lock($cronlock);
}
get_mailer('buffer');
$task->execute();
if (isset($predbqueries)) {
+19 -2
View File
@@ -402,8 +402,14 @@ function uu_pre_process_custom_profile_data($data) {
function uu_check_custom_profile_data(&$data) {
global $CFG, $DB;
$noerror = true;
$testuserid = null;
// find custom profile fields and check if data needs to converted.
if (!empty($data['username'])) {
if (preg_match('/id=(.*)"/i', $data['username'], $result)) {
$testuserid = $result[1];
}
}
// Find custom profile fields and check if data needs to converted.
foreach ($data as $key => $value) {
if (preg_match('/^profile_field_/', $key)) {
$shortname = str_replace('profile_field_', '', $key);
@@ -417,9 +423,20 @@ function uu_check_custom_profile_data(&$data) {
$data['status'][] = get_string('invaliduserfield', 'error', $shortname);
$noerror = false;
}
// Check for duplicate value.
if (method_exists($formfield, 'edit_validate_field') ) {
$testuser = new stdClass();
$testuser->{$key} = $value;
$testuser->id = $testuserid;
$err = $formfield->edit_validate_field($testuser);
if (!empty($err[$key])) {
$data['status'][] = $err[$key].' ('.$key.')';
$noerror = false;
}
}
}
}
}
}
return $noerror;
}
}
+2
View File
@@ -63,6 +63,8 @@ echo '<form action="upgradesettings.php" method="post" id="adminsettings">';
echo '<div>';
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
echo '<input type="hidden" name="return" value="'.$return.'" />';
// HACK to prevent browsers from automatically inserting the user's password into the wrong fields.
echo prevent_form_autofill_password();
echo '<fieldset>';
echo '<div class="clearer"><!-- --></div>';
echo $newsettingshtml;
+28
View File
@@ -300,6 +300,7 @@ class auth_plugin_db extends auth_plugin_base {
$updateuser = new stdClass();
$updateuser->id = $user->id;
$updateuser->suspended = 1;
$updateuser = $this->clean_data($updateuser);
user_update_user($updateuser, false);
$trace->output(get_string('auth_dbsuspenduser', 'auth_db', array('name'=>$user->username, 'id'=>$user->id)), 1);
}
@@ -381,6 +382,7 @@ class auth_plugin_db extends auth_plugin_base {
foreach($add_users as $user) {
$username = $user;
if ($this->config->removeuser == AUTH_REMOVEUSER_SUSPEND) {
if ($old_user = $DB->get_record('user', array('username'=>$username, 'deleted'=>0, 'suspended'=>1, 'mnethostid'=>$CFG->mnet_localhost_id, 'auth'=>$this->authtype))) {
$DB->set_field('user', 'suspended', 0, array('id'=>$old_user->id));
$trace->output(get_string('auth_dbreviveduser', 'auth_db', array('name'=>$username, 'id'=>$old_user->id)), 1);
@@ -412,6 +414,7 @@ class auth_plugin_db extends auth_plugin_base {
$trace->output(get_string('auth_dbinsertuserduplicate', 'auth_db', array('username'=>$user->username, 'auth'=>$collision->auth)), 1);
continue;
}
$user = $this->clean_data($user);
try {
$id = $DB->insert_record ('user', $user); // it is truly a new user
@@ -553,6 +556,7 @@ class auth_plugin_db extends auth_plugin_base {
}
}
}
if ($updated) {
$DB->set_field('user', 'timemodified', time(), array('id'=>$userid));
@@ -870,6 +874,30 @@ class auth_plugin_db extends auth_plugin_base {
error_reporting($CFG->debug);
ob_end_flush();
}
/**
* Clean the user data that comes from an external database.
*
* @param array $user the user data to be validated against properties definition.
* @return stdClass $user the cleaned user data.
*/
public function clean_data($user) {
if (empty($user)) {
return $user;
}
foreach ($user as $field => $value) {
// Get the property parameter type and do the cleaning.
try {
$property = core_user::get_property_definition($field);
$user->$field = clean_param($value, $property['type']);
} catch (coding_exception $e) {
debugging("The property '$field' could not be cleaned.", DEBUG_DEVELOPER);
}
}
return $user;
}
}
+73
View File
@@ -374,4 +374,77 @@ class auth_db_testcase extends advanced_testcase {
$this->cleanup_auth_database();
}
/**
* Testing the clean_data() method.
*/
public function test_clean_data() {
global $DB;
$this->resetAfterTest(false);
$this->preventResetByRollback();
$this->init_auth_database();
$auth = get_auth_plugin('db');
$auth->db_init();
// Create users on external table.
$extdbuser1 = (object)array('name'=>'u1', 'pass'=>'heslo', 'email'=>'u1@example.com');
$extdbuser1->id = $DB->insert_record('auth_db_users', $extdbuser1);
// User with malicious data on the name.
$extdbuser2 = (object)array('name'=>'user<script>alert(1);</script>xss', 'pass'=>'heslo', 'email'=>'xssuser@example.com');
$extdbuser2->id = $DB->insert_record('auth_db_users', $extdbuser2);
$trace = new null_progress_trace();
// Let's test user sync make sure still works as expected..
$auth->sync_users($trace, true);
// Get the user on moodle user table.
$user2 = $DB->get_record('user', array('email'=> $extdbuser2->email, 'auth'=>'db'));
// The malicious code should be sanitized.
$this->assertEquals($user2->username, 'userscriptalert1scriptxss');
$this->assertNotEquals($user2->username, $extdbuser2->name);
// User with correct data, should be equal to external db.
$user1 = $DB->get_record('user', array('email'=> $extdbuser1->email, 'auth'=>'db'));
$this->assertEquals($extdbuser1->name, $user1->username);
$this->assertEquals($extdbuser1->email, $user1->email);
// Now, let's update the name.
$extdbuser2->name = 'user no xss anymore';
$DB->update_record('auth_db_users', $extdbuser2);
// Run sync again to update the user data.
$auth->sync_users($trace, true);
// The user information should be updated.
$user2 = $DB->get_record('user', array('username' => 'usernoxssanymore', 'auth' => 'db'));
// The spaces should be removed, as it's the username.
$this->assertEquals($user2->username, 'usernoxssanymore');
// Now let's test just the clean_data() method isolated.
// Testing PARAM_USERNAME, PARAM_NOTAGS, PARAM_RAW_TRIMMED and others.
$user3 = new stdClass();
$user3->firstname = 'John <script>alert(1)</script> Doe';
$user3->username = 'john%#&~%*_doe';
$user3->email = ' john@testing.com ';
$user3->deleted = 'no';
$user3->description = '<b>A description about myself.</b>';
$user3cleaned = $auth->clean_data($user3);
// Expected results.
$this->assertEquals($user3cleaned->firstname, 'John alert(1) Doe');
$this->assertEquals($user3cleaned->email, 'john@testing.com');
$this->assertEquals($user3cleaned->deleted, 0);
$this->assertEquals($user3->description, '<b>A description about myself.</b>');
$this->assertEquals($user3->username, 'john_doe');
// Try to clean an invalid property (fullname).
$user3->fullname = 'John Doe';
$auth->clean_data($user3);
$this->assertDebuggingCalled("The property 'fullname' could not be cleaned.");
$this->cleanup_auth_database();
}
}
+2 -2
View File
@@ -58,7 +58,7 @@ class auth_db_events_testcase extends advanced_testcase {
$user = new stdClass();
$user->name = 'mark';
$user->pass = 'password123';
$user->email = 'what@legend.com';
$user->email = 'what@example.com';
$user->id = $DB->insert_record('auth_db_users', $user);
// Run sync_users and capture the user_created event.
@@ -107,7 +107,7 @@ class auth_db_events_testcase extends advanced_testcase {
$user = new stdClass();
$user->name = 'mark';
$user->pass = 'password123';
$user->email = 'what@legend.com';
$user->email = 'what@example.com';
$user->id = $DB->insert_record('auth_db_users', $user);
// Set the config to remove the suspension on the user.
+4 -4
View File
@@ -139,12 +139,12 @@ class auth_plugin_email extends auth_plugin_base {
$user = get_complete_user_data('username', $username);
if (!empty($user)) {
if ($user->confirmed) {
return AUTH_CONFIRM_ALREADY;
} else if ($user->auth != $this->authtype) {
if ($user->auth != $this->authtype) {
return AUTH_CONFIRM_ERROR;
} else if ($user->secret == $confirmsecret && $user->confirmed) {
return AUTH_CONFIRM_ALREADY;
} else if ($user->secret == $confirmsecret) { // They have provided the secret key to get in
$DB->set_field("user", "confirmed", 1, array("id"=>$user->id));
if ($user->firstaccess == 0) {
+1 -1
View File
@@ -24,7 +24,7 @@
$string['auth_emaildescription'] = '<p>Email-based self-registration enables a user to create their own account via a \'Create new account\' button on the login page. The user then receives an email containing a secure link to a page where they can confirm their account. Future logins just check the username and password against the stored values in the Moodle database.</p><p>Note: In addition to enabling the plugin, email-based self-registration must also be selected from the self registration drop-down menu on the \'Manage authentication\' page.</p>';
$string['auth_emailnoemail'] = 'Tried to send you an email but failed!';
$string['auth_emailrecaptcha'] = 'Adds a visual/audio confirmation form element to the signup page for email self-registering users. This protects your site against spammers and contributes to a worthwhile cause. See http://www.google.com/recaptcha/learnmore for more details. <br /><em>PHP cURL extension is required.</em>';
$string['auth_emailrecaptcha'] = 'Adds a visual/audio confirmation form element to the sign-up page for email self-registering users. This protects your site against spammers and contributes to a worthwhile cause. See http://www.google.com/recaptcha for more details.';
$string['auth_emailrecaptcha_key'] = 'Enable reCAPTCHA element';
$string['auth_emailsettings'] = 'Settings';
$string['pluginname'] = 'Email-based self-registration';
+6 -5
View File
@@ -604,12 +604,12 @@ class auth_plugin_ldap extends auth_plugin_base {
$user = get_complete_user_data('username', $username);
if (!empty($user)) {
if ($user->confirmed) {
return AUTH_CONFIRM_ALREADY;
} else if ($user->auth != $this->authtype) {
if ($user->auth != $this->authtype) {
return AUTH_CONFIRM_ERROR;
} else if ($user->secret == $confirmsecret && $user->confirmed) {
return AUTH_CONFIRM_ALREADY;
} else if ($user->secret == $confirmsecret) { // They have provided the secret key to get in
if (!$this->user_activate($username)) {
return AUTH_CONFIRM_FAIL;
@@ -1653,7 +1653,8 @@ class auth_plugin_ldap extends auth_plugin_base {
$_SERVER['HTTP_REFERER'] != $CFG->wwwroot &&
$_SERVER['HTTP_REFERER'] != $CFG->wwwroot.'/' &&
$_SERVER['HTTP_REFERER'] != $CFG->httpswwwroot.'/login/' &&
$_SERVER['HTTP_REFERER'] != $CFG->httpswwwroot.'/login/index.php')
$_SERVER['HTTP_REFERER'] != $CFG->httpswwwroot.'/login/index.php' &&
clean_param($_SERVER['HTTP_REFERER'], PARAM_LOCALURL) != '')
? $_SERVER['HTTP_REFERER'] : NULL;
}
+1 -1
View File
@@ -296,7 +296,7 @@ class auth_ldap_plugin_testcase extends advanced_testcase {
'lastnamephonetic' => '最後のお名前のテスト一号',
'firstnamephonetic' => 'お名前のテスト一号',
'alternatename' => 'Alternate Name User Test 1',
'email' => 'usersignuptest1@email.com',
'email' => 'usersignuptest1@example.com',
'description' => 'This is a description for user 1',
'city' => 'Perth',
'country' => 'au',
+2 -2
View File
@@ -16,7 +16,7 @@ Feature: Authentication
Scenario: Log in as an existing admin user filling the form
Given the following "users" exist:
| username | password | firstname | lastname | email |
| testuser | testuser | Test | User | moodle@moodlemoodle.com |
| testuser | testuser | Test | User | moodle@example.com |
And I am on homepage
When I follow "Log in"
And I set the field "Username" to "testuser"
@@ -27,7 +27,7 @@ Feature: Authentication
Scenario: Log in as an unexisting user filling the form
Given the following "users" exist:
| username | password | firstname | lastname | email |
| testuser | testuser | Test | User | moodle@moodlemoodle.com |
| testuser | testuser | Test | User | moodle@example.com |
And I am on homepage
When I follow "Log in"
And I set the field "Username" to "testuser"
@@ -53,8 +53,8 @@ class condition extends \core_availability\condition {
*/
public function __construct($structure) {
// Get cmid.
if (isset($structure->cm) && is_int($structure->cm)) {
$this->cmid = $structure->cm;
if (isset($structure->cm) && is_number($structure->cm)) {
$this->cmid = (int)$structure->cm;
} else {
throw new \coding_exception('Missing or invalid ->cm for completion condition');
}
@@ -16,11 +16,9 @@ Feature: availability_completion
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "admin"
And I set the following administration settings values:
| Enable conditional access | 1 |
| Enable completion tracking | 1 |
And I log out
And the following config values are set as admin:
| enableavailability | 1 |
| enablecompletion | 1 |
@javascript
Scenario: Test condition
@@ -16,10 +16,8 @@ Feature: availability_date
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "admin"
And I set the following administration settings values:
| Enable conditional access | 1 |
And I log out
And the following config values are set as admin:
| enableavailability | 1 |
@javascript
Scenario: Test condition
@@ -10,16 +10,14 @@ Feature: availability_grade
| Course 1 | C1 | topics | 1 |
And the following "users" exist:
| username | email |
| teacher1 | t@example.org |
| student1 | s@example.org |
| teacher1 | t@example.com |
| student1 | s@example.com |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "admin"
And I set the following administration settings values:
| Enable conditional access | 1 |
And I log out
And the following config values are set as admin:
| enableavailability | 1 |
@javascript
Scenario: Test condition
@@ -60,8 +58,22 @@ Feature: availability_grade
And I set the field "Grade" to "A1"
And I click on "min" "checkbox" in the ".availability-item" "css_element"
And I set the field "Minimum grade percentage (inclusive)" to "50"
And I click on "max" "checkbox" in the ".availability-item" "css_element"
And I set the field "Maximum grade percentage (exclusive)" to "80"
And I press "Save and return to course"
# Check if disabling a part of the restriction is get saved.
And I open "P3" actions menu
And I click on "Edit settings" "link" in the "P3" activity
And I expand all fieldsets
And I click on "max" "checkbox" in the ".availability-item" "css_element"
And I press "Save and return to course"
And I open "P3" actions menu
And I click on "Edit settings" "link" in the "P3" activity
And I expand all fieldsets
And the field "Maximum grade percentage (exclusive)" matches value ""
And I follow "Course 1"
# Add a Page with a grade condition for 10%.
And I add a "Page" to section "4"
And I set the following fields to these values:
@@ -103,8 +115,8 @@ Feature: availability_grade
# Give the assignment 40%.
And I follow "A1"
And I follow "View/grade all submissions"
# Pick the grade link in the row that has s@example.org in it.
And I click on "//a[contains(@href, 'action=grade') and ancestor::tr/td[normalize-space(.) = 's@example.org']]/img" "xpath_element"
# Pick the grade link in the row that has s@example.com in it.
And I click on "//a[contains(@href, 'action=grade') and ancestor::tr/td[normalize-space(.) = 's@example.com']]/img" "xpath_element"
And I set the field "Grade out of 100" to "40"
And I click on "Save changes" "button"
@@ -95,6 +95,7 @@ M.availability_grade.form.getNode = function(json) {
root.delegate('click', function() {
updateCheckbox(this, true);
M.core_availability.form.update();
}, '.availability_grade input[type=checkbox]');
root.delegate('valuechange', function() {
@@ -1 +1 @@
YUI.add("moodle-availability_grade-form",function(e,t){M.availability_grade=M.availability_grade||{},M.availability_grade.form=e.Object(M.core_availability.plugin),M.availability_grade.form.grades=null,M.availability_grade.form.initInner=function(e){this.grades=e,this.nodesSoFar=0},M.availability_grade.form.getNode=function(t){this.nodesSoFar++;var n=M.str.availability_grade,r="<label>"+n.title+' <span class="availability-group">'+'<select name="id"><option value="0">'+M.str.moodle.choosedots+"</option>";for(var i=0;i<this.grades.length;i++){var s=this.grades[i];r+='<option value="'+s.id+'">'+s.name+"</option>"}r+='</select></span></label> <span class="availability-group"><label><input type="checkbox" name="min"/>'+n.option_min+'</label> <label><span class="accesshide">'+n.label_min+'</span><input type="text" name="minval" title="'+n.label_min+'"/></label>%</span>'+'<span class="availability-group">'+'<label><input type="checkbox" name="max"/>'+n.option_max+'</label> <label><span class="accesshide">'+n.label_max+'</span><input type="text" name="maxval" title="'+n.label_max+'"/></label>%</span>';var o=e.Node.create("<span>"+r+"</span>");t.id!==undefined&&o.one("select[name=id] > option[value="+t.id+"]")&&o.one("select[name=id]").set("value",""+t.id),t.min!==undefined&&(o.one("input[name=min]").set("checked",!0),o.one("input[name=minval]").set("value",t.min)),t.max!==undefined&&(o.one("input[name=max]").set("checked",!0),o.one("input[name=maxval]").set("value",t.max));var u=function(e,t){var n=e.ancestor("label").next("label").one("input"),r=e.get("checked");return n.set("disabled",!r),t&&r&&n.focus(),r};o.all("input[type=checkbox]").each(u);if(!M.availability_grade.form.addedEvents){M.availability_grade.form.addedEvents=!0;var a=e.one("#fitem_id_availabilityconditionsjson");a.delegate("change",function(){M.core_availability.form.update()},".availability_grade select[name=id]"),a.delegate("click",function(){u(this,!0)},".availability_grade input[type=checkbox]"),a.delegate("valuechange",function(){M.core_availability.form.update()},".availability_grade input[type=text]")}return o},M.availability_grade.form.fillValue=function(e,t){e.id=parseInt(t.one("select[name=id]").get("value"),10),t.one("input[name=min]").get("checked")&&(e.min=this.getValue("minval",t)),t.one("input[name=max]").get("checked")&&(e.max=this.getValue("maxval",t))},M.availability_grade.form.getValue=function(e,t){var n=t.one("input[name="+e+"]").get("value");if(!/^[0-9]+([.,][0-9]+)?$/.test(n))return n;var r=parseFloat(n.replace(",","."));return r<0||r>100?n:r},M.availability_grade.form.fillErrors=function(e,t){var n={};this.fillValue(n,t),n.id===0&&e.push("availability_grade:error_selectgradeid"),n.min!==undefined&&typeof n.min=="string"||n.max!==undefined&&typeof n.max=="string"?e.push("availability_grade:error_invalidnumber"):n.min!==undefined&&n.max!==undefined&&n.min>=n.max&&e.push("availability_grade:error_backwardrange")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
YUI.add("moodle-availability_grade-form",function(e,t){M.availability_grade=M.availability_grade||{},M.availability_grade.form=e.Object(M.core_availability.plugin),M.availability_grade.form.grades=null,M.availability_grade.form.initInner=function(e){this.grades=e,this.nodesSoFar=0},M.availability_grade.form.getNode=function(t){this.nodesSoFar++;var n=M.str.availability_grade,r="<label>"+n.title+' <span class="availability-group">'+'<select name="id"><option value="0">'+M.str.moodle.choosedots+"</option>";for(var i=0;i<this.grades.length;i++){var s=this.grades[i];r+='<option value="'+s.id+'">'+s.name+"</option>"}r+='</select></span></label> <span class="availability-group"><label><input type="checkbox" name="min"/>'+n.option_min+'</label> <label><span class="accesshide">'+n.label_min+'</span><input type="text" name="minval" title="'+n.label_min+'"/></label>%</span>'+'<span class="availability-group">'+'<label><input type="checkbox" name="max"/>'+n.option_max+'</label> <label><span class="accesshide">'+n.label_max+'</span><input type="text" name="maxval" title="'+n.label_max+'"/></label>%</span>';var o=e.Node.create("<span>"+r+"</span>");t.id!==undefined&&o.one("select[name=id] > option[value="+t.id+"]")&&o.one("select[name=id]").set("value",""+t.id),t.min!==undefined&&(o.one("input[name=min]").set("checked",!0),o.one("input[name=minval]").set("value",t.min)),t.max!==undefined&&(o.one("input[name=max]").set("checked",!0),o.one("input[name=maxval]").set("value",t.max));var u=function(e,t){var n=e.ancestor("label").next("label").one("input"),r=e.get("checked");return n.set("disabled",!r),t&&r&&n.focus(),r};o.all("input[type=checkbox]").each(u);if(!M.availability_grade.form.addedEvents){M.availability_grade.form.addedEvents=!0;var a=e.one("#fitem_id_availabilityconditionsjson");a.delegate("change",function(){M.core_availability.form.update()},".availability_grade select[name=id]"),a.delegate("click",function(){u(this,!0),M.core_availability.form.update()},".availability_grade input[type=checkbox]"),a.delegate("valuechange",function(){M.core_availability.form.update()},".availability_grade input[type=text]")}return o},M.availability_grade.form.fillValue=function(e,t){e.id=parseInt(t.one("select[name=id]").get("value"),10),t.one("input[name=min]").get("checked")&&(e.min=this.getValue("minval",t)),t.one("input[name=max]").get("checked")&&(e.max=this.getValue("maxval",t))},M.availability_grade.form.getValue=function(e,t){var n=t.one("input[name="+e+"]").get("value");if(!/^[0-9]+([.,][0-9]+)?$/.test(n))return n;var r=parseFloat(n.replace(",","."));return r<0||r>100?n:r},M.availability_grade.form.fillErrors=function(e,t){var n={};this.fillValue(n,t),n.id===0&&e.push("availability_grade:error_selectgradeid"),n.min!==undefined&&typeof n.min=="string"||n.max!==undefined&&typeof n.max=="string"?e.push("availability_grade:error_invalidnumber"):n.min!==undefined&&n.max!==undefined&&n.min>=n.max&&e.push("availability_grade:error_backwardrange")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
@@ -95,6 +95,7 @@ M.availability_grade.form.getNode = function(json) {
root.delegate('click', function() {
updateCheckbox(this, true);
M.core_availability.form.update();
}, '.availability_grade input[type=checkbox]');
root.delegate('valuechange', function() {
+1
View File
@@ -93,6 +93,7 @@ M.availability_grade.form.getNode = function(json) {
root.delegate('click', function() {
updateCheckbox(this, true);
M.core_availability.form.update();
}, '.availability_grade input[type=checkbox]');
root.delegate('valuechange', function() {
@@ -16,10 +16,8 @@ Feature: availability_group
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "admin"
And I set the following administration settings values:
| Enable conditional access | 1 |
And I log out
And the following config values are set as admin:
| enableavailability | 1 |
@javascript
Scenario: Test condition
@@ -22,10 +22,8 @@ Feature: availability_grouping
And the following "group members" exist:
| user | group |
| student1 | GI1 |
And I log in as "admin"
And I set the following administration settings values:
| Enable conditional access | 1 |
And I log out
And the following config values are set as admin:
| enableavailability | 1 |
@javascript
Scenario: Test condition
@@ -10,16 +10,14 @@ Feature: availability_profile
| Course 1 | C1 | topics | 1 |
And the following "users" exist:
| username | email |
| teacher1 | t@example.org |
| student1 | s@example.org |
| teacher1 | t@example.com |
| student1 | s@example.com |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "admin"
And I set the following administration settings values:
| Enable conditional access | 1 |
And I log out
And the following config values are set as admin:
| enableavailability | 1 |
@javascript
Scenario: Test condition
@@ -38,7 +36,7 @@ Feature: availability_profile
And I click on "Add restriction..." "button"
And I click on "User profile" "button"
And I set the field "User profile field" to "Email address"
And I set the field "Value to compare against" to "s@example.org"
And I set the field "Value to compare against" to "s@example.com"
And I click on ".availability-item .availability-eye img" "css_element"
And I click on "Save and return to course" "button"
@@ -52,7 +50,7 @@ Feature: availability_profile
And I click on "Add restriction..." "button"
And I click on "User profile" "button"
And I set the field "User profile field" to "Email address"
And I set the field "Value to compare against" to "q@example.org"
And I set the field "Value to compare against" to "q@example.com"
And I click on ".availability-item .availability-eye img" "css_element"
And I click on "Save and return to course" "button"
@@ -78,7 +76,7 @@ Feature: availability_profile
# Set field value for user.
And I navigate to "Browse list of users" node in "Site administration > Users > Accounts"
And I click on "a[title=Edit]" "css_element" in the "s@example.org" "table_row"
And I click on "a[title=Edit]" "css_element" in the "s@example.com" "table_row"
And I expand all fieldsets
And I set the field "Super field" to "Bananaman"
And I click on "Update profile" "button"
@@ -34,10 +34,8 @@ Feature: display_availability
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "admin"
And I set the following administration settings values:
| Enable conditional access | 1 |
And I log out
And the following config values are set as admin:
| enableavailability | 1 |
@javascript
Scenario: Activity availability display
@@ -76,7 +74,7 @@ Feature: display_availability
And I press "Add restriction..."
And I click on "User profile" "button" in the "Add restriction..." "dialogue"
And I set the field "User profile field" to "Email address"
And I set the field "Value to compare against" to "email@example.org"
And I set the field "Value to compare against" to "email@example.com"
And I set the field "Method of comparison" to "is equal to"
And I press "Save and return to course"
@@ -39,15 +39,10 @@ Feature: edit_availability
When I edit the section "1"
Then "Restrict access" "fieldset" should not exist
When I log out
And I log in as "admin"
And I set the following administration settings values:
| Enable conditional access | 1 |
And the following config values are set as admin:
| enableavailability | 1 |
When I log out
And I log in as "teacher1"
And I follow "Course 1"
And I turn editing mode on
And I add a "Page" to section "1"
Then "Restrict access" "fieldset" should exist
@@ -58,10 +53,8 @@ Feature: edit_availability
@javascript
Scenario: Edit availability using settings in activity form
# Set up.
Given I log in as "admin"
And I set the following administration settings values:
| Enable conditional access | 1 |
And I log out
Given the following config values are set as admin:
| enableavailability | 1 |
And I log in as "teacher1"
And I follow "Course 1"
@@ -153,10 +146,8 @@ Feature: edit_availability
@javascript
Scenario: Edit availability using settings in section form
# Set up.
Given I log in as "admin"
And I set the following administration settings values:
| Enable conditional access | 1 |
And I log out
Given the following config values are set as admin:
| enableavailability | 1 |
And I log in as "teacher1"
And I follow "Course 1"
And I turn editing mode on
@@ -172,3 +163,4 @@ Feature: edit_availability
And I should not see "None" in the "Restrict access" "fieldset"
And "Restriction type" "select" should be visible
And I should see "Date" in the "Restrict access" "fieldset"
+3 -3
View File
@@ -299,7 +299,7 @@
<IDNUMBER>891220979</IDNUMBER>
<FIRSTNAME>Admin</FIRSTNAME>
<LASTNAME>User</LASTNAME>
<EMAIL>adamzap@gmail.com</EMAIL>
<EMAIL>adamzap@example.com</EMAIL>
<EMAILSTOP>0</EMAILSTOP>
<ICQ></ICQ>
<SKYPE></SKYPE>
@@ -368,7 +368,7 @@
<IDNUMBER>891111111</IDNUMBER>
<FIRSTNAME>Adam</FIRSTNAME>
<LASTNAME>Zapletal</LASTNAME>
<EMAIL>azaple1@lsu.edu</EMAIL>
<EMAIL>azaple1@example.com</EMAIL>
<EMAILSTOP>0</EMAILSTOP>
<ICQ></ICQ>
<SKYPE></SKYPE>
@@ -481,7 +481,7 @@
<IDNUMBER></IDNUMBER>
<FIRSTNAME>Philip</FIRSTNAME>
<LASTNAME>Cali</LASTNAME>
<EMAIL>pcali1@lsu.edu</EMAIL>
<EMAIL>pcali1@example.com</EMAIL>
<EMAILSTOP>0</EMAILSTOP>
<ICQ></ICQ>
<SKYPE></SKYPE>
+1 -1
View File
@@ -516,7 +516,7 @@ class backup_enrolments_structure_step extends backup_structure_step {
$enrol = new backup_nested_element('enrol', array('id'), array(
'enrol', 'status', 'name', 'enrolperiod', 'enrolstartdate',
'enrolenddate', 'expirynotify', 'expirytreshold', 'notifyall',
'enrolenddate', 'expirynotify', 'expirythreshold', 'notifyall',
'password', 'cost', 'currency', 'roleid',
'customint1', 'customint2', 'customint3', 'customint4', 'customint5', 'customint6', 'customint7', 'customint8',
'customchar1', 'customchar2', 'customchar3',
+76 -21
View File
@@ -1386,13 +1386,31 @@ class restore_section_structure_step extends restore_structure_step {
public function process_course_format_options($data) {
global $DB;
$data = (object)$data;
$oldid = $data->id;
unset($data->id);
$data->sectionid = $this->task->get_sectionid();
$data->courseid = $this->get_courseid();
$newid = $DB->insert_record('course_format_options', $data);
$this->set_mapping('course_format_options', $oldid, $newid);
static $courseformats = array();
$courseid = $this->get_courseid();
if (!array_key_exists($courseid, $courseformats)) {
// It is safe to have a static cache of course formats because format can not be changed after this point.
$courseformats[$courseid] = $DB->get_field('course', 'format', array('id' => $courseid));
}
$data = (array)$data;
if ($courseformats[$courseid] === $data['format']) {
// Import section format options only if both courses (the one that was backed up
// and the one we are restoring into) have same formats.
$params = array(
'courseid' => $this->get_courseid(),
'sectionid' => $this->task->get_sectionid(),
'format' => $data['format'],
'name' => $data['name']
);
if ($record = $DB->get_record('course_format_options', $params, 'id, value')) {
// Do not overwrite existing information.
$newid = $record->id;
} else {
$params['value'] = $data['value'];
$newid = $DB->insert_record('course_format_options', $params);
}
$this->set_mapping('course_format_options', $data['id'], $newid);
}
}
protected function after_execute() {
@@ -1460,27 +1478,54 @@ class restore_course_structure_step extends restore_structure_step {
*/
public function process_course($data) {
global $CFG, $DB;
$context = context::instance_by_id($this->task->get_contextid());
$userid = $this->task->get_userid();
$target = $this->get_task()->get_target();
$isnewcourse = $target != backup::TARGET_CURRENT_ADDING && $target != backup::TARGET_EXISTING_ADDING;
// When restoring to a new course we can set all the things except for the ID number.
$canchangeidnumber = $isnewcourse || has_capability('moodle/course:changeidnumber', $context, $userid);
$canchangeshortname = $isnewcourse || has_capability('moodle/course:changeshortname', $context, $userid);
$canchangefullname = $isnewcourse || has_capability('moodle/course:changefullname', $context, $userid);
$canchangesummary = $isnewcourse || has_capability('moodle/course:changesummary', $context, $userid);
$data = (object)$data;
$data->id = $this->get_courseid();
$fullname = $this->get_setting_value('course_fullname');
$shortname = $this->get_setting_value('course_shortname');
$startdate = $this->get_setting_value('course_startdate');
// Calculate final course names, to avoid dupes
// Calculate final course names, to avoid dupes.
list($fullname, $shortname) = restore_dbops::calculate_course_names($this->get_courseid(), $fullname, $shortname);
// Need to change some fields before updating the course record
$data->id = $this->get_courseid();
$data->fullname = $fullname;
$data->shortname= $shortname;
if ($canchangefullname) {
$data->fullname = $fullname;
} else {
unset($data->fullname);
}
if ($canchangeshortname) {
$data->shortname = $shortname;
} else {
unset($data->shortname);
}
if (!$canchangesummary) {
unset($data->summary);
unset($data->summaryformat);
}
// Only allow the idnumber to be set if the user has permission and the idnumber is not already in use by
// another course on this site.
$context = context::instance_by_id($this->task->get_contextid());
if (!empty($data->idnumber) && has_capability('moodle/course:changeidnumber', $context, $this->task->get_userid()) &&
$this->task->is_samesite() && !$DB->record_exists('course', array('idnumber' => $data->idnumber))) {
if (!empty($data->idnumber) && $canchangeidnumber && $this->task->is_samesite()
&& !$DB->record_exists('course', array('idnumber' => $data->idnumber))) {
// Do not reset idnumber.
} else if (!$isnewcourse) {
// Prevent override when restoring as merge.
unset($data->idnumber);
} else {
$data->idnumber = '';
}
@@ -2901,11 +2946,6 @@ class restore_activity_grades_structure_step extends restore_structure_step {
$oldparentid = $data->categoryid;
$courseid = $this->get_courseid();
// make sure top course category exists, all grade items will be associated
// to it. Later, if restoring the whole gradebook, categories will be introduced
$coursecat = grade_category::fetch_course_category($courseid);
$coursecatid = $coursecat->id; // Get the categoryid to be used
$idnumber = null;
if (!empty($data->idnumber)) {
// Don't get any idnumber from course module. Keep them as they are in grade_item->idnumber
@@ -2930,8 +2970,18 @@ class restore_activity_grades_structure_step extends restore_structure_step {
}
}
if (!empty($data->categoryid)) {
// If the grade category id of the grade item being restored belongs to this course
// then it is a fair assumption that this is the correct grade category for the activity
// and we should leave it in place, if not then unset it.
// TODO MDL-34790 Gradebook does not import if target course has gradebook categories.
$conditions = array('id' => $data->categoryid, 'courseid' => $courseid);
if (!$this->task->is_samesite() || !$DB->record_exists('grade_categories', $conditions)) {
unset($data->categoryid);
}
}
unset($data->id);
$data->categoryid = $coursecatid;
$data->courseid = $this->get_courseid();
$data->iteminstance = $this->task->get_activityid();
$data->idnumber = $idnumber;
@@ -3688,6 +3738,11 @@ class restore_create_categories_and_questions extends restore_structure_step {
$data = (object)$data;
$newquestion = $this->get_new_parentid('question');
$questioncreated = (bool) $this->get_mappingid('question_created', $this->get_old_parentid('question'));
if (!$questioncreated) {
// This question already exists in the question bank. Nothing for us to do.
return;
}
if (!empty($CFG->usetags)) { // if enabled in server
// TODO: This is highly inefficient. Each time we add one tag
@@ -0,0 +1,237 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Tests for Moodle 2 format backup operation.
*
* @package core_backup
* @copyright 2014 Russell Smith
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
global $CFG;
require_once($CFG->dirroot . '/backup/util/includes/backup_includes.php');
require_once($CFG->dirroot . '/backup/util/includes/restore_includes.php');
require_once($CFG->dirroot . '/course/format/topics/lib.php');
require_once($CFG->libdir . '/completionlib.php');
/**
* Tests for Moodle 2 course format section_options backup operation.
*
* @package core_backup
* @copyright 2014 Russell Smith
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class core_backup_moodle2_course_format_testcase extends advanced_testcase {
/**
* Tidy up open files that may be left open.
*/
protected function tearDown() {
gc_collect_cycles();
}
/**
* Tests a backup and restore adds the required section option data
* when the same course format is used.
*/
public function test_course_format_options_restore() {
global $DB, $CFG;
$this->resetAfterTest(true);
$this->setAdminUser();
$CFG->enableavailability = true;
$CFG->enablecompletion = true;
// Create a course with some availability data set.
$generator = $this->getDataGenerator();
$course = $generator->create_course(
array('format' => 'test_cs_options', 'numsections' => 3,
'enablecompletion' => COMPLETION_ENABLED),
array('createsections' => true));
$courseobject = format_base::instance($course->id);
$section = $DB->get_record('course_sections',
array('course' => $course->id, 'section' => 1), '*', MUST_EXIST);
$data = array('id' => $section->id,
'numdaystocomplete' => 2);
$courseobject->update_section_format_options($data);
// Backup and restore it.
$this->backup_and_restore($course);
$sectionoptions = $courseobject->get_format_options(1);
$this->assertArrayHasKey('numdaystocomplete', $sectionoptions);
$this->assertEquals(2, $sectionoptions['numdaystocomplete']);
}
/**
* Tests an import into the same subject successfully
* restores the options without error.
*/
public function test_course_format_options_import_myself() {
global $DB, $CFG;
$this->resetAfterTest(true);
$this->setAdminUser();
$CFG->enableavailability = true;
$CFG->enablecompletion = true;
// Create a course with some availability data set.
$generator = $this->getDataGenerator();
$course = $generator->create_course(
array('format' => 'test_cs_options', 'numsections' => 3,
'enablecompletion' => COMPLETION_ENABLED),
array('createsections' => true));
$courseobject = format_base::instance($course->id);
$section = $DB->get_record('course_sections',
array('course' => $course->id, 'section' => 1), '*', MUST_EXIST);
$data = array('id' => $section->id,
'numdaystocomplete' => 2);
$courseobject->update_section_format_options($data);
$this->backup_and_restore($course, $course);
$sectionoptions = $courseobject->get_format_options(1);
$this->assertArrayHasKey('numdaystocomplete', $sectionoptions);
$this->assertArrayNotHasKey('secondparameter', $sectionoptions);
$this->assertEquals(2, $sectionoptions['numdaystocomplete']);
}
/**
* Tests that all section options are copied when the course format is changed.
* None of the data is copied.
*
* It is a future enhancement to copy;
* 1. Only the relevant options.
* 2. Only the data associated with relevant options.
*/
public function test_course_format_options_restore_new_format() {
global $DB, $CFG;
$this->resetAfterTest(true);
$this->setAdminUser();
$CFG->enableavailability = true;
$CFG->enablecompletion = true;
// Create a course with some availability data set.
$generator = $this->getDataGenerator();
$course = $generator->create_course(
array('format' => 'test_cs2_options', 'numsections' => 3,
'enablecompletion' => COMPLETION_ENABLED),
array('createsections' => true));
$newcourse = $generator->create_course(
array('format' => 'test_cs_options', 'numsections' => 3,
'enablecompletion' => COMPLETION_ENABLED),
array('createsections' => true));
$courseobject = format_base::instance($course->id);
$section = $DB->get_record('course_sections',
array('course' => $course->id, 'section' => 1), '*', MUST_EXIST);
$data = array('id' => $section->id,
'numdaystocomplete' => 2,
'secondparameter' => 8);
$courseobject->update_section_format_options($data);
// Backup and restore it.
$this->backup_and_restore($course, $newcourse);
$newcourseobject = format_base::instance($newcourse->id);
$sectionoptions = $newcourseobject->get_format_options(1);
$this->assertArrayHasKey('numdaystocomplete', $sectionoptions);
$this->assertArrayHasKey('secondparameter', $sectionoptions);
$this->assertEquals(0, $sectionoptions['numdaystocomplete']);
$this->assertEquals(0, $sectionoptions['secondparameter']);
}
/**
* Backs a course up and restores it.
*
* @param stdClass $srccourse Course object to backup
* @param stdClass $dstcourse Course object to restore into
* @return int ID of newly restored course
*/
protected function backup_and_restore($srccourse, $dstcourse = null) {
global $USER, $CFG;
// Turn off file logging, otherwise it can't delete the file (Windows).
$CFG->backup_file_logger_level = backup::LOG_NONE;
// Do backup with default settings. MODE_IMPORT means it will just
// create the directory and not zip it.
$bc = new backup_controller(backup::TYPE_1COURSE, $srccourse->id,
backup::FORMAT_MOODLE, backup::INTERACTIVE_NO, backup::MODE_IMPORT,
$USER->id);
$backupid = $bc->get_backupid();
$bc->execute_plan();
$bc->destroy();
// Do restore to new course with default settings.
if ($dstcourse !== null) {
$newcourseid = $dstcourse->id;
} else {
$newcourseid = restore_dbops::create_new_course(
$srccourse->fullname, $srccourse->shortname . '_2', $srccourse->category);
}
$rc = new restore_controller($backupid, $newcourseid,
backup::INTERACTIVE_NO, backup::MODE_GENERAL, $USER->id,
backup::TARGET_NEW_COURSE);
$this->assertTrue($rc->execute_precheck());
$rc->execute_plan();
$rc->destroy();
return $newcourseid;
}
}
/**
* Class format_test_cs_options
*
* Test course format that has 1 option.
*/
class format_test_cs_options extends format_topics {
public function section_format_options($foreditform = false) {
return array(
'numdaystocomplete' => array(
'type' => PARAM_INT,
'label' => 'Test days',
'element_type' => 'text',
'default' => 0,
),
);
}
}
/**
* Class format_test_cs2_options
*
* Test course format that has 2 options, 1 inherited.
*/
class format_test_cs2_options extends format_test_cs_options {
public function section_format_options($foreditform = false) {
return array(
'secondparameter' => array(
'type' => PARAM_INT,
'label' => 'Test Parmater',
'element_type' => 'text',
'default' => 0,
),
) + parent::section_format_options($foreditform);
}
}
@@ -11,7 +11,7 @@ Feature: Duplicate activities
| Course 1 | C1 | 0 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@asd.com |
| teacher1 | Teacher | 1 | teacher1@example.com |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
@@ -12,7 +12,7 @@ Feature: Import course's contents into another course
| Course 2 | C2 | 0 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@asd.com |
| teacher1 | Teacher | 1 | teacher1@example.com |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
@@ -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
@@ -43,6 +42,22 @@ abstract class grouped_parser_processor extends simplified_parser_processor {
protected $groupedpaths; // Paths we are requesting grouped
protected $currentdata; // Where we'll be acummulating data
// We create a array that stores each of the paths in a tree fashion
// like the filesystem. Each element stores all the child elements that are
// part of a full path that builds the grouped parent path we are storing.
// eg Array keys are stored as follows;
// root => a => b
// => b
// => c => d
// => e => f.
// Grouped paths here are; /a/b, /b, /c/d, /c/e/f.
// There are no nested parent paths, that is an enforced rule so
// we store an empty array to designate that the particular XML path element
// is in fact a grouped path.
// eg; $this->groupedparentprefixtree['a']['b'] = array();
/** @var array Search tree storing the grouped paths. */
protected $groupedparentprefixtree;
/**
* Keep cache of parent directory paths for XML parsing.
* @var array
@@ -78,6 +93,18 @@ abstract class grouped_parser_processor extends simplified_parser_processor {
throw new progressive_parser_exception('xml_grouped_child_found', $a);
}
$this->groupedpaths[$path] = true;
// We check earlier in the function if there is a parent that is above the path
// to be added so we can be sure no parent exists in the tree.
$patharray = explode('/', $path);
$currentpos = &$this->groupedparentprefixtree;
foreach ($patharray as $item) {
if (!isset($currentpos[$item])) {
$currentpos[$item] = array();
}
// Update the current array position using a reference to allow in-place updates to the array.
$currentpos = &$currentpos[$item];
}
}
parent::add_path($path);
}
@@ -162,13 +189,29 @@ abstract class grouped_parser_processor extends simplified_parser_processor {
* false if not
*/
protected function grouped_parent_exists($path) {
$parentpath = $this->get_parent_path($path);
while ($parentpath != '/') {
if ($this->path_is_grouped($parentpath)) {
return $parentpath;
// Search the tree structure to find out if one of the paths
// above the $path is a grouped path.
$patharray = explode('/', $this->get_parent_path($path));
$groupedpath = '';
$currentpos = &$this->groupedparentprefixtree;
foreach ($patharray as $item) {
// When the item isn't set in the array we know
// there is no parent grouped path.
if (!isset($currentpos[$item])) {
return false;
}
$parentpath = $this->get_parent_path($parentpath);
// When we aren't at the start of the path, continue to build
// a string representation of the path that is traversed. We will
// return the grouped path to the caller if we find one.
if ($item != '') {
$groupedpath .= '/'.$item;
}
if ($currentpos[$item] == array()) {
return $groupedpath;
}
$currentpos = &$currentpos[$item];
}
return false;
}
+2 -2
View File
@@ -87,7 +87,7 @@ class award_criteria_activity extends award_criteria {
if (!$mod) {
$str = $OUTPUT->error_text(get_string('error:nosuchmod', 'badges'));
} else {
$str = html_writer::tag('b', '"' . ucfirst($mod->modname) . ' - ' . $mod->name . '"');
$str = html_writer::tag('b', '"' . get_string('modulename', $mod->modname) . ' - ' . $mod->name . '"');
if (isset($p['bydate'])) {
$str .= get_string('criteria_descr_bydate', 'badges', userdate($p['bydate'], get_string('strftimedate', 'core_langconfig')));
}
@@ -142,7 +142,7 @@ class award_criteria_activity extends award_criteria {
}
$param = array('id' => $mod->id,
'checked' => $checked,
'name' => ucfirst($mod->modname) . ' - ' . $mod->name,
'name' => get_string('modulename', $mod->modname) . ' - ' . $mod->name,
'error' => false
);
+1 -1
View File
@@ -164,7 +164,7 @@ class award_criteria_courseset extends award_criteria {
$param = array(
'id' => $course->id,
'checked' => true,
'name' => ucfirst(format_string($course->fullname, true, array('context' => $coursecontext))),
'name' => format_string($course->fullname, true, array('context' => $coursecontext)),
'error' => false
);
+8 -6
View File
@@ -59,13 +59,15 @@ class OpenBadgesBackpackHandler {
break;
}
$curl->setHeader(array('Accept: application/json', 'Expect:'));
$options = array(
'FRESH_CONNECT' => true,
'RETURNTRANSFER' => true,
'FORBID_REUSE' => true,
'HEADER' => 0,
'HTTPHEADER' => array('Expect:'),
'CONNECTTIMEOUT' => 3,
'FRESH_CONNECT' => true,
'RETURNTRANSFER' => true,
'FORBID_REUSE' => true,
'HEADER' => 0,
'CONNECTTIMEOUT' => 3,
// Follow redirects with the same type of request when sent 301, or 302 redirects.
'CURLOPT_POSTREDIR' => 3
);
if ($action == 'user') {
+3 -1
View File
@@ -61,6 +61,8 @@ $PAGE->set_heading($badge->name);
$PAGE->set_title($badge->name);
$PAGE->navbar->add($badge->name);
require_capability('moodle/badges:viewbadges', $context);
echo $OUTPUT->header();
echo $OUTPUT->heading(print_badge_image($badge, $context, 'small') . ' ' . $badge->name);
@@ -75,4 +77,4 @@ echo $output->print_badge_status_box($badge);
$output->print_badge_tabs($badgeid, $context, 'overview');
echo $output->print_badge_overview($badge, $context);
echo $OUTPUT->footer();
echo $OUTPUT->footer();
+3 -3
View File
@@ -14,10 +14,10 @@ Feature: Add badges to the system
And I expand "Badges" node
And I follow "Badges settings"
And I set the field "Default badge issuer name" to "Test Badge Site"
And I set the field "Default badge issuer contact details" to "testuser@test-badge-site.com"
And I set the field "Default badge issuer contact details" to "testuser@example.com"
And I press "Save changes"
When I follow "Add a new badge"
Then the field "issuercontact" matches value "testuser@test-badge-site.com"
Then the field "issuercontact" matches value "testuser@example.com"
And the field "issuername" matches value "Test Badge Site"
@javascript
@@ -35,7 +35,7 @@ Feature: Add badges to the system
| Name | Test Badge |
| Description | Test badge description |
| issuername | Test Badge Site |
| issuercontact | testuser@test-badge-site.com |
| issuercontact | testuser@example.com |
And I upload "badges/tests/behat/badge.png" file to "Image" filemanager
When I press "Create badge"
Then I should see "Edit details"
+20 -26
View File
@@ -12,7 +12,7 @@ Feature: Award badges
| Name | Profile Badge |
| Description | Test badge description |
| issuername | Test Badge Site |
| issuercontact | testuser@test-badge-site.com |
| issuercontact | testuser@example.com |
And I upload "badges/tests/behat/badge.png" file to "Image" filemanager
And I press "Create badge"
And I set the field "type" to "Profile completion"
@@ -39,8 +39,8 @@ Feature: Award badges
Scenario: Award site badge
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher | teacher | 1 | teacher1@asd.com |
| student | student | 1 | student1@asd.com |
| teacher | teacher | 1 | teacher1@example.com |
| student | student | 1 | student1@example.com |
And I log in as "admin"
And I navigate to "Add a new badge" node in "Site administration > Badges"
And I set the following fields to these values:
@@ -56,9 +56,9 @@ Feature: Award badges
And I press "Continue"
And I follow "Recipients (0)"
And I press "Award badge"
And I set the field "potentialrecipients[]" to "teacher 1 (teacher1@asd.com)"
And I set the field "potentialrecipients[]" to "teacher 1 (teacher1@example.com)"
And I press "Award badge"
And I set the field "potentialrecipients[]" to "student 1 (student1@asd.com)"
And I set the field "potentialrecipients[]" to "student 1 (student1@example.com)"
And I press "Award badge"
When I follow "Site Badge"
Then I should see "Recipients (2)"
@@ -72,9 +72,9 @@ Feature: Award badges
Scenario: Award course badge
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@asd.com |
| student1 | Student | 1 | student1@asd.com |
| student2 | Student | 2 | student2@asd.com |
| teacher1 | Teacher | 1 | teacher1@example.com |
| student1 | Student | 1 | student1@example.com |
| student2 | Student | 2 | student2@example.com |
And the following "courses" exist:
| fullname | shortname | category | groupmode |
| Course 1 | C1 | 0 | 1 |
@@ -100,9 +100,9 @@ Feature: Award badges
And I press "Continue"
And I follow "Recipients (0)"
And I press "Award badge"
And I set the field "potentialrecipients[]" to "Student 2 (student2@asd.com)"
And I set the field "potentialrecipients[]" to "Student 2 (student2@example.com)"
And I press "Award badge"
And I set the field "potentialrecipients[]" to "Student 1 (student1@asd.com)"
And I set the field "potentialrecipients[]" to "Student 1 (student1@example.com)"
When I press "Award badge"
And I follow "Course Badge"
Then I should see "Recipients (2)"
@@ -120,16 +120,15 @@ Feature: Award badges
| Course 1 | C1 | 0 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | Frist | teacher1@asd.com |
| student1 | Student | First | student1@asd.com |
| teacher1 | Teacher | Frist | teacher1@example.com |
| student1 | Student | First | student1@example.com |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "admin"
And I set the following administration settings values:
| Enable completion tracking | 1 |
And I follow "Home"
And the following config values are set as admin:
| enablecompletion | 1 |
And I log in as "teacher1"
And I follow "Course 1"
And I follow "Edit settings"
And I set the following fields to these values:
@@ -139,8 +138,6 @@ Feature: Award badges
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment name |
| Description | Submit your online text |
And I log out
And I log in as "teacher1"
And I follow "Course 1"
And I click on "//span[text()='Badges']" "xpath_element" in the "Administration" "block"
And I follow "Add a new badge"
@@ -175,16 +172,15 @@ Feature: Award badges
| Course 1 | C1 | 0 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | Frist | teacher1@asd.com |
| student1 | Student | First | student1@asd.com |
| teacher1 | Teacher | Frist | teacher1@example.com |
| student1 | Student | First | student1@example.com |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "admin"
And I set the following administration settings values:
| Enable completion tracking | 1 |
And I follow "Home"
And the following config values are set as admin:
| enablecompletion | 1 |
And I log in as "teacher1"
And I follow "Course 1"
And I follow "Edit settings"
And I set the following fields to these values:
@@ -200,8 +196,6 @@ Feature: Award badges
And I click on "Condition: Activity completion" "link"
And I set the field "Assign - Test assignment name" to "1"
And I press "Save changes"
And I log out
And I log in as "teacher1"
And I follow "Course 1"
And I click on "//span[text()='Badges']" "xpath_element" in the "Administration" "block"
And I follow "Add a new badge"
+3 -1
View File
@@ -75,6 +75,8 @@ if ($type == BADGE_TYPE_SITE) {
$PAGE->set_heading($title);
}
require_capability('moodle/badges:viewbadges', $PAGE->context);
$PAGE->set_title($title);
$output = $PAGE->get_renderer('core', 'badges');
@@ -103,4 +105,4 @@ if ($totalcount) {
echo $output->notification(get_string('nobadges', 'badges'));
}
echo $output->footer();
echo $output->footer();
@@ -10,8 +10,8 @@ Feature: Add a comment to the comments block
| Course 1 | C1 | 0 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | Frist | teacher1@asd.com |
| student1 | Student | First | student1@asd.com |
| teacher1 | Teacher | Frist | teacher1@example.com |
| student1 | Student | First | student1@example.com |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
@@ -11,8 +11,8 @@ Feature: Delete comment block messages
| Course 1 | C1 | 0 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | First | teacher1@asd.com |
| student1 | Student | First | student1@asd.com |
| teacher1 | Teacher | First | teacher1@example.com |
| student1 | Student | First | student1@example.com |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
@@ -10,8 +10,8 @@ Feature: Course summary block used in a course
| Course 1 | C101 | Proved the course summary block works! |0 |
And the following "users" exist:
| username | firstname | lastname | email |
| student1 | Sam | Student | student1@asd.com |
| teacher1 | Teacher | One | teacher1@asd.com |
| student1 | Sam | Student | student1@example.com |
| teacher1 | Teacher | One | teacher1@example.com |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C101 | student |
@@ -10,8 +10,8 @@ Feature: Random glossary entry block is used in a course
| Course 1 | C1 |
And the following "users" exist:
| username | firstname | lastname | email |
| student1 | Sam1 | Student1 | student1@test.com |
| teacher1 | Terry1 | Teacher1 | teacher1@test.com |
| student1 | Sam1 | Student1 | student1@example.com |
| teacher1 | Terry1 | Teacher1 | teacher1@example.com |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
+2 -2
View File
@@ -7,8 +7,8 @@ Feature: HTML blocks in a course
Scenario: Adding HTML block in a course
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Terry1 | Teacher1 | teacher@asd.com |
| student1 | Sam1 | Student1 | student1@asd.com |
| teacher1 | Terry1 | Teacher1 | teacher@example.com |
| student1 | Sam1 | Student1 | student1@example.com |
And the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
+1 -1
View File
@@ -7,7 +7,7 @@ Feature: Login from a block
Background:
Given the following "users" exist:
| username | password | firstname | lastname | email |
| testuser | testpass | Test | User | student1@asd.com |
| testuser | testpass | Test | User | student1@example.com |
And I log in as "admin"
And I navigate to "Turn editing on" node in "Front page settings"
And I add the "Login" block
@@ -7,8 +7,8 @@ Feature: Expand the courses nodes within the navigation block
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@local.host |
| student1 | Student | 1 | student1@local.host |
| teacher1 | Teacher | 1 | teacher1@example.com |
| student1 | Student | 1 | student1@example.com |
And the following "categories" exist:
| name | category | idnumber | visible |
| cat1 | 0 | cat1 | 1 |
@@ -187,4 +187,4 @@ Feature: Expand the courses nodes within the navigation block
And navigation node "c1" should not be expandable
And navigation node "c2" should be expandable
And navigation node "c3" should not be expandable
And navigation node "c4" should not be expandable
And navigation node "c4" should not be expandable
@@ -7,7 +7,7 @@ Feature: View my courses in navigation block
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | Student | 1 | student1@asd.com |
| student1 | Student | 1 | student1@example.com |
And the following "categories" exist:
| name | category | idnumber |
| cat1 | 0 | cat1 |
@@ -29,13 +29,11 @@ Feature: View my courses in navigation block
| student1 | c1 | student |
| student1 | c31 | student |
| student1 | c331 | student |
And I log in as "admin"
@javascript
Scenario: The plain list of enrolled courses is shown
Given I set the following administration settings values:
| Show my course categories | 0 |
And I log out
Given the following config values are set as admin:
| navshowmycoursecategories | 0 |
And I log in as "student1"
When I follow "My home"
Then I should not see "cat1" in the "Navigation" "block"
@@ -49,9 +47,8 @@ Feature: View my courses in navigation block
@javascript
Scenario: The nested list of enrolled courses is shown
Given I set the following administration settings values:
| Show my course categories | 1 |
And I log out
Given the following config values are set as admin:
| navshowmycoursecategories | 1 |
And I log in as "student1"
When I follow "My home"
Then I should see "cat1" in the "Navigation" "block"
@@ -69,10 +66,9 @@ Feature: View my courses in navigation block
@javascript
Scenario: I can expand categories and courses as guest
Given I set the following administration settings values:
| Show my course categories | 1 |
| Show all courses | 1 |
And I log out
Given the following config values are set as admin:
| navshowmycoursecategories | 1 |
| navshowallcourses | 1 |
And I expand "Courses" node
And I should see "cat1" in the "Navigation" "block"
And I should see "cat2" in the "Navigation" "block"
@@ -8,7 +8,7 @@ Feature: Latest news block displays the course latest news
Scenario: Latest course news are displayed and can be configured
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@asd.com |
| teacher1 | Teacher | 1 | teacher1@example.com |
And I log in as "admin"
And I create a course with:
| Course full name | Course 1 |
@@ -10,7 +10,7 @@ Feature: People Block used in a course
| Course 1 | C101 | 0 |
And the following "users" exist:
| username | firstname | lastname | email |
| student1 | Sam | Student | student1@asd.com |
| student1 | Sam | Student | student1@example.com |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C101 | student |
@@ -7,7 +7,7 @@ Feature: People Block used on frontpage
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | Sam | Student | student1@asd.com |
| student1 | Sam | Student | student1@example.com |
And I log in as "admin"
And I navigate to "Turn editing on" node in "Front page settings"
And I add the "People" block
@@ -40,7 +40,7 @@ $string['config_show_best'] = 'How many of the highest grades should be shown (0
$string['config_show_worst'] = 'How many of the lowest grades should be shown (0 to disable)?';
$string['configuredtoshownothing'] = 'This block\'s configuration currently does not allow it to show any results. You may want to either configure it or hide it.';
$string['config_use_groups'] = 'Show groups instead of students (only if the quiz supports groups)?';
$string['error_emptyquizid'] = 'There is an error right now with this block: you need to select which quiz it should display results from.';
$string['error_emptyquizid'] = 'Please configure this block and select which quiz it should display results from.';
$string['error_emptyquizrecord'] = 'There is an error right now with this block: the selected quiz does not seem to exist in the database.';
$string['error_nogroupsexist'] = 'There is an error right now with this block: it is set to display grades in group mode, but the course has no defined groups.';
$string['pluginname'] = 'Quiz results';
@@ -10,11 +10,11 @@ Feature: View structural changes in recent activity block
| Course 1 | C1 | 0 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Terry1 | Teacher1 | teacher1@asd.com |
| assistant1 | Terry2 | Teacher2 | teacher2@asd.com |
| student1 | Sam1 | Student1 | student1@asd.com |
| student2 | Sam2 | Student2 | student2@asd.com |
| student3 | Sam3 | Student3 | student3@asd.com |
| teacher1 | Terry1 | Teacher1 | teacher1@example.com |
| assistant1 | Terry2 | Teacher2 | teacher2@example.com |
| student1 | Sam1 | Student1 | student1@example.com |
| student2 | Sam2 | Student2 | student2@example.com |
| student3 | Sam3 | Student3 | student3@example.com |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
@@ -46,10 +46,8 @@ Feature: View structural changes in recent activity block
| GG3 | G2 |
Scenario: Check that Added module information is displayed respecting view capability
Given I log in as "admin"
And I set the following administration settings values:
| Enable group members only | 1 |
And I log out
Given the following config values are set as admin:
| enablegroupmembersonly | 1 |
And I log in as "teacher1"
And I follow "Course 1"
And I turn editing mode on
+2 -2
View File
@@ -7,8 +7,8 @@ Feature: Add blocks
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | Student | 1 | student1@asd.com |
| student2 | Student | 2 | student2@asd.com |
| student1 | Student | 1 | student1@example.com |
| student2 | Student | 2 | student2@example.com |
And the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
@@ -10,7 +10,7 @@ Feature: Add and configure blocks throughout the site
| Course 1 | C1 | 0 |
And the following "users" exist:
| username | firstname | lastname | email |
| manager1 | Manager | 1 | manager1@asd.com |
| manager1 | Manager | 1 | manager1@example.com |
And the following "system role assigns" exist:
| user | course | role |
| manager1 | Acceptance test site | manager |
@@ -36,7 +36,7 @@ Feature: Add and configure blocks throughout the site
Scenario: My home does not allow assignation of roles on blocks
Given the following "users" exist:
| username | firstname | lastname | email |
| manager1 | Manager | 1 | manager1@asd.com |
| manager1 | Manager | 1 | manager1@example.com |
And I log in as "manager1"
And I click on "My home" "link" in the "Navigation" "block"
When I press "Customise this page"
+1 -1
View File
@@ -10,7 +10,7 @@ Feature: Block appearances
| Course 1 | C1 | 0 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | teacher | 1 | teacher1@asd.com |
| teacher1 | teacher | 1 | teacher1@example.com |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
@@ -7,7 +7,7 @@ Feature: Allowed blocks controls
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@asd.com |
| teacher1 | Teacher | 1 | teacher1@example.com |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
+2 -2
View File
@@ -7,8 +7,8 @@ Feature: Comment on a blog entry
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| testuser | Test | User | moodle@moodlemoodle.com |
| testuser2 | Test2 | User2 | moodle2@moodlemoodle.com |
| testuser | Test | User | moodle@example.com |
| testuser2 | Test2 | User2 | moodle2@example.com |
And I log in as "testuser"
And I am on homepage
And I expand "My profile" node
+10 -8
View File
@@ -173,6 +173,8 @@ class core_calendar_external extends external_api {
// Let us findout courses that we can return events from.
if (!$hassystemcap) {
$courses = enrol_get_my_courses('id');
$courses = array_keys($courses);
foreach ($params['events']['courseids'] as $id) {
try {
$context = context_course::instance($id);
@@ -221,21 +223,21 @@ class core_calendar_external extends external_api {
$funcparam['courses'][] = $SITE->id;
}
// Event list does not check visibility and permissions, we'll check that later.
$eventlist = calendar_get_events($params['options']['timestart'], $params['options']['timeend'], $funcparam['users'], $funcparam['groups'],
$funcparam['courses'], true, $params['options']['ignorehidden']);
// WS expects arrays.
$events = array();
foreach ($eventlist as $id => $event) {
$events[$id] = (array) $event;
}
// We need to get events asked for eventids.
$eventsbyid = calendar_get_events_by_id($params['events']['eventids']);
foreach ($eventsbyid as $eventid => $eventobj) {
if ($eventsbyid = calendar_get_events_by_id($params['events']['eventids'])) {
$eventlist += $eventsbyid;
}
foreach ($eventlist as $eventid => $eventobj) {
$event = (array) $eventobj;
if (isset($events[$eventid])) {
continue;
}
if ($hassystemcap) {
// User can see everything, no further check is needed.
$events[$eventid] = $event;
+2 -2
View File
@@ -2944,7 +2944,7 @@ function calendar_add_icalendar_event($event, $courseid, $subscriptionid, $timez
$name = $event->properties['SUMMARY'][0]->value;
$name = str_replace('\n', '<br />', $name);
$name = str_replace('\\', '', $name);
$name = preg_replace('/\s+/', ' ', $name);
$name = preg_replace('/\s+/u', ' ', $name);
$eventrecord = new stdClass;
$eventrecord->name = clean_param($name, PARAM_NOTAGS);
@@ -2956,7 +2956,7 @@ function calendar_add_icalendar_event($event, $courseid, $subscriptionid, $timez
$description = clean_param($description, PARAM_NOTAGS);
$description = str_replace('\n', '<br />', $description);
$description = str_replace('\\', '', $description);
$description = preg_replace('/\s+/', ' ', $description);
$description = preg_replace('/\s+/u', ' ', $description);
}
$eventrecord->description = $description;
+2 -2
View File
@@ -7,8 +7,8 @@ Feature: Perform basic calendar functionality
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | Student | 1 | student1@asd.com |
| student2 | Student | 2 | student2@asd.com |
| student1 | Student | 1 | student1@example.com |
| student2 | Student | 2 | student2@example.com |
And the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
+26
View File
@@ -328,6 +328,7 @@ class core_calendar_externallib_testcase extends externallib_advanced_testcase {
$paramevents = array ('courseids' => array($course->id), 'groupids' => array($group->id));
$events = core_calendar_external::get_calendar_events($paramevents, $options);
$events = external_api::clean_returnvalue(core_calendar_external::get_calendar_events_returns(), $events);
$this->assertEquals(4, count($events['events'])); // site, user, group, one course event.
$this->assertEquals(0, count($events['warnings']));
@@ -362,6 +363,30 @@ class core_calendar_externallib_testcase extends externallib_advanced_testcase {
$events = external_api::clean_returnvalue(core_calendar_external::get_calendar_events_returns(), $events);
$this->assertEquals(1, count($events['events'])); // site.
$this->assertEquals(0, count($events['warnings']));
// Now, create an activity event.
$this->setAdminUser();
$nexttime = time() + DAYSECS;
$assign = $this->getDataGenerator()->create_module('assign', array('course' => $course->id, 'duedate' => $nexttime));
$this->setUser($user);
$paramevents = array ('courseids' => array($course->id));
$options = array ('siteevents' => true, 'userevents' => true, 'timeend' => time() + WEEKSECS);
$events = core_calendar_external::get_calendar_events($paramevents, $options);
$events = external_api::clean_returnvalue(core_calendar_external::get_calendar_events_returns(), $events);
$this->assertCount(5, $events['events']);
// Hide the assignment.
set_coursemodule_visible($assign->cmid, 0);
// Empty all the caches that may be affected by this change.
accesslib_clear_all_caches_for_unit_testing();
course_modinfo::clear_instance_cache();
$events = core_calendar_external::get_calendar_events($paramevents, $options);
$events = external_api::clean_returnvalue(core_calendar_external::get_calendar_events_returns(), $events);
// Expect one less.
$this->assertCount(4, $events['events']);
}
/**
@@ -390,6 +415,7 @@ class core_calendar_externallib_testcase extends externallib_advanced_testcase {
array('name' => 'user')
);
$eventsret = core_calendar_external::create_calendar_events($events);
$eventsret = external_api::clean_returnvalue(core_calendar_external::create_calendar_events_returns(), $eventsret);
// Check to see if things were created properly.
$aftercount = $DB->count_records('event');
+12 -12
View File
@@ -7,10 +7,10 @@ Feature: Add cohorts of users
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| user1 | First | User | first@user.com |
| user2 | Second | User | second@user.com |
| user3 | Third | User | third@user.com |
| user4 | Forth | User | forth@user.com |
| user1 | First | User | first@example.com |
| user2 | Second | User | second@example.com |
| user3 | Third | User | third@example.com |
| user4 | Forth | User | forth@example.com |
And I log in as "admin"
And I navigate to "Cohorts" node in "Site administration > Users > Accounts"
And I press "Add"
@@ -31,13 +31,13 @@ Feature: Add cohorts of users
@javascript
Scenario: Add users to a cohort selecting them from the system users list
When I add "First User (first@user.com)" user to "333" cohort members
And I add "Second User (second@user.com)" user to "333" cohort members
When I add "First User (first@example.com)" user to "333" cohort members
And I add "Second User (second@example.com)" user to "333" cohort members
Then I should see "2" in the "#cohorts" "css_element"
And I follow "Assign"
And the "Current users" select box should contain "First User (first@user.com)"
And the "Current users" select box should contain "Second User (second@user.com)"
And the "Current users" select box should not contain "Forth User (forth@user.com)"
And the "Current users" select box should contain "First User (first@example.com)"
And the "Current users" select box should contain "Second User (second@example.com)"
And the "Current users" select box should not contain "Forth User (forth@example.com)"
@javascript
Scenario: Add users to a cohort using a bulk user action
@@ -53,6 +53,6 @@ Feature: Add cohorts of users
And I follow "Cohorts"
Then I should see "2" in the "#cohorts" "css_element"
And I follow "Assign"
And the "Current users" select box should contain "Third User (third@user.com)"
And the "Current users" select box should contain "Forth User (forth@user.com)"
And the "Current users" select box should not contain "First User (first@user.com)"
And the "Current users" select box should contain "Third User (third@example.com)"
And the "Current users" select box should contain "Forth User (forth@example.com)"
And the "Current users" select box should not contain "First User (first@example.com)"
+1 -1
View File
@@ -40,7 +40,7 @@ use Behat\Behat\Context\Step\Given as Given;
class behat_cohort extends behat_base {
/**
* Adds the user to the specified cohort. The user should be specified like "Firstname Lastname (user@email.com)".
* Adds the user to the specified cohort. The user should be specified like "Firstname Lastname (user@example.com)".
*
* @Given /^I add "(?P<user_fullname_string>(?:[^"]|\\")*)" user to "(?P<cohort_idnumber_string>(?:[^"]|\\")*)" cohort members$/
* @param string $user
+7
View File
@@ -66,6 +66,7 @@ class core_cohort_externallib_testcase extends externallib_advanced_testcase {
// Call the external function.
$createdcohorts = core_cohort_external::create_cohorts(array($cohort1, $cohort2));
$createdcohorts = external_api::clean_returnvalue(core_cohort_external::create_cohorts_returns(), $createdcohorts);
// Check we retrieve the good total number of created cohorts + no error on capability.
$this->assertEquals(2, count($createdcohorts));
@@ -143,6 +144,7 @@ class core_cohort_externallib_testcase extends externallib_advanced_testcase {
// Call the external function.
$returnedcohorts = core_cohort_external::get_cohorts(array(
$cohort1->id, $cohort2->id));
$returnedcohorts = external_api::clean_returnvalue(core_cohort_external::get_cohorts_returns(), $returnedcohorts);
// Check we retrieve the good total number of enrolled cohorts + no error on capability.
$this->assertEquals(2, count($returnedcohorts));
@@ -160,6 +162,7 @@ class core_cohort_externallib_testcase extends externallib_advanced_testcase {
// Call the external function.
$returnedcohorts = core_cohort_external::get_cohorts(array(
$cohort1->id, $cohort2->id));
$returnedcohorts = external_api::clean_returnvalue(core_cohort_external::get_cohorts_returns(), $returnedcohorts);
// Check we retrieve the good total number of enrolled cohorts + no error on capability.
$this->assertEquals(2, count($returnedcohorts));
@@ -345,6 +348,7 @@ class core_cohort_externallib_testcase extends externallib_advanced_testcase {
// Call the external function.
$addcohortmembers = core_cohort_external::add_cohort_members(array($cohort1));
$addcohortmembers = external_api::clean_returnvalue(core_cohort_external::add_cohort_members_returns(), $addcohortmembers);
// Check we retrieve the good total number of created cohorts + no error on capability.
$this->assertEquals(1, count($addcohortmembers));
@@ -386,11 +390,14 @@ class core_cohort_externallib_testcase extends externallib_advanced_testcase {
'usertype' => array('type' => 'id', 'value' => $user1->id)
);
$cohortmembers1 = core_cohort_external::add_cohort_members(array($cohortaddmember1));
$cohortmembers1 = external_api::clean_returnvalue(core_cohort_external::add_cohort_members_returns(), $cohortmembers1);
$cohortaddmember2 = array(
'cohorttype' => array('type' => 'id', 'value' => $cohort2->id),
'usertype' => array('type' => 'id', 'value' => $user2->id)
);
$cohortmembers2 = core_cohort_external::add_cohort_members(array($cohortaddmember2));
$cohortmembers2 = external_api::clean_returnvalue(core_cohort_external::add_cohort_members_returns(), $cohortmembers2);
// Check we retrieve no cohorts + no error on capability.
$this->assertEquals(2, $DB->count_records_select('cohort_members', ' ((cohortid = :idcohort1 AND userid = :iduser1)
+1 -1
View File
@@ -656,7 +656,7 @@ class comment {
$newcmt->fullname = fullname($USER);
$url = new moodle_url('/user/view.php', array('id' => $USER->id, 'course' => $this->courseid));
$newcmt->profileurl = $url->out();
$newcmt->content = format_text($newcmt->content, $format, array('overflowdiv'=>true));
$newcmt->content = format_text($newcmt->content, $newcmt->format, array('overflowdiv'=>true));
$newcmt->avatar = $OUTPUT->user_picture($USER, array('size'=>16));
$commentlist = array($newcmt);
@@ -11,17 +11,15 @@ Feature: Allow students to manually mark an activity as complete
| Course 1 | C1 | 0 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | Frist | teacher1@asd.com |
| student1 | Student | First | student1@asd.com |
| teacher1 | Teacher | Frist | teacher1@example.com |
| student1 | Student | First | student1@example.com |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "admin"
And I set the following administration settings values:
| Enable completion tracking | 1 |
| Enable conditional access | 1 |
And I log out
And the following config values are set as admin:
| enablecompletion | 1 |
| enableavailability | 1 |
And I log in as "teacher1"
And I follow "Course 1"
And I turn editing mode on
@@ -10,16 +10,14 @@ Feature: Restrict activity availability through date conditions
| Course 1 | C1 | 0 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | Frist | teacher1@asd.com |
| student1 | Student | First | student1@asd.com |
| teacher1 | Teacher | Frist | teacher1@example.com |
| student1 | Student | First | student1@example.com |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "admin"
And I set the following administration settings values:
| Enable conditional access | 1 |
And I log out
And the following config values are set as admin:
| enableavailability | 1 |
And I log in as "teacher1"
And I follow "Course 1"
And I turn editing mode on
@@ -11,16 +11,14 @@ Feature: Restrict activity availability through grade conditions
| Course 1 | C1 | 0 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | Frist | teacher1@asd.com |
| student1 | Student | First | student1@asd.com |
| teacher1 | Teacher | Frist | teacher1@example.com |
| student1 | Student | First | student1@example.com |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "admin"
And I set the following administration settings values:
| Enable conditional access | 1 |
And I log out
And the following config values are set as admin:
| enableavailability | 1 |
And I log in as "teacher1"
And I follow "Course 1"
And I turn editing mode on
@@ -10,17 +10,15 @@ Feature: Restrict sections availability through completion or grade conditions
| Course 1 | C1 | 0 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | Frist | teacher1@asd.com |
| student1 | Student | First | student1@asd.com |
| teacher1 | Teacher | Frist | teacher1@example.com |
| student1 | Student | First | student1@example.com |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "admin"
And I set the following administration settings values:
| Enable completion tracking | 1 |
| Enable conditional access | 1 |
And I log out
And the following config values are set as admin:
| enablecompletion | 1 |
| enableavailability | 1 |
@javascript
Scenario: Show section greyed-out to student when completion condition is not satisfied
@@ -16,9 +16,9 @@ Feature: Allow teachers to manually mark users as complete when configured
| user | course | role |
| student1 | CC1 | student |
| teacher1 | CC1 | editingteacher |
And the following config values are set as admin:
| enablecompletion | 1 |
And I log in as "admin"
And I set the following administration settings values:
| Enable completion tracking | 1 |
And I am on homepage
And I follow "Completion course"
And completion tracking is "Enabled" in current course
+1 -1
View File
@@ -8,6 +8,6 @@
"require-dev": {
"phpunit/phpunit": "3.7.*",
"phpunit/dbUnit": "1.2.*",
"moodlehq/behat-extension": "1.27.13"
"moodlehq/behat-extension": "1.27.14"
}
}
+1 -10
View File
@@ -341,15 +341,6 @@ $CFG->admin = 'admin';
// $CFG->forcefirstname = 'Bruce';
// $CFG->forcelastname = 'Simpson';
//
// The following setting will turn SQL Error logging on. This will output an
// entry in apache error log indicating the position of the error and the statement
// called. This option will action disregarding error_reporting setting.
// $CFG->dblogerror = true;
//
// The following setting will log every database query to a table called adodb_logsql.
// Use this setting on a development server only, the table grows quickly!
// $CFG->logsql = true;
//
// The following setting will turn on username logging into Apache log. For full details regarding setting
// up of this function please refer to the install section of the document.
// $CFG->apacheloguser = 0; // Turn this feature off. Default value.
@@ -689,7 +680,7 @@ $CFG->admin = 'admin';
// (the basic and behat_* ones) to avoid problems with production environments. This setting can be
// used to expand the default white list with an array of extra settings.
// Example:
// $CFG->behat_extraallowedsettings = array('logsql', 'dblogerror');
// $CFG->behat_extraallowedsettings = array('somecoresetting', ...);
//
// You should explicitly allow the usage of the deprecated behat steps, otherwise an exception will
// be thrown when using them. The setting is disabled by default.

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