Compare commits
300 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8445cad014 | |||
| 0dc00ed6e9 | |||
| 53a794538a | |||
| 36ded6f300 | |||
| 2be167a172 | |||
| 065b6436c2 | |||
| 1d914c1937 | |||
| c5a878de43 | |||
| 292a559fd7 | |||
| 3569920982 | |||
| 2217677c96 | |||
| 0a75e8e4cf | |||
| 7a6315e676 | |||
| 27b30703b4 | |||
| cfc476a722 | |||
| 093512285f | |||
| 424f20e225 | |||
| 8e2a748167 | |||
| 8ce2a2fe73 | |||
| 753335e5fe | |||
| cb36a45ce2 | |||
| e8870b1975 | |||
| af12e1f3c6 | |||
| cbc91748b4 | |||
| 3a6e2c8f26 | |||
| d8e559dcbe | |||
| e4c6d0b498 | |||
| cfe8f40e94 | |||
| 4ad38cc139 | |||
| c9978cffbb | |||
| 32b8996a09 | |||
| 1cfd9eec4f | |||
| 4f0592f963 | |||
| c9336ff7dc | |||
| c66e293747 | |||
| 140ee4b80d | |||
| e3ac7a574c | |||
| 1111c96ac0 | |||
| 44d7ffeb89 | |||
| 3fa85e6828 | |||
| 4ea8645494 | |||
| d6b06d0cef | |||
| efee10f43e | |||
| 1b2f009da2 | |||
| 51c1ca0248 | |||
| 41ee4a6cad | |||
| 85e642bec1 | |||
| 0a25a24ff6 | |||
| 5583a50bae | |||
| 82fb415b69 | |||
| b7b20e7381 | |||
| 0effcbe6b5 | |||
| cffd2be100 | |||
| 8270a62377 | |||
| ce5a9b2800 | |||
| 73f101e862 | |||
| 1761d94638 | |||
| d7a8c72b8f | |||
| 1ca9ebb3cb | |||
| af4a6daacc | |||
| 12d7c64dc7 | |||
| 541f1569af | |||
| 8bbc166cb4 | |||
| d26badab50 | |||
| 823d1b25ea | |||
| 662befa64e | |||
| ff135b2d86 | |||
| a7d8f4d1d9 | |||
| 006b2a2642 | |||
| 0c5b52e6ac | |||
| 169827cf80 | |||
| f591916893 | |||
| 6dcb54ced7 | |||
| f105122cef | |||
| 0d4a8ce45d | |||
| 000b0c2771 | |||
| 7afa525ff3 | |||
| a29b5364ab | |||
| fbe62c9538 | |||
| 8523e47075 | |||
| 575932b2ec | |||
| 627945e854 | |||
| 2617f75596 | |||
| 730e1d0ae0 | |||
| 7d02e08ef9 | |||
| 2ca0fb4886 | |||
| 78f545b165 | |||
| 9e4cdf9eca | |||
| be65ecd3e1 | |||
| f597c8bc2d | |||
| 2e541fe5b0 | |||
| 83cc825626 | |||
| cd27ce2970 | |||
| e5bbbe000d | |||
| 7b1bff7cca | |||
| 75de28348a | |||
| 598fee8ec7 | |||
| e968dc4629 | |||
| 170b3ea2ab | |||
| 3d17b48855 | |||
| 0bc7bd66b2 | |||
| 08ea67a272 | |||
| 4d50167046 | |||
| 333aabfaea | |||
| f28de0cb41 | |||
| 7e75a3680e | |||
| d75311461f | |||
| 14467d84fb | |||
| 897649d9a0 | |||
| 3edbc2c282 | |||
| d39da752c6 | |||
| 29381e8a0d | |||
| 1bd8f959e1 | |||
| ebeeb9cef8 | |||
| 9071c67a2c | |||
| 32b8197ad0 | |||
| e7b223c14d | |||
| 027b1a9efe | |||
| 8254bc5d09 | |||
| 630ae866bf | |||
| a3323b7d28 | |||
| 77fed64613 | |||
| ac0ae250f0 | |||
| bb10627261 | |||
| 1dbedf59ae | |||
| 03226fa1be | |||
| 9ade94e0ea | |||
| 9843d8a9ef | |||
| 3d27fbc77d | |||
| 788900f048 | |||
| 274cb0f8b2 | |||
| a54bdf4ade | |||
| 3df91d98f4 | |||
| e54e923b55 | |||
| 0dc8cfc9d4 | |||
| da164d9dba | |||
| fcfd4b3fc3 | |||
| b59cceeeb8 | |||
| d6ed761e7f | |||
| 47cb26cde1 | |||
| a66e710e22 | |||
| ad4887bdf1 | |||
| ab5cb82442 | |||
| cf7a9dd5fc | |||
| c2b06a60bf | |||
| 0d78fef21c | |||
| bd938712f4 | |||
| 27615c8cc6 | |||
| 30d23e5353 | |||
| 24d1f24175 | |||
| f22eed6b67 | |||
| a969e35ef5 | |||
| 43a0e4d96d | |||
| b6cf3a1851 | |||
| dd0b40c2ae | |||
| c9c6dbebd6 | |||
| 13440d2edd | |||
| 866d5c02f3 | |||
| d834f8698f | |||
| 72d54c6b1e | |||
| f113ecfba7 | |||
| dffd193de5 | |||
| a2be2e3067 | |||
| c7d7c5a8c8 | |||
| cb2690ca4e | |||
| af704fe2b3 | |||
| 4332522a7d | |||
| cae8d49d99 | |||
| 320700db21 | |||
| d48c418aa0 | |||
| efd335ca90 | |||
| 588be50d53 | |||
| 52731101f6 | |||
| 3b05390d62 | |||
| a5242728c2 | |||
| ad5b72e696 | |||
| a0ff17c66d | |||
| cf7fe7a547 | |||
| 3101137de3 | |||
| 1c95a3a4da | |||
| 39ce93c3b6 | |||
| e8ae5de91b | |||
| 401a716147 | |||
| d92296b89e | |||
| ede19c68df | |||
| a53ce235a8 | |||
| 30fed30e65 | |||
| 3cc3825f63 | |||
| e8eb81f399 | |||
| 1d21f959b4 | |||
| 67107816a0 | |||
| 8f974b5e0e | |||
| 7cd120d902 | |||
| 2a0c01bb1a | |||
| aaf84bc0cf | |||
| 09daa6585f | |||
| 67dbbc95bd | |||
| f3eedaaf2a | |||
| 5d3fac792c | |||
| 516fed31e5 | |||
| 46cb497bae | |||
| 66c560de3d | |||
| faea71c0aa | |||
| 2e48537ee5 | |||
| d273c20427 | |||
| 376c41e841 | |||
| 59f556e731 | |||
| ccd7a6b9a6 | |||
| 143fbe18f7 | |||
| a444834a5b | |||
| 1b5e5e3c65 | |||
| 1c8cc2b543 | |||
| 659b50f380 | |||
| 77b6cf7568 | |||
| 0b4c755b34 | |||
| 04eb9c0b61 | |||
| 21419b94bd | |||
| 021965fd55 | |||
| 6685d750e7 | |||
| 830fca4a77 | |||
| cdf702bea3 | |||
| 6fb8b72782 | |||
| 2e571156f9 | |||
| 59547c9e26 | |||
| dba907c5a1 | |||
| b09ace0546 | |||
| 360812e77b | |||
| 3f0fa1eb14 | |||
| 1f859c16ea | |||
| a575fe46db | |||
| f0d535b65c | |||
| 0dee8a90e3 | |||
| 0733ed3db1 | |||
| 32547c0496 | |||
| 39111a7bc7 | |||
| a05d3938f8 | |||
| a7f6daff5b | |||
| 90b4e8b85c | |||
| 8c6b8ed7ea | |||
| 1390809635 | |||
| 43a62d768c | |||
| 701e76e301 | |||
| 0b88080611 | |||
| a8f6fad781 | |||
| 6bef9d816c | |||
| c328216c75 | |||
| 566dc85f06 | |||
| a7c7fda91a | |||
| 16b78d03a7 | |||
| 3eb7553ab5 | |||
| 5ef6bc0d7a | |||
| 08abd7ea3b | |||
| 7742681329 | |||
| 3f8d704ee4 | |||
| f53120985a | |||
| ae03be74b6 | |||
| 431605b0ba | |||
| 63e52a69c2 | |||
| 473018cb53 | |||
| e837d357b1 | |||
| f47253d387 | |||
| ba1f355fd5 | |||
| 3a44e5126f | |||
| 1b11ed787b | |||
| 2fda6af72f | |||
| 239b833d99 | |||
| 15f176eb3d | |||
| 7895aca40a | |||
| 9f7839ba0b | |||
| 710db6f11a | |||
| ea1350cbe0 | |||
| 1a9a5d1cbe | |||
| 8553c27e57 | |||
| a18c3ad13a | |||
| 6cc2d8e5db | |||
| 7b17ee7fb9 | |||
| 3feecc5bb8 | |||
| 64dbf8d6c8 | |||
| 7c9fc3fb34 | |||
| 500a225afc | |||
| e8054b547a | |||
| 9ab9d973c7 | |||
| ce2a687c2b | |||
| 22b0195c6d | |||
| 5ec7fa94c5 | |||
| 9186e7e0ec | |||
| a4c7cb3241 | |||
| 7d00d01b66 | |||
| e34037ea6a | |||
| 2b5ba79954 | |||
| f19403ea2f | |||
| 3d314d6d4b | |||
| bb3e575079 | |||
| d42c502516 | |||
| 9451a354fd | |||
| c98be745f5 | |||
| ff4f2c02ef | |||
| d4f2a8b417 | |||
| cfef02a97c | |||
| 0e9b826517 |
@@ -19,7 +19,7 @@ env:
|
||||
|
||||
jobs:
|
||||
Grunt:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
steps:
|
||||
- name: Checking out code
|
||||
@@ -61,12 +61,12 @@ jobs:
|
||||
matrix:
|
||||
include:
|
||||
# MySQL builds always run with the lowest PHP supported version.
|
||||
- os: ubuntu-22.04
|
||||
- os: ubuntu-24.04
|
||||
php: 8.1
|
||||
extensions:
|
||||
db: mysqli
|
||||
# PostgreSQL builds always run with the highest PHP supported version.
|
||||
- os: ubuntu-22.04
|
||||
- os: ubuntu-24.04
|
||||
php: 8.3
|
||||
db: pgsql
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
*/
|
||||
|
||||
define('CLI_SCRIPT', true);
|
||||
define('IGNORE_COMPONENT_CACHE', true);
|
||||
|
||||
require(__DIR__.'/../../config.php');
|
||||
require_once($CFG->libdir.'/clilib.php');
|
||||
|
||||
@@ -55,13 +55,14 @@ If courseid is set, course module/s will be added into the course.
|
||||
|
||||
Options:
|
||||
-f, --file=STRING Path to the backup file.
|
||||
-c, --categoryid=INT ID of the course category to restore to.
|
||||
-C, --courseid=INT ID of the course to restore to. This option is ignored if categoryid is set.
|
||||
-c, --categoryid=INT ID of the course category to restore to. This option is ignored when restoring an activity and courseid is set.
|
||||
-C, --courseid=INT ID of the course to restore to. This option is ignored when restoring a course and the categoryid is set.
|
||||
-s, --showdebugging Show developer level debugging information
|
||||
-h, --help Print out this help.
|
||||
|
||||
Example:
|
||||
\$sudo -u www-data /usr/bin/php admin/cli/restore_backup.php --file=/path/to/backup/file.mbz --categoryid=1\n
|
||||
\$sudo -u www-data /usr/bin/php admin/cli/restore_backup.php --file=/path/to/backup/coursebackup.mbz --categoryid=1\n
|
||||
\$sudo -u www-data /usr/bin/php admin/cli/restore_backup.php --file=/path/to/backup/activitybackup.mbz --courseid=1\n
|
||||
EOL;
|
||||
|
||||
echo $help;
|
||||
@@ -84,11 +85,15 @@ if ($options['categoryid']) {
|
||||
if (!$category = $DB->get_record('course_categories', ['id' => $options['categoryid']], 'id')) {
|
||||
throw new \moodle_exception('invalidcategoryid');
|
||||
}
|
||||
} else if ($options['courseid']) {
|
||||
}
|
||||
|
||||
if ($options['courseid']) {
|
||||
if (!$course = $DB->get_record('course', ['id' => $options['courseid']], 'id')) {
|
||||
throw new \moodle_exception('invalidcourseid');
|
||||
}
|
||||
} else {
|
||||
}
|
||||
|
||||
if (empty($category) && empty($course)) {
|
||||
throw new \moodle_exception('invalidoption');
|
||||
}
|
||||
|
||||
@@ -100,28 +105,46 @@ $fp = get_file_packer('application/vnd.moodle.backup');
|
||||
$fp->extract_to_pathname($options['file'], $path);
|
||||
|
||||
cli_heading(get_string('preprocessingbackupfile'));
|
||||
try {
|
||||
list($fullname, $shortname) = restore_dbops::calculate_course_names(0, get_string('restoringcourse', 'backup'),
|
||||
get_string('restoringcourseshortname', 'backup'));
|
||||
|
||||
if (!empty($course)) {
|
||||
$courseid = $course->id;
|
||||
$rc = new restore_controller($backupdir, $courseid, backup::INTERACTIVE_NO,
|
||||
backup::MODE_GENERAL, $admin->id, backup::TARGET_EXISTING_ADDING);
|
||||
} else {
|
||||
try {
|
||||
// Create a temporary restore controller to determine the restore type.
|
||||
$tmprc = new restore_controller($backupdir, SITEID, backup::INTERACTIVE_NO,
|
||||
backup::MODE_GENERAL, $admin->id, backup::TARGET_EXISTING_ADDING);
|
||||
// Restore the backup into a new course if:
|
||||
// - It is a course backup and the category is set.
|
||||
// - It is an activity backup and the course is not set.
|
||||
$restoreasnewcourse = ($tmprc->get_type() === backup::TYPE_1COURSE && !empty($category)) ||
|
||||
($tmprc->get_type() !== backup::TYPE_1COURSE && empty($course));
|
||||
// Make sure to clean up the temporary restore controller.
|
||||
$tmprc->destroy();
|
||||
|
||||
if ($restoreasnewcourse) {
|
||||
list($fullname, $shortname) = restore_dbops::calculate_course_names(0, get_string('restoringcourse', 'backup'),
|
||||
get_string('restoringcourseshortname', 'backup'));
|
||||
$courseid = restore_dbops::create_new_course($fullname, $shortname, $category->id);
|
||||
$rc = new restore_controller($backupdir, $courseid, backup::INTERACTIVE_NO,
|
||||
backup::MODE_GENERAL, $admin->id, backup::TARGET_NEW_COURSE);
|
||||
} else {
|
||||
$courseid = $course->id;
|
||||
$rc = new restore_controller($backupdir, $courseid, backup::INTERACTIVE_NO,
|
||||
backup::MODE_GENERAL, $admin->id, backup::TARGET_EXISTING_ADDING);
|
||||
}
|
||||
$rc->execute_precheck();
|
||||
$rc->execute_plan();
|
||||
$rc->destroy();
|
||||
|
||||
// Rename course name if the backup is from course module and restore to category.
|
||||
if (empty($course)) {
|
||||
// Rename the course's full and short names with the backup file's original names if the backup file is an activity backup
|
||||
// that is restored to a new course.
|
||||
if ($restoreasnewcourse && $rc->get_type() !== backup::TYPE_1COURSE) {
|
||||
$course = get_course($courseid);
|
||||
list($fullname, $shortname) = restore_dbops::calculate_course_names(0, get_string('restoretonewcourse', 'backup'),
|
||||
get_string('newcourse'));
|
||||
$backupinfo = $rc->get_info();
|
||||
$tmpfullname = $backupinfo->original_course_fullname ?? get_string('restoretonewcourse', 'backup');
|
||||
$tmpshortname = $backupinfo->original_course_shortname ?? get_string('newcourse');
|
||||
list($fullname, $shortname) = restore_dbops::calculate_course_names(
|
||||
courseid: 0,
|
||||
fullname: $tmpfullname,
|
||||
shortname: $tmpshortname,
|
||||
);
|
||||
$course->fullname = $fullname;
|
||||
$course->shortname = $shortname;
|
||||
$course->visible = 1;
|
||||
|
||||
@@ -4327,6 +4327,7 @@
|
||||
<VENDOR name="oracle" version="19" />
|
||||
</DATABASE>
|
||||
<PHP version="8.1.0" level="required">
|
||||
<RESTRICT function="restrict_php_version_84" message="unsupportedphpversion84" />
|
||||
</PHP>
|
||||
<PCREUNICODE level="optional">
|
||||
<FEEDBACK>
|
||||
@@ -4522,6 +4523,7 @@
|
||||
<VENDOR name="oracle" version="19" />
|
||||
</DATABASE>
|
||||
<PHP version="8.1.0" level="required">
|
||||
<RESTRICT function="restrict_php_version_84" message="unsupportedphpversion84" />
|
||||
</PHP>
|
||||
<PCREUNICODE level="optional">
|
||||
<FEEDBACK>
|
||||
@@ -4714,6 +4716,7 @@
|
||||
<VENDOR name="mysql" version="8.4" />
|
||||
<VENDOR name="postgres" version="14" />
|
||||
<VENDOR name="mssql" version="14.0" />
|
||||
<VENDOR name="auroramysql" version="8.0" />
|
||||
</DATABASE>
|
||||
<PHP version="8.2.0" level="required">
|
||||
</PHP>
|
||||
@@ -4893,6 +4896,208 @@
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_async_backup" level="recommended">
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_aurora_version" level="optional">
|
||||
</CUSTOM_CHECK>
|
||||
</CUSTOM_CHECKS>
|
||||
</MOODLE>
|
||||
<MOODLE version="5.1" requires="4.2.3">
|
||||
<UNICODE level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="unicoderequired" />
|
||||
</FEEDBACK>
|
||||
</UNICODE>
|
||||
<DATABASE level="required">
|
||||
<VENDOR name="mariadb" version="10.11.0" />
|
||||
<VENDOR name="mysql" version="8.4" />
|
||||
<VENDOR name="postgres" version="15" />
|
||||
<VENDOR name="mssql" version="14.0" />
|
||||
<VENDOR name="auroramysql" version="8.0" />
|
||||
</DATABASE>
|
||||
<PHP version="8.2.0" level="required">
|
||||
</PHP>
|
||||
<PCREUNICODE level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="pcreunicodewarning" />
|
||||
</FEEDBACK>
|
||||
</PCREUNICODE>
|
||||
<PHP_EXTENSIONS>
|
||||
<PHP_EXTENSION name="iconv" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="iconvrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="mbstring" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="mbstringrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="curl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="curlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="openssl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="opensslrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="tokenizer" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="tokenizerrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="soap" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="soaprecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="ctype" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="ctyperequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="zip" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="ziprequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="zlib" level="required">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="gd" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="gdrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="simplexml" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="simplexmlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="spl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="splrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="pcre" level="required">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="dom" level="required">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="xml" level="required">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="xmlreader" level="required">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="intl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="intlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="json" level="required">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="hash" level="required"/>
|
||||
<PHP_EXTENSION name="fileinfo" level="required"/>
|
||||
<PHP_EXTENSION name="sodium" level="required"/>
|
||||
<PHP_EXTENSION name="exif" level="optional"/>
|
||||
</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_SETTING name="zend.exception_ignore_args" value="1" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="settingzendexceptionignoreargs" />
|
||||
</FEEDBACK>
|
||||
</PHP_SETTING>
|
||||
</PHP_SETTINGS>
|
||||
<CUSTOM_CHECKS>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_storage_engine" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="unsupporteddbstorageengine" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="question/engine/upgrade/upgradelib.php" function="quiz_attempts_upgraded" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="quizattemptsupgradedmessage" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_slasharguments" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="slashargumentswarning" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_tables_row_format" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="unsupporteddbtablerowformat" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_unoconv_version" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="unoconvwarning" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_libcurl_version" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="libcurlwarning" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_format" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="unsupporteddbfileformat" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_per_table" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="unsupporteddbfilepertable" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_large_prefix" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="unsupporteddblargeprefix" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_is_https" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="ishttpswarning" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_incomplete_unicode_support" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="incompleteunicodesupport" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_sixtyfour_bits" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="sixtyfourbitsrequired" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_max_input_vars" level="optional">
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_admin_dir_usage" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="iscustomadminwarnings" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_xmlrpc_usage" level="optional">
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mod_assignment" level="required">
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_db_prefix_length" level="required">
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_async_backup" level="recommended">
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_aurora_version" level="optional">
|
||||
</CUSTOM_CHECK>
|
||||
</CUSTOM_CHECKS>
|
||||
</MOODLE>
|
||||
</COMPATIBILITY_MATRIX>
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
define('IGNORE_COMPONENT_CACHE', true);
|
||||
|
||||
require_once('../config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
|
||||
|
||||
@@ -81,6 +81,8 @@ class behat_admin extends behat_base {
|
||||
|
||||
$this->execute('behat_forms::i_set_the_field_with_xpath_to', [$fieldxpath, $value]);
|
||||
$this->execute("behat_general::i_click_on", [get_string('savechanges'), 'button']);
|
||||
// Wait for the page to be redirected.
|
||||
$this->execute("behat_general::i_wait_to_be_redirected");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ Feature: Verify the breadcrumbs in webservice tokens site administration pages
|
||||
And "Manage tokens" "link" should exist in the ".breadcrumb" "css_element"
|
||||
And "Web services" "link" should exist in the ".breadcrumb" "css_element"
|
||||
And I set the field "User" to "John Doe"
|
||||
And I set the field "Service" to "Moodle mobile web service"
|
||||
And I press "Save changes"
|
||||
When I click on "Delete" "link"
|
||||
Then "Delete token" "text" should exist in the ".breadcrumb" "css_element"
|
||||
|
||||
@@ -36,6 +36,10 @@ if (function_exists('opcache_reset')) {
|
||||
define('CLI_SCRIPT', true);
|
||||
define('CACHE_DISABLE_ALL', true);
|
||||
|
||||
// It makes no sense to use BEHAT_CLI for this script (the Behat launch scripts expect to start
|
||||
// from the normal environment), so in case user has set tne environment variable, disable it.
|
||||
putenv('BEHAT_CLI=0');
|
||||
|
||||
// Basic functions.
|
||||
require_once(__DIR__ . '/../../../../lib/clilib.php');
|
||||
require_once(__DIR__ . '/../../../../lib/behat/lib.php');
|
||||
|
||||
@@ -31,6 +31,10 @@ define('ABORT_AFTER_CONFIG', true);
|
||||
define('CACHE_DISABLE_ALL', true);
|
||||
define('NO_OUTPUT_BUFFERING', true);
|
||||
|
||||
// It makes no sense to use BEHAT_CLI for this script (the Behat launch scripts expect to start
|
||||
// from the normal environment), so in case user has set tne environment variable, disable it.
|
||||
putenv('BEHAT_CLI=0');
|
||||
|
||||
require_once(__DIR__ .'/../../../../config.php');
|
||||
require_once(__DIR__.'/../../../../lib/clilib.php');
|
||||
require_once(__DIR__.'/../../../../lib/behat/lib.php');
|
||||
|
||||
@@ -39,6 +39,10 @@ define('NO_OUTPUT_BUFFERING', true);
|
||||
define('IGNORE_COMPONENT_CACHE', true);
|
||||
define('ABORT_AFTER_CONFIG', true);
|
||||
|
||||
// It makes no sense to use BEHAT_CLI for this script (the Behat launch scripts expect to start
|
||||
// from the normal environment), so in case user has set tne environment variable, disable it.
|
||||
putenv('BEHAT_CLI=0');
|
||||
|
||||
require_once(__DIR__ . '/../../../../lib/clilib.php');
|
||||
|
||||
// CLI options.
|
||||
|
||||
@@ -33,6 +33,10 @@ if (isset($_SERVER['REMOTE_ADDR'])) {
|
||||
die(); // No access from web!.
|
||||
}
|
||||
|
||||
// It makes no sense to use BEHAT_CLI for this script (the Behat launch scripts expect to start
|
||||
// from the normal environment), so in case user has set tne environment variable, disable it.
|
||||
putenv('BEHAT_CLI=0');
|
||||
|
||||
// Basic functions.
|
||||
require_once(__DIR__ . '/../../../../lib/clilib.php');
|
||||
require_once(__DIR__ . '/../../../../lib/behat/lib.php');
|
||||
|
||||
@@ -87,6 +87,7 @@ $action = optional_param('action', '', PARAM_ALPHA);
|
||||
// Handle any single operation actions.
|
||||
if ($action == 'requestanalysis') {
|
||||
if ($courseid != 0) {
|
||||
require_sesskey();
|
||||
scheduler::request_course_analysis($courseid);
|
||||
if ($courseid == SITEID) {
|
||||
redirect(accessibility::get_plugin_url());
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
// This file is part of Moodle - https://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 <https://www.gnu.org/licenses/>.
|
||||
|
||||
namespace tool_capability;
|
||||
|
||||
// phpcs:disable moodle.PHPUnit.TestCaseProvider.dataProviderSyntaxMethodNotFound
|
||||
|
||||
/**
|
||||
* Detect common problems in capability definitions of plugins.
|
||||
*
|
||||
* @group plugin_checks
|
||||
* @package tool_capability
|
||||
* @copyright 2025 Petr Skoda
|
||||
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
final class plugin_checks_test extends \core\tests\plugin_checks_testcase {
|
||||
/**
|
||||
* Verify contents of plugin db/access.php file.
|
||||
*
|
||||
* @dataProvider all_plugins_provider
|
||||
* @coversNothing
|
||||
*
|
||||
* @param string $component
|
||||
* @param string $plugintype
|
||||
* @param string $pluginname
|
||||
* @param string $dir
|
||||
*/
|
||||
public function test_db_access_file(string $component, string $plugintype, string $pluginname, string $dir): void {
|
||||
global $CFG;
|
||||
|
||||
$stringmanager = get_string_manager();
|
||||
$corerolefile = "$CFG->dirroot/lang/en/role.php";
|
||||
$langfile = "$dir/lang/en/$component.php";
|
||||
|
||||
$file = "$dir/db/access.php";
|
||||
$capabilities = $this->fetch_array_from_file($file, 'capabilities');
|
||||
if (!$capabilities) {
|
||||
$this->expectNotToPerformAssertions();
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ($capabilities as $capname => $capability) {
|
||||
if ($plugintype === 'qbank' && str_starts_with($capname, 'moodle/question:')) {
|
||||
// Question bank capabilities are irregular.
|
||||
$strname = explode('/', $capname, 2)[1];
|
||||
$this->assertTrue($stringmanager->string_exists($strname, 'core_role'),
|
||||
"Missing capability name string '$strname' in $corerolefile");
|
||||
continue;
|
||||
}
|
||||
$this->assertMatchesRegularExpression("|^$plugintype/$pluginname:[a-z0-9_]+$|", $capname);
|
||||
$strname = substr($capname, strlen($plugintype) + 1);
|
||||
$this->assertTrue($stringmanager->string_exists($strname, $component),
|
||||
"Missing capability name string '$strname' in $langfile");
|
||||
$this->assertSame($capname, clean_param($capname, PARAM_CAPABILITY));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -123,6 +123,7 @@ class expired_contexts_manager {
|
||||
$expiredcontext = new expired_context(0, $orphan);
|
||||
$expiredcontext->delete();
|
||||
}
|
||||
$orphaned->close();
|
||||
|
||||
// Delete any child of a user context.
|
||||
$parentpath = $DB->sql_concat('ctxuser.path', "'/%'");
|
||||
@@ -143,6 +144,7 @@ class expired_contexts_manager {
|
||||
$expiredcontext = new expired_context(0, $child);
|
||||
$expiredcontext->delete();
|
||||
}
|
||||
$userchildren->close();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -127,7 +127,6 @@ $string['dporolemapping'] = 'Privacy officer role mapping';
|
||||
$string['dporolemapping_desc'] = 'The privacy officer can manage data requests. The capability tool/dataprivacy:managedatarequests must be allowed for a role to be listed as a privacy officer role mapping option.';
|
||||
$string['editcategories'] = 'Edit categories';
|
||||
$string['editcategory'] = 'Edit category';
|
||||
$string['editcategories'] = 'Edit categories';
|
||||
$string['editdefaults'] = 'Edit defaults: {$a}';
|
||||
$string['editmoduledefaults'] = 'Edit module defaults';
|
||||
$string['editpurpose'] = 'Edit purpose';
|
||||
|
||||
@@ -46,11 +46,11 @@ Feature: See the competencies for an activity on the course competencies page.
|
||||
When I follow "Competencies"
|
||||
Then I should see "Test-Comp1"
|
||||
And I should see "Test-Comp2"
|
||||
And I set the field "Filter competencies by resource or activity" to "PageName1"
|
||||
And I set the competency filter "Filter competencies by resource or activity" to "PageName1"
|
||||
And I press the enter key
|
||||
And I should see "Test-Comp1"
|
||||
And I should not see "Test-Comp2"
|
||||
And I set the field "Filter competencies by resource or activity" to "PageName2"
|
||||
And I set the competency filter "Filter competencies by resource or activity" to "PageName2"
|
||||
And I press the enter key
|
||||
And I should not see "Test-Comp1"
|
||||
And I should not see "Test-Comp2"
|
||||
|
||||
@@ -41,6 +41,18 @@ class manager {
|
||||
/** @var int */
|
||||
const REDIR_LOOP_THRESHOLD = 5;
|
||||
|
||||
/** @var array These components and related fileareas will not redirect. */
|
||||
const ALLOWED_COMPONENTS = [
|
||||
'core_admin' => [
|
||||
'logocompact',
|
||||
'logo',
|
||||
'favicon',
|
||||
],
|
||||
'tool_mfa' => [
|
||||
'guidance',
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* Displays a debug table with current factor information.
|
||||
*
|
||||
@@ -424,6 +436,37 @@ class manager {
|
||||
return self::NO_REDIRECT;
|
||||
}
|
||||
|
||||
// Ensure we have a moodle_url object if a string is provided.
|
||||
if (is_string($url)) {
|
||||
$url = new \moodle_url($url);
|
||||
}
|
||||
|
||||
// Check for pluginfile.php urls.
|
||||
$pluginfileurl = new \moodle_url('/pluginfile.php');
|
||||
if ($url->compare($pluginfileurl)) {
|
||||
// Get the slash arguments.
|
||||
$args = explode('/', ltrim($url->get_slashargument(), '/'));
|
||||
|
||||
// Remove the contextid because we do not need it for this check.
|
||||
array_shift($args);
|
||||
|
||||
// Get the component and filearea.
|
||||
$component = clean_param(array_shift($args), PARAM_COMPONENT);
|
||||
$filearea = clean_param(array_shift($args), PARAM_AREA);
|
||||
|
||||
// Check allowed components.
|
||||
if (!array_key_exists($component, static::ALLOWED_COMPONENTS)) {
|
||||
return self::REDIRECT;
|
||||
}
|
||||
|
||||
// Check allowed fileareas.
|
||||
if (!in_array($filearea, static::ALLOWED_COMPONENTS[$component])) {
|
||||
return self::REDIRECT;
|
||||
}
|
||||
|
||||
return self::NO_REDIRECT;
|
||||
}
|
||||
|
||||
// Remove all params before comparison.
|
||||
$url->remove_all_params();
|
||||
|
||||
@@ -442,12 +485,6 @@ class manager {
|
||||
}
|
||||
}
|
||||
|
||||
// Dont redirect logo images from pluginfile.php (for example: logo in header).
|
||||
$logourl = new \moodle_url('/pluginfile.php/1/core_admin/logocompact/');
|
||||
if ($url->compare($logourl)) {
|
||||
return self::NO_REDIRECT;
|
||||
}
|
||||
|
||||
// Admin not setup.
|
||||
if (!empty($CFG->adminsetuppending)) {
|
||||
return self::NO_REDIRECT;
|
||||
@@ -469,12 +506,6 @@ class manager {
|
||||
return self::NO_REDIRECT;
|
||||
}
|
||||
|
||||
// Enrolment.
|
||||
$enrol = new \moodle_url('/enrol/index.php');
|
||||
if ($enrol->compare($url, URL_MATCH_BASE)) {
|
||||
return self::NO_REDIRECT;
|
||||
}
|
||||
|
||||
// Guest access.
|
||||
if (isguestuser()) {
|
||||
return self::NO_REDIRECT;
|
||||
|
||||
@@ -41,7 +41,8 @@ class factor_email_renderer extends plugin_renderer_base {
|
||||
$authurl = new \moodle_url('/admin/tool/mfa/factor/email/email.php',
|
||||
['instance' => $instance->id, 'pass' => 1, 'secret' => $instance->secret]);
|
||||
$authurlstring = \html_writer::link($authurl, get_string('email:link', 'factor_email'));
|
||||
$blockurl = new \moodle_url('/admin/tool/mfa/factor/email/email.php', ['instance' => $instanceid]);
|
||||
$blockurl = new \moodle_url('/admin/tool/mfa/factor/email/email.php',
|
||||
['instance' => $instance->id, 'secret' => $instance->secret]);
|
||||
$blockurlstring = \html_writer::link($blockurl, get_string('email:stoploginlink', 'factor_email'));
|
||||
$geoinfo = iplookup_find_location($instance->createdfromip);
|
||||
|
||||
|
||||
@@ -42,7 +42,8 @@ $PAGE->set_cacheable(false);
|
||||
$instance = $DB->get_record('tool_mfa', ['id' => $instanceid]);
|
||||
$factor = \tool_mfa\plugininfo\factor::get_factor('email');
|
||||
|
||||
// If pass is set, require login to force $SESSION and user, and pass for that session.
|
||||
// If pass is set, do checks and pass for this session.
|
||||
// Require login to force $SESSION and user, and pass for that session.
|
||||
if (!empty($instance) && $pass != 0 && $secret != 0) {
|
||||
require_login();
|
||||
if ($factor->get_state() === \tool_mfa\plugininfo\factor::STATE_LOCKED) {
|
||||
@@ -69,8 +70,12 @@ $form = new \factor_email\form\email($url);
|
||||
|
||||
if ($form->is_cancelled()) {
|
||||
redirect(new moodle_url('/'));
|
||||
} else if ($fromform = $form->get_data()) {
|
||||
if (empty($instance)) {
|
||||
}
|
||||
|
||||
// If submitted without the pass param, is a cancel request - do checks and revoke email factor.
|
||||
if ($fromform = $form->get_data()) {
|
||||
// Only allow revoke attempts from requests with a valid instance and secret.
|
||||
if (empty($instance) || empty($secret) || $instance->secret != $secret) {
|
||||
$message = get_string('error:badcode', 'factor_email');
|
||||
} else {
|
||||
$user = $DB->get_record('user', ['id' => $instance->userid]);
|
||||
|
||||
@@ -33,7 +33,7 @@ $string['email:loginlink'] = 'Or, if you\'re on the same device, use this {$a}.'
|
||||
$string['email:message'] = 'Here\'s your verification code for {$a->sitename} ({$a->siteurl}).';
|
||||
$string['email:originatingip'] = 'This login request was made from \'{$a}\'';
|
||||
$string['email:revokelink'] = 'If this wasn\'t you, you can {$a}.';
|
||||
$string['email:revokesuccess'] = 'This code has been successfully revoked. All sessions for {$a} have been ended.
|
||||
$string['email:revokesuccess'] = 'This code has been successfully revoked. All sessions for this user have been ended.
|
||||
Email will not be usable as a factor until account security has been verified.';
|
||||
$string['email:subject'] = 'Here\'s your verification code';
|
||||
$string['email:stoploginlink'] = 'stop this login attempt';
|
||||
|
||||
@@ -29,7 +29,7 @@ require_once(__DIR__ . '/../../../config.php');
|
||||
$PAGE->set_context(\context_system::instance());
|
||||
$PAGE->set_url(new moodle_url('/admin/tool/mfa/guide.php'));
|
||||
$PAGE->set_title(get_string('guidance', 'tool_mfa'));
|
||||
$PAGE->set_pagelayout('standard');
|
||||
$PAGE->set_pagelayout('secure');
|
||||
|
||||
// If guidance page isn't enabled, just redir back to home.
|
||||
if (!get_config('tool_mfa', 'guidance')) {
|
||||
|
||||
@@ -109,8 +109,8 @@ function tool_mfa_after_config(): void {
|
||||
/**
|
||||
* Serves any files for the guidance page.
|
||||
*
|
||||
* @param stdClass $course
|
||||
* @param stdClass $cm
|
||||
* @param stdClass|null $course
|
||||
* @param stdClass|null $cm
|
||||
* @param context $context
|
||||
* @param string $filearea
|
||||
* @param array $args
|
||||
@@ -118,7 +118,7 @@ function tool_mfa_after_config(): void {
|
||||
* @param array $options
|
||||
* @return bool
|
||||
*/
|
||||
function tool_mfa_pluginfile(stdClass $course, stdClass $cm, context $context, string $filearea,
|
||||
function tool_mfa_pluginfile(stdClass|null $course, stdClass|null $cm, context $context, string $filearea,
|
||||
array $args, bool $forcedownload, array $options = []): bool {
|
||||
// Hardcode to only send guidance files from the top level.
|
||||
$fs = get_file_storage();
|
||||
|
||||
@@ -23,6 +23,6 @@
|
||||
{
|
||||
}
|
||||
}}
|
||||
<a href='{{config.wwwroot}}/admin/tool/mfa/guide.php'>
|
||||
<a href='{{config.wwwroot}}/admin/tool/mfa/guide.php' target='_blank'>
|
||||
{{#str}} guidance, tool_mfa {{/str}}
|
||||
</a>
|
||||
|
||||
@@ -241,11 +241,6 @@ final class manager_test extends \advanced_testcase {
|
||||
$this->assertEquals(\tool_mfa\manager::NO_REDIRECT, \tool_mfa\manager::should_require_mfa($badurl, false));
|
||||
$this->setUser($user);
|
||||
|
||||
// Enrolment.
|
||||
$enrolurl = new \moodle_url('/enrol/index.php');
|
||||
$this->assertEquals(\tool_mfa\manager::REDIRECT, \tool_mfa\manager::should_require_mfa($badurl, false));
|
||||
$this->assertEquals(\tool_mfa\manager::NO_REDIRECT, \tool_mfa\manager::should_require_mfa($enrolurl, false));
|
||||
|
||||
// Guest User.
|
||||
$this->assertEquals(\tool_mfa\manager::REDIRECT, \tool_mfa\manager::should_require_mfa($badurl, false));
|
||||
$this->setGuestUser();
|
||||
@@ -266,6 +261,27 @@ final class manager_test extends \advanced_testcase {
|
||||
\core\session\manager::loginas($user2->id, $syscontext, false);
|
||||
$this->assertEquals(\tool_mfa\manager::NO_REDIRECT, \tool_mfa\manager::should_require_mfa($badurl, false));
|
||||
$this->setUser($user);
|
||||
|
||||
// Access logocompact via pluginfile.
|
||||
$logourl = new \moodle_url('/pluginfile.php/1/core_admin/logocompact/');
|
||||
$this->assertEquals(\tool_mfa\manager::NO_REDIRECT, \tool_mfa\manager::should_require_mfa($logourl, false));
|
||||
|
||||
// Access logo via pluginfile.
|
||||
$logourl = new \moodle_url('/pluginfile.php/1/core_admin/logo/');
|
||||
$this->assertEquals(\tool_mfa\manager::NO_REDIRECT, \tool_mfa\manager::should_require_mfa($logourl, false));
|
||||
|
||||
// Access favicon via pluginfile.
|
||||
$logourl = new \moodle_url('/pluginfile.php/1/core_admin/favicon/');
|
||||
$this->assertEquals(\tool_mfa\manager::NO_REDIRECT, \tool_mfa\manager::should_require_mfa($logourl, false));
|
||||
|
||||
// Access guidance files.
|
||||
$guideurl = new \moodle_url('/pluginfile.php/1/tool_mfa/guidance/0/capybara.png');
|
||||
$this->assertEquals(\tool_mfa\manager::NO_REDIRECT, \tool_mfa\manager::should_require_mfa($guideurl, false));
|
||||
|
||||
// Access private area.
|
||||
$user3 = $this->getDataGenerator()->create_user();
|
||||
$privateurl = new \moodle_url("/pluginfile.php/{$user3->id}/user/private/privatefile.png");
|
||||
$this->assertEquals(\tool_mfa\manager::REDIRECT, \tool_mfa\manager::should_require_mfa($privateurl, false));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -34,6 +34,10 @@ if (function_exists('opcache_reset')) {
|
||||
|
||||
define('IGNORE_COMPONENT_CACHE', true);
|
||||
|
||||
// It makes no sense to use BEHAT_CLI for this script (you cannot initialise PHPunit starting from
|
||||
// the Behat environment), so in case user has set tne environment variable, disable it.
|
||||
putenv('BEHAT_CLI=0');
|
||||
|
||||
require_once(__DIR__.'/../../../../lib/clilib.php');
|
||||
require_once(__DIR__.'/../../../../lib/phpunit/bootstraplib.php');
|
||||
require_once(__DIR__.'/../../../../lib/testing/lib.php');
|
||||
|
||||
@@ -30,6 +30,10 @@ if (isset($_SERVER['REMOTE_ADDR'])) {
|
||||
|
||||
define('IGNORE_COMPONENT_CACHE', true);
|
||||
|
||||
// It makes no sense to use BEHAT_CLI for this script (you cannot initialise PHPunit starting from
|
||||
// the Behat environment), so in case user has set tne environment variable, disable it.
|
||||
putenv('BEHAT_CLI=0');
|
||||
|
||||
require_once(__DIR__.'/../../../../lib/clilib.php');
|
||||
require_once(__DIR__.'/../../../../lib/phpunit/bootstraplib.php');
|
||||
require_once(__DIR__.'/../../../../lib/testing/lib.php');
|
||||
|
||||
@@ -42,7 +42,7 @@ $string['activate'] = 'Set status to "Active"';
|
||||
$string['activating'] = 'Activating a policy';
|
||||
$string['activateconfirm'] = '<p>You are about to activate policy <em>\'{$a->name}\'</em> and make the version <em>\'{$a->revision}\'</em> the current one.</p><p>All users will be required to agree to this new policy version to be able to use the site.</p>';
|
||||
$string['activateconfirmyes'] = 'Activate';
|
||||
$string['agreepolicies'] = 'Please agree to the following policies';
|
||||
$string['agreepolicies'] = 'Please agree to the following policies:';
|
||||
$string['backtoprevious'] = 'Go back to previous page';
|
||||
$string['backtotop'] = 'Back to top';
|
||||
$string['cachedef_policy_optional'] = 'Cache of the optional/compulsory flag for policy versions';
|
||||
@@ -74,8 +74,8 @@ $string['filterplaceholder'] = 'Search keyword or select filter';
|
||||
$string['filterpolicy'] = 'Policy: {$a}';
|
||||
$string['guestconsent:continue'] = 'Continue';
|
||||
$string['guestconsentmessage'] = 'If you continue browsing this website, you agree to our policies:';
|
||||
$string['iagree'] = 'I agree to the {$a}';
|
||||
$string['idontagree'] = 'No thanks, I decline {$a}';
|
||||
$string['iagree'] = 'I agree to the {$a}.';
|
||||
$string['idontagree'] = 'I don\'t agree to the {$a}.';
|
||||
$string['iagreetothepolicy'] = 'Give consent';
|
||||
$string['inactivate'] = 'Set status to "Inactive"';
|
||||
$string['inactivating'] = 'Inactivating a policy';
|
||||
@@ -94,9 +94,9 @@ $string['newpolicy'] = 'New policy';
|
||||
$string['newversion'] = 'New version';
|
||||
$string['noactivepolicies'] = 'There are no policies with an active version.';
|
||||
$string['nofiltersapplied'] = 'No filters applied';
|
||||
$string['nopermissiontoagreedocs'] = 'No permission to agree to the policies';
|
||||
$string['nopermissiontoagreedocs'] = 'No permission to agree to the policies.';
|
||||
$string['nopermissiontoagreedocs_desc'] = 'Sorry, you do not have the required permissions to agree to the policies.<br />You will not be able to use this site until the following policies are agreed:';
|
||||
$string['nopermissiontoagreedocsbehalf'] = 'No permission to agree to the policies on behalf of this user';
|
||||
$string['nopermissiontoagreedocsbehalf'] = 'No permission to agree to the policies on behalf of this user.';
|
||||
$string['nopermissiontoagreedocsbehalf_desc'] = 'Sorry, you do not have the required permission to agree to the following policies on behalf of {$a}:';
|
||||
$string['nopermissiontoagreedocscontact'] = 'For more help:';
|
||||
$string['nopermissiontoviewpolicyversion'] = 'You do not have permissions to view this policy version.';
|
||||
|
||||
@@ -34,13 +34,13 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
|
||||
Then I should see "This site policy"
|
||||
And I should not see "Course overview"
|
||||
And I press "Next"
|
||||
And I set the field "I agree to the This site policy" to "1"
|
||||
And I set the field "I agree to the This site policy." to "1"
|
||||
And I press "Next"
|
||||
And I should see "Calendar"
|
||||
And I log out
|
||||
And I log in as "manager"
|
||||
And I press "Next"
|
||||
And I set the field "I agree to the This site policy" to "1"
|
||||
And I set the field "I agree to the This site policy." to "1"
|
||||
And I press "Next"
|
||||
And I navigate to "Users > Privacy and policies > User agreements" in site administration
|
||||
And "Accepted" "text" should exist in the "User One" "table_row"
|
||||
@@ -53,7 +53,7 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
|
||||
| tool/policy:acceptbehalf | allow |
|
||||
When I log in as "manager"
|
||||
And I press "Next"
|
||||
And I set the field "I agree to the This site policy" to "1"
|
||||
And I set the field "I agree to the This site policy." to "1"
|
||||
And I press "Next"
|
||||
And I navigate to "Users > Privacy and policies > Manage policies" in site administration
|
||||
And I click on "1 of 4 (25%)" "link" in the "This site policy" "table_row"
|
||||
@@ -76,7 +76,7 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
|
||||
| tool/policy:acceptbehalf | allow |
|
||||
When I log in as "manager"
|
||||
And I press "Next"
|
||||
And I set the field "I agree to the This site policy" to "1"
|
||||
And I set the field "I agree to the This site policy." to "1"
|
||||
And I press "Next"
|
||||
And I should see "Calendar"
|
||||
And I navigate to "Users > Privacy and policies > Manage policies" in site administration
|
||||
@@ -104,16 +104,16 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
|
||||
And I press "Next"
|
||||
And I should see "This privacy policy"
|
||||
And I press "Next"
|
||||
And I set the field "I agree to the This site policy" to "1"
|
||||
And I set the field "I agree to the This privacy policy" to "1"
|
||||
And I set the field "I agree to the This site policy." to "1"
|
||||
And I set the field "I agree to the This privacy policy." to "1"
|
||||
And I press "Next"
|
||||
And I should see "Calendar"
|
||||
And I log out
|
||||
And I log in as "manager"
|
||||
And I press "Next"
|
||||
And I press "Next"
|
||||
And I set the field "I agree to the This site policy" to "1"
|
||||
And I set the field "I agree to the This privacy policy" to "1"
|
||||
And I set the field "I agree to the This site policy." to "1"
|
||||
And I set the field "I agree to the This privacy policy." to "1"
|
||||
And I press "Next"
|
||||
And I navigate to "Users > Privacy and policies > User agreements" in site administration
|
||||
And "Accepted" "text" should exist in the "User One" "table_row"
|
||||
@@ -142,8 +142,8 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
|
||||
When I log in as "manager"
|
||||
And I press "Next"
|
||||
And I press "Next"
|
||||
And I set the field "I agree to the This site policy" to "1"
|
||||
And I set the field "I agree to the This privacy policy" to "1"
|
||||
And I set the field "I agree to the This site policy." to "1"
|
||||
And I set the field "I agree to the This privacy policy." to "1"
|
||||
And I press "Next"
|
||||
And I navigate to "Users > Privacy and policies > User agreements" in site administration
|
||||
And I click on "Accept This site policy" "link" in the "User One" "table_row"
|
||||
@@ -176,8 +176,8 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
|
||||
When I log in as "manager"
|
||||
And I press "Next"
|
||||
And I press "Next"
|
||||
And I set the field "I agree to the This site policy" to "1"
|
||||
And I set the field "I agree to the This privacy policy" to "1"
|
||||
And I set the field "I agree to the This site policy." to "1"
|
||||
And I set the field "I agree to the This privacy policy." to "1"
|
||||
And I press "Next"
|
||||
And I navigate to "Users > Privacy and policies > User agreements" in site administration
|
||||
And I click on "Accept This site policy" "link" in the "User One" "table_row"
|
||||
@@ -198,7 +198,7 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
|
||||
Scenario: Policies and agreements profile link visible for current user
|
||||
Given I log in as "user1"
|
||||
And I press "Next"
|
||||
And I set the field "I agree to the This site policy" to "1"
|
||||
And I set the field "I agree to the This site policy." to "1"
|
||||
And I press "Next"
|
||||
When I follow "Profile" in the user menu
|
||||
# User can see his own agreements link in the profile.
|
||||
@@ -217,7 +217,7 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
|
||||
| tool/policy:acceptbehalf | allow |
|
||||
And I log in as "manager"
|
||||
And I press "Next"
|
||||
And I set the field "I agree to the This site policy" to "1"
|
||||
And I set the field "I agree to the This site policy." to "1"
|
||||
And I press "Next"
|
||||
# User can see agreements link in other user profiles because has the capability for accepting on behalf of them.
|
||||
When I am on "Course1" course homepage
|
||||
@@ -231,7 +231,7 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
|
||||
| tool/policy:acceptbehalf | allow |
|
||||
When I log in as "manager"
|
||||
And I press "Next"
|
||||
And I set the field "I agree to the This site policy" to "1"
|
||||
And I set the field "I agree to the This site policy." to "1"
|
||||
And I press "Next"
|
||||
And I log out
|
||||
And I am on the "manager" "user > profile" page logged in as "admin"
|
||||
@@ -267,8 +267,8 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
|
||||
When I log in as "manager"
|
||||
And I press "Next"
|
||||
And I press "Next"
|
||||
And I set the field "I agree to the This site policy" to "1"
|
||||
And I set the field "I agree to the This privacy policy" to "1"
|
||||
And I set the field "I agree to the This site policy." to "1"
|
||||
And I set the field "I agree to the This privacy policy." to "1"
|
||||
And I press "Next"
|
||||
And I navigate to "Users > Privacy and policies > User agreements" in site administration
|
||||
And I click on "Select" "checkbox" in the "User One" "table_row"
|
||||
@@ -290,7 +290,7 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
|
||||
And I should see "This site policy"
|
||||
And I should not see "Course overview"
|
||||
And I press "Next"
|
||||
And I set the field "I agree to the This site policy" to "1"
|
||||
And I set the field "I agree to the This site policy." to "1"
|
||||
And I press "Next"
|
||||
And I should see "Calendar"
|
||||
And I log out
|
||||
|
||||
@@ -4,7 +4,7 @@ Feature: User must accept policy managed by this plugin when logging in and sign
|
||||
As a user
|
||||
I need to be able to accept site policy during sign up
|
||||
|
||||
Scenario: Accept policy on sign up, no site policy
|
||||
Scenario: Accept policy on sign up manage by plugin, no site policy
|
||||
Given the following config values are set as admin:
|
||||
| registerauth | email |
|
||||
| passwordpolicy | 0 |
|
||||
@@ -16,13 +16,13 @@ Feature: User must accept policy managed by this plugin when logging in and sign
|
||||
And I set the following fields to these values:
|
||||
| Username | user1 |
|
||||
| Password | user1 |
|
||||
| Email address | user1@address.invalid |
|
||||
| Email (again) | user1@address.invalid |
|
||||
| Email address | user1@example.com |
|
||||
| Email (again) | user1@example.com |
|
||||
| First name | User1 |
|
||||
| Last name | L1 |
|
||||
And I press "Create my new account"
|
||||
And I should see "Confirm your account"
|
||||
And I should see "An email should have been sent to your address at user1@address.invalid"
|
||||
And I should see "An email should have been sent to your address at user1@example.com"
|
||||
And I confirm email for "user1"
|
||||
And I should see "Thanks, User1 L1"
|
||||
And I should see "Your registration has been confirmed"
|
||||
@@ -50,13 +50,13 @@ Feature: User must accept policy managed by this plugin when logging in and sign
|
||||
And I set the following fields to these values:
|
||||
| Username | user1 |
|
||||
| Password | user1 |
|
||||
| Email address | user1@address.invalid |
|
||||
| Email (again) | user1@address.invalid |
|
||||
| Email address | user1@example.com |
|
||||
| Email (again) | user1@example.com |
|
||||
| First name | User1 |
|
||||
| Last name | L1 |
|
||||
And I press "Create my new account"
|
||||
And I should see "Confirm your account"
|
||||
And I should see "An email should have been sent to your address at user1@address.invalid"
|
||||
And I should see "An email should have been sent to your address at user1@example.com"
|
||||
And I confirm email for "user1"
|
||||
And I should see "Thanks, User1 L1"
|
||||
And I should see "Your registration has been confirmed"
|
||||
@@ -85,23 +85,23 @@ Feature: User must accept policy managed by this plugin when logging in and sign
|
||||
And I should see "short text2"
|
||||
And I should see "full text2"
|
||||
And I press "Next"
|
||||
And I should see "Please agree to the following policies"
|
||||
And I should see "Please agree to the following policies:"
|
||||
And I should see "This site policy" in the "region-main" "region"
|
||||
And I should see "short text2"
|
||||
And I should not see "full text2"
|
||||
And I set the field "I agree to the This site policy" to "1"
|
||||
And I set the field "I agree to the This site policy." to "1"
|
||||
And I press "Next"
|
||||
And I should not see "I understand and agree"
|
||||
And I set the following fields to these values:
|
||||
| Username | user1 |
|
||||
| Password | user1 |
|
||||
| Email address | user1@address.invalid |
|
||||
| Email (again) | user1@address.invalid |
|
||||
| Email address | user1@example.com |
|
||||
| Email (again) | user1@example.com |
|
||||
| First name | User1 |
|
||||
| Last name | L1 |
|
||||
And I press "Create my new account"
|
||||
And I should see "Confirm your account"
|
||||
And I should see "An email should have been sent to your address at user1@address.invalid"
|
||||
And I should see "An email should have been sent to your address at user1@example.com"
|
||||
And I confirm email for "user1"
|
||||
And I should see "Thanks, User1 L1"
|
||||
And I should see "Your registration has been confirmed"
|
||||
@@ -137,7 +137,7 @@ Feature: User must accept policy managed by this plugin when logging in and sign
|
||||
And I should see "short text3"
|
||||
And I should see "full text3"
|
||||
And I press "Next"
|
||||
And I should see "Please agree to the following policies"
|
||||
And I should see "Please agree to the following policies:"
|
||||
And I should see "This site policy" in the "region-main" "region"
|
||||
And I should see "short text2"
|
||||
And I should not see "full text2"
|
||||
@@ -147,20 +147,20 @@ Feature: User must accept policy managed by this plugin when logging in and sign
|
||||
And I should not see "This guests policy" in the "region-main" "region"
|
||||
And I should not see "short text4"
|
||||
And I should not see "full text4"
|
||||
And I set the field "I agree to the This site policy" to "1"
|
||||
And I set the field "I agree to the This privacy policy" to "1"
|
||||
And I set the field "I agree to the This site policy." to "1"
|
||||
And I set the field "I agree to the This privacy policy." to "1"
|
||||
And I press "Next"
|
||||
And I should not see "I understand and agree"
|
||||
And I set the following fields to these values:
|
||||
| Username | user1 |
|
||||
| Password | user1 |
|
||||
| Email address | user1@address.invalid |
|
||||
| Email (again) | user1@address.invalid |
|
||||
| Email address | user1@example.com |
|
||||
| Email (again) | user1@example.com |
|
||||
| First name | User1 |
|
||||
| Last name | L1 |
|
||||
And I press "Create my new account"
|
||||
And I should see "Confirm your account"
|
||||
And I should see "An email should have been sent to your address at user1@address.invalid"
|
||||
And I should see "An email should have been sent to your address at user1@example.com"
|
||||
And I confirm email for "user1"
|
||||
And I should see "Thanks, User1 L1"
|
||||
And I should see "Your registration has been confirmed"
|
||||
@@ -197,23 +197,23 @@ Feature: User must accept policy managed by this plugin when logging in and sign
|
||||
And I should see "short text2"
|
||||
And I should see "full text2"
|
||||
And I press "Next"
|
||||
And I should see "Please agree to the following policies"
|
||||
And I should see "Please agree to the following policies:"
|
||||
And I should see "This site policy"
|
||||
And I should see "short text2"
|
||||
And I should not see "full text2"
|
||||
And I set the field "I agree to the This site policy" to "1"
|
||||
And I set the field "I agree to the This site policy." to "1"
|
||||
And I press "Next"
|
||||
And I should not see "I understand and agree"
|
||||
And I set the following fields to these values:
|
||||
| Username | user1 |
|
||||
| Password | user1 |
|
||||
| Email address | user1@address.invalid |
|
||||
| Email (again) | user1@address.invalid |
|
||||
| Email address | user1@example.com |
|
||||
| Email (again) | user1@example.com |
|
||||
| First name | User1 |
|
||||
| Last name | L1 |
|
||||
And I press "Create my new account"
|
||||
And I should see "Confirm your account"
|
||||
And I should see "An email should have been sent to your address at user1@address.invalid"
|
||||
And I should see "An email should have been sent to your address at user1@example.com"
|
||||
And I confirm email for "user1"
|
||||
And I should see "Thanks, User1 L1"
|
||||
And I should see "Your registration has been confirmed"
|
||||
@@ -244,19 +244,19 @@ Feature: User must accept policy managed by this plugin when logging in and sign
|
||||
And I press "Next"
|
||||
And I should see "This privacy policy"
|
||||
And I press "Next"
|
||||
And I should see "Please agree to the following policies"
|
||||
And I should see "Please agree to the following policies:"
|
||||
And I should see "This site policy"
|
||||
And I should see "This privacy policy"
|
||||
# Confirm that a notification is displayed if none of the policies are accepted.
|
||||
When I set the field "I agree to the This site policy" to "0"
|
||||
And I set the field "I agree to the This privacy policy" to "0"
|
||||
When I set the field "I agree to the This site policy." to "0"
|
||||
And I set the field "I agree to the This privacy policy." to "0"
|
||||
And I press "Next"
|
||||
Then I should see "Please agree to the following policies"
|
||||
Then I should see "Please agree to the following policies:"
|
||||
And I should see "Before continuing you need to acknowledge all these policies."
|
||||
# Confirm that a notification is displayed if only some policies are accepted.
|
||||
When I set the field "I agree to the This site policy" to "1"
|
||||
And I set the field "I agree to the This privacy policy" to "0"
|
||||
Then I should see "Please agree to the following policies"
|
||||
When I set the field "I agree to the This site policy." to "1"
|
||||
And I set the field "I agree to the This privacy policy." to "0"
|
||||
Then I should see "Please agree to the following policies:"
|
||||
And I should see "Before continuing you need to acknowledge all these policies."
|
||||
|
||||
Scenario: Accept policy on login, do not accept all policies
|
||||
@@ -276,23 +276,23 @@ Feature: User must accept policy managed by this plugin when logging in and sign
|
||||
And I press "Next"
|
||||
And I should see "This privacy policy"
|
||||
And I press "Next"
|
||||
And I should see "Please agree to the following policies"
|
||||
And I should see "Please agree to the following policies:"
|
||||
And I should see "This site policy"
|
||||
And I should see "This privacy policy"
|
||||
# Confirm that a notification is displayed if none of the policies are accepted.
|
||||
When I set the field "I agree to the This site policy" to "0"
|
||||
And I set the field "I agree to the This privacy policy" to "0"
|
||||
When I set the field "I agree to the This site policy." to "0"
|
||||
And I set the field "I agree to the This privacy policy." to "0"
|
||||
And I press "Next"
|
||||
Then I should see "Please agree to the following policies"
|
||||
Then I should see "Please agree to the following policies:"
|
||||
And I should see "Before continuing you need to acknowledge all these policies."
|
||||
# Confirm that a notification is displayed if only some policies are accepted.
|
||||
When I set the field "I agree to the This site policy" to "1"
|
||||
And I set the field "I agree to the This privacy policy" to "0"
|
||||
Then I should see "Please agree to the following policies"
|
||||
When I set the field "I agree to the This site policy." to "1"
|
||||
And I set the field "I agree to the This privacy policy." to "0"
|
||||
Then I should see "Please agree to the following policies:"
|
||||
And I should see "Before continuing you need to acknowledge all these policies."
|
||||
# Confirm that user can not browse the site (edit their profile).
|
||||
When I follow "Profile" in the user menu
|
||||
Then I should see "Please agree to the following policies"
|
||||
Then I should see "Please agree to the following policies:"
|
||||
|
||||
Scenario: Accept policy on login, accept all policies
|
||||
Given the following config values are set as admin:
|
||||
@@ -311,14 +311,14 @@ Feature: User must accept policy managed by this plugin when logging in and sign
|
||||
And I press "Next"
|
||||
And I should see "This privacy policy"
|
||||
And I press "Next"
|
||||
And I should see "Please agree to the following policies"
|
||||
And I should see "Please agree to the following policies:"
|
||||
And I should see "This site policy"
|
||||
And I should see "This privacy policy"
|
||||
# User accepts all policies.
|
||||
When I set the field "I agree to the This site policy" to "1"
|
||||
And I set the field "I agree to the This privacy policy" to "1"
|
||||
When I set the field "I agree to the This site policy." to "1"
|
||||
And I set the field "I agree to the This privacy policy." to "1"
|
||||
And I press "Next"
|
||||
Then I should not see "Please agree to the following policies"
|
||||
Then I should not see "Please agree to the following policies:"
|
||||
And I should not see "Before continuing you need to acknowledge all these policies."
|
||||
# Confirm that user can login and browse the site (edit their profile).
|
||||
When I open my profile in edit mode
|
||||
@@ -328,7 +328,7 @@ Feature: User must accept policy managed by this plugin when logging in and sign
|
||||
When I log in as "user1"
|
||||
Then I should not see "This site policy"
|
||||
And I should not see "This privacy policy"
|
||||
And I should not see "Please agree to the following policies"
|
||||
And I should not see "Please agree to the following policies:"
|
||||
# Confirm that user can login and browse the site (edit their profile).
|
||||
When I open my profile in edit mode
|
||||
Then the field "First name" matches value "User"
|
||||
@@ -350,14 +350,14 @@ Feature: User must accept policy managed by this plugin when logging in and sign
|
||||
And I press "Next"
|
||||
And I should see "This privacy policy"
|
||||
And I press "Next"
|
||||
And I should see "Please agree to the following policies"
|
||||
And I should see "Please agree to the following policies:"
|
||||
And I should see "This site policy"
|
||||
And I should see "This privacy policy"
|
||||
# User accepts all policies.
|
||||
When I set the field "I agree to the This site policy" to "1"
|
||||
And I set the field "I agree to the This privacy policy" to "1"
|
||||
When I set the field "I agree to the This site policy." to "1"
|
||||
And I set the field "I agree to the This privacy policy." to "1"
|
||||
And I press "Next"
|
||||
Then I should not see "Please agree to the following policies"
|
||||
Then I should not see "Please agree to the following policies:"
|
||||
# Confirm that user can login and browse the site (edit their profile).
|
||||
When I open my profile in edit mode
|
||||
Then the field "First name" matches value "User"
|
||||
@@ -385,7 +385,7 @@ Feature: User must accept policy managed by this plugin when logging in and sign
|
||||
And I should not see "This privacy policy"
|
||||
Then I should see "This third parties policy"
|
||||
And I press "Next"
|
||||
And I should see "Please agree to the following policies"
|
||||
And I should see "Please agree to the following policies:"
|
||||
And I should see "This third parties policy"
|
||||
And I set the field "This third parties policy" to "1"
|
||||
And I press "Next"
|
||||
@@ -407,12 +407,12 @@ Feature: User must accept policy managed by this plugin when logging in and sign
|
||||
And I log in as "user1"
|
||||
And I should see "This site policy"
|
||||
And I press "Next"
|
||||
And I should see "Please agree to the following policies"
|
||||
And I should see "Please agree to the following policies:"
|
||||
And I should see "This site policy"
|
||||
# User accepts policy.
|
||||
When I set the field "I agree to the This site policy" to "1"
|
||||
When I set the field "I agree to the This site policy." to "1"
|
||||
And I press "Next"
|
||||
Then I should not see "Please agree to the following policies"
|
||||
Then I should not see "Please agree to the following policies:"
|
||||
# Confirm that user can login and browse the site (edit their profile).
|
||||
When I open my profile in edit mode
|
||||
Then the field "First name" matches value "User"
|
||||
@@ -437,13 +437,13 @@ Feature: User must accept policy managed by this plugin when logging in and sign
|
||||
And I should see "short text2 new version"
|
||||
And I should see "full text2 new version"
|
||||
When I press "Next"
|
||||
Then I should see "Please agree to the following policies"
|
||||
Then I should see "Please agree to the following policies:"
|
||||
And I should see "This site policy new version"
|
||||
And I should see "short text2 new version"
|
||||
# User accepts policy.
|
||||
And I set the field "I agree to the This site policy new version" to "1"
|
||||
And I set the field "I agree to the This site policy new version." to "1"
|
||||
When I press "Next"
|
||||
Then I should not see "Please agree to the following policies"
|
||||
Then I should not see "Please agree to the following policies:"
|
||||
# Confirm that user can login and browse the site (edit their profile).
|
||||
When I open my profile in edit mode
|
||||
Then the field "First name" matches value "User"
|
||||
@@ -504,28 +504,28 @@ Feature: User must accept policy managed by this plugin when logging in and sign
|
||||
And I should see "short text3"
|
||||
And I should see "full text3"
|
||||
When I press "Next"
|
||||
Then I should see "Please agree to the following policies"
|
||||
Then I should see "Please agree to the following policies:"
|
||||
And I should see "This site policy" in the "region-main" "region"
|
||||
And I should see "short text2"
|
||||
And I should see "This privacy policy" in the "region-main" "region"
|
||||
And I should see "short text3"
|
||||
And I should not see "This guests policy" in the "region-main" "region"
|
||||
And I should not see "short text4"
|
||||
And I set the field "I agree to the This site policy" to "1"
|
||||
And I set the field "I agree to the This privacy policy" to "1"
|
||||
And I set the field "I agree to the This site policy." to "1"
|
||||
And I set the field "I agree to the This privacy policy." to "1"
|
||||
When I press "Next"
|
||||
Then I should not see "I understand and agree"
|
||||
And I should see "New account"
|
||||
And I set the following fields to these values:
|
||||
| Username | user1 |
|
||||
| Password | user1 |
|
||||
| Email address | user1@address.invalid |
|
||||
| Email (again) | user1@address.invalid |
|
||||
| Email address | user1@example.com |
|
||||
| Email (again) | user1@example.com |
|
||||
| First name | User1 |
|
||||
| Last name | L1 |
|
||||
When I press "Create my new account"
|
||||
Then I should see "Confirm your account"
|
||||
And I should see "An email should have been sent to your address at user1@address.invalid"
|
||||
And I should see "An email should have been sent to your address at user1@example.com"
|
||||
And I follow "Log in"
|
||||
When I click on "Create new account" "link"
|
||||
# Confirm that the user can view and accept policies when attempting to create another account.
|
||||
@@ -537,7 +537,7 @@ Feature: User must accept policy managed by this plugin when logging in and sign
|
||||
And I should see "short text3"
|
||||
And I should see "full text3"
|
||||
When I press "Next"
|
||||
Then I should see "Please agree to the following policies"
|
||||
Then I should see "Please agree to the following policies:"
|
||||
And I should see "This site policy" in the "region-main" "region"
|
||||
And I should see "short text2"
|
||||
And I should not see "full text2"
|
||||
@@ -547,8 +547,8 @@ Feature: User must accept policy managed by this plugin when logging in and sign
|
||||
And I should not see "This guests policy" in the "region-main" "region"
|
||||
And I should not see "short text4"
|
||||
And I should not see "full text4"
|
||||
And I set the field "I agree to the This site policy" to "1"
|
||||
And I set the field "I agree to the This privacy policy" to "1"
|
||||
And I set the field "I agree to the This site policy." to "1"
|
||||
And I set the field "I agree to the This privacy policy." to "1"
|
||||
When I press "Next"
|
||||
Then I should not see "I understand and agree"
|
||||
And I should see "New account"
|
||||
@@ -572,8 +572,8 @@ Feature: User must accept policy managed by this plugin when logging in and sign
|
||||
And I should see "Please read our This privacy policy"
|
||||
And I press "Next"
|
||||
And I should see "Viewing this page on behalf of User 1"
|
||||
And I set the field "I agree to the This site policy" to "1"
|
||||
And I set the field "I agree to the This privacy policy" to "1"
|
||||
And I set the field "I agree to the This site policy." to "1"
|
||||
And I set the field "I agree to the This privacy policy." to "1"
|
||||
And I press "Next"
|
||||
And I log out
|
||||
And I log in as "user1"
|
||||
@@ -599,15 +599,15 @@ Feature: User must accept policy managed by this plugin when logging in and sign
|
||||
When I log in as "manager"
|
||||
And I press "Next"
|
||||
And I press "Next"
|
||||
And I set the field "I agree to the This site policy" to "1"
|
||||
And I set the field "I agree to the This privacy policy" to "1"
|
||||
And I set the field "I agree to the This site policy." to "1"
|
||||
And I set the field "I agree to the This privacy policy." to "1"
|
||||
And I press "Next"
|
||||
And I am on the "user1" "user > profile" page
|
||||
And I follow "Log in as"
|
||||
Then I should see "You are logged in as User 1"
|
||||
And I press "Continue"
|
||||
And I should see "Policies and agreements"
|
||||
And I should see "No permission to agree to the policies on behalf of this user"
|
||||
And I should see "No permission to agree to the policies on behalf of this user."
|
||||
And I should see "Sorry, you do not have the required permission to agree to the following policies on behalf of User 1"
|
||||
|
||||
Scenario: Accept policy on sign up as a guest, one policy
|
||||
@@ -631,23 +631,23 @@ Feature: User must accept policy managed by this plugin when logging in and sign
|
||||
And I should see "short text2"
|
||||
And I should see "full text2"
|
||||
And I press "Next"
|
||||
And I should see "Please agree to the following policies"
|
||||
And I should see "Please agree to the following policies:"
|
||||
And I should see "This site policy"
|
||||
And I should see "short text2"
|
||||
And I should not see "full text2"
|
||||
And I set the field "I agree to the This site policy" to "1"
|
||||
And I set the field "I agree to the This site policy." to "1"
|
||||
And I press "Next"
|
||||
And I should not see "I understand and agree"
|
||||
And I set the following fields to these values:
|
||||
| Username | user1 |
|
||||
| Password | user1 |
|
||||
| Email address | user1@address.invalid |
|
||||
| Email (again) | user1@address.invalid |
|
||||
| Email address | user1@example.com |
|
||||
| Email (again) | user1@example.com |
|
||||
| First name | User1 |
|
||||
| Last name | L1 |
|
||||
And I press "Create my new account"
|
||||
And I should see "Confirm your account"
|
||||
And I should see "An email should have been sent to your address at user1@address.invalid"
|
||||
And I should see "An email should have been sent to your address at user1@example.com"
|
||||
And I confirm email for "user1"
|
||||
And I should see "Thanks, User1 L1"
|
||||
And I should see "Your registration has been confirmed"
|
||||
@@ -680,12 +680,12 @@ Feature: User must accept policy managed by this plugin when logging in and sign
|
||||
Then I should see "Digital maturity declaration" in the "region-main" "region"
|
||||
And I should see "You declare be old enough"
|
||||
And I should see "Here goes content."
|
||||
And I press "I agree to the Digital maturity declaration"
|
||||
And I press "I agree to the Digital maturity declaration."
|
||||
# The second policy with the agreement style "on its own page" must be accepted now.
|
||||
And I should see "Terms of Service" in the "region-main" "region"
|
||||
And I should see "We teach, you learn"
|
||||
And I should see "Here goes content."
|
||||
And I press "I agree to the Terms of Service"
|
||||
And I press "I agree to the Terms of Service."
|
||||
# Only now we see the remaining consent page policies.
|
||||
And I should see "Policy 1 out of 2"
|
||||
And I should see "Privacy policy" in the "region-main" "region"
|
||||
@@ -697,26 +697,26 @@ Feature: User must accept policy managed by this plugin when logging in and sign
|
||||
And I should see "We eat cookies, srsly"
|
||||
And I should see "Here goes content."
|
||||
And I press "Next"
|
||||
And I should see "Please agree to the following policies"
|
||||
And I should see "Please agree to the following policies:"
|
||||
And I should see "Privacy policy"
|
||||
And I should see "Cookies policy"
|
||||
And I should not see "Digital maturity declaration" in the "region-main" "region"
|
||||
And I should not see "Terms of Service" in the "region-main" "region"
|
||||
And I should not see "Here goes content."
|
||||
And I set the field "I agree to the Privacy policy" to "1"
|
||||
And I set the field "I agree to the Cookies policy" to "1"
|
||||
And I set the field "I agree to the Privacy policy." to "1"
|
||||
And I set the field "I agree to the Cookies policy." to "1"
|
||||
And I press "Next"
|
||||
And I should see "New account"
|
||||
And I set the following fields to these values:
|
||||
| Username | user1 |
|
||||
| Password | user1 |
|
||||
| Email address | user1@address.invalid |
|
||||
| Email (again) | user1@address.invalid |
|
||||
| Email address | user1@example.com |
|
||||
| Email (again) | user1@example.com |
|
||||
| First name | User1 |
|
||||
| Last name | L1 |
|
||||
And I press "Create my new account"
|
||||
And I should see "Confirm your account"
|
||||
And I should see "An email should have been sent to your address at user1@address.invalid"
|
||||
And I should see "An email should have been sent to your address at user1@example.com"
|
||||
And I confirm email for "user1"
|
||||
And I should see "Thanks, User1 L1"
|
||||
And I should see "Your registration has been confirmed"
|
||||
@@ -751,7 +751,7 @@ Feature: User must accept policy managed by this plugin when logging in and sign
|
||||
Then I should see "Digital maturity declaration" in the "region-main" "region"
|
||||
And I should see "You declare be old enough"
|
||||
And I should see "Here goes content."
|
||||
And I press "I agree to the Digital maturity declaration"
|
||||
And I press "I agree to the Digital maturity declaration."
|
||||
# The second policy with the agreement style "on its own page" must be accepted now.
|
||||
And I should see "Terms of Service" in the "region-main" "region"
|
||||
And I should see "We teach, you learn"
|
||||
@@ -762,7 +762,7 @@ Feature: User must accept policy managed by this plugin when logging in and sign
|
||||
And I should see "Terms of Service" in the "region-main" "region"
|
||||
And I should see "We teach, you learn"
|
||||
And I should see "Here goes content."
|
||||
And I press "I agree to the Terms of Service"
|
||||
And I press "I agree to the Terms of Service."
|
||||
# Only now we see the remaining consent page policies.
|
||||
And I should see "Policy 1 out of 2"
|
||||
And I should see "Privacy policy" in the "region-main" "region"
|
||||
@@ -774,14 +774,14 @@ Feature: User must accept policy managed by this plugin when logging in and sign
|
||||
And I should see "We eat cookies, srsly"
|
||||
And I should see "Here goes content."
|
||||
And I press "Next"
|
||||
And I should see "Please agree to the following policies"
|
||||
And I should see "Please agree to the following policies:"
|
||||
And I should see "Privacy policy"
|
||||
And I should see "Cookies policy"
|
||||
And I should not see "Digital maturity declaration" in the "region-main" "region"
|
||||
And I should not see "Terms of Service" in the "region-main" "region"
|
||||
And I should not see "Here goes content."
|
||||
And I set the field "I agree to the Privacy policy" to "1"
|
||||
And I set the field "I agree to the Cookies policy" to "1"
|
||||
And I set the field "I agree to the Privacy policy." to "1"
|
||||
And I set the field "I agree to the Cookies policy." to "1"
|
||||
And I press "Next"
|
||||
And I follow "Profile" in the user menu
|
||||
# User can see his own agreements in the profile.
|
||||
@@ -809,15 +809,15 @@ Feature: User must accept policy managed by this plugin when logging in and sign
|
||||
Then I should see "Privacy policy" in the "region-main" "region"
|
||||
And I should see "We scan your thoughts"
|
||||
And I should see "Here goes content."
|
||||
And I press "I agree to the Privacy policy"
|
||||
And I press "I agree to the Privacy policy."
|
||||
And I should see "Digital maturity declaration" in the "region-main" "region"
|
||||
And I should see "You declare be old enough"
|
||||
And I should see "Here goes content."
|
||||
And I press "I agree to the Digital maturity declaration"
|
||||
And I press "I agree to the Digital maturity declaration."
|
||||
And I should see "Terms of Service" in the "region-main" "region"
|
||||
And I should see "We teach, you learn"
|
||||
And I should see "Here goes content."
|
||||
And I press "I agree to the Terms of Service"
|
||||
And I press "I agree to the Terms of Service."
|
||||
And I follow "Profile" in the user menu
|
||||
And I follow "Policies and agreements"
|
||||
And "Accepted" "text" should exist in the "Privacy policy" "table_row"
|
||||
@@ -844,21 +844,21 @@ Feature: User must accept policy managed by this plugin when logging in and sign
|
||||
Then I should see "Digital maturity declaration" in the "region-main" "region"
|
||||
And I should see "You declare be old enough"
|
||||
And I should see "Here goes content."
|
||||
And I press "I agree to the Digital maturity declaration"
|
||||
And I press "I agree to the Digital maturity declaration."
|
||||
And I should see "Cookies policy" in the "region-main" "region"
|
||||
And I should see "We eat cookies, srsly"
|
||||
And I press "I agree to the Cookies policy"
|
||||
And I press "I agree to the Cookies policy."
|
||||
And I should see "New account"
|
||||
And I set the following fields to these values:
|
||||
| Username | user1 |
|
||||
| Password | user1 |
|
||||
| Email address | user1@address.invalid |
|
||||
| Email (again) | user1@address.invalid |
|
||||
| Email address | user1@example.com |
|
||||
| Email (again) | user1@example.com |
|
||||
| First name | User1 |
|
||||
| Last name | L1 |
|
||||
And I press "Create my new account"
|
||||
And I should see "Confirm your account"
|
||||
And I should see "An email should have been sent to your address at user1@address.invalid"
|
||||
And I should see "An email should have been sent to your address at user1@example.com"
|
||||
And I confirm email for "user1"
|
||||
And I should see "Thanks, User1 L1"
|
||||
And I should see "Your registration has been confirmed"
|
||||
|
||||
@@ -61,7 +61,7 @@ Feature: Manage policies
|
||||
| Policy1 | v1 | full text2 | short text2 | active |
|
||||
And I log in as "manager"
|
||||
And I press "Next"
|
||||
And I set the field "I agree to the Policy1" to "1"
|
||||
And I set the field "I agree to the Policy1." to "1"
|
||||
And I press "Next"
|
||||
And I navigate to "Users > Privacy and policies > Manage policies" in site administration
|
||||
And I click on "Edit" "link" in the "Policy1" "table_row"
|
||||
@@ -83,7 +83,7 @@ Feature: Manage policies
|
||||
| Policy1 | v1 | full text2 | short text2 | active |
|
||||
And I log in as "manager"
|
||||
And I press "Next"
|
||||
And I set the field "I agree to the Policy1" to "1"
|
||||
And I set the field "I agree to the Policy1." to "1"
|
||||
And I press "Next"
|
||||
And I navigate to "Users > Privacy and policies > Manage policies" in site administration
|
||||
And I click on "Edit" "link" in the "Policy1" "table_row"
|
||||
@@ -101,7 +101,7 @@ Feature: Manage policies
|
||||
| Policy1 | v1 | full text2 | short text2 | active |
|
||||
And I log in as "manager"
|
||||
And I press "Next"
|
||||
And I set the field "I agree to the Policy1" to "1"
|
||||
And I set the field "I agree to the Policy1." to "1"
|
||||
And I press "Next"
|
||||
And I navigate to "Users > Privacy and policies > Manage policies" in site administration
|
||||
And I click on "Edit" "link" in the "Policy1" "table_row"
|
||||
@@ -180,7 +180,7 @@ Feature: Manage policies
|
||||
| Policy1 | v1 | full text2 | short text2 | active |
|
||||
And I log in as "manager"
|
||||
And I press "Next"
|
||||
And I set the field "I agree to the Policy1" to "1"
|
||||
And I set the field "I agree to the Policy1." to "1"
|
||||
And I press "Next"
|
||||
And I navigate to "Users > Privacy and policies > Manage policies" in site administration
|
||||
And I click on "Set status to \"Inactive\"" "link" in the "Policy1" "table_row"
|
||||
@@ -218,7 +218,7 @@ Feature: Manage policies
|
||||
| Policy1 | v1 | full text2 | short text2 | active |
|
||||
And I log in as "manager"
|
||||
And I press "Next"
|
||||
And I set the field "I agree to the Policy1" to "1"
|
||||
And I set the field "I agree to the Policy1." to "1"
|
||||
And I press "Next"
|
||||
And I navigate to "Users > Privacy and policies > Manage policies" in site administration
|
||||
And I click on "Set status to \"Inactive\"" "link" in the "Policy1" "table_row"
|
||||
@@ -247,7 +247,7 @@ Feature: Manage policies
|
||||
| Policy1 | v1 | full text2 | short text2 | active |
|
||||
And I log in as "user1"
|
||||
And I press "Next"
|
||||
And I set the field "I agree to the Policy1" to "1"
|
||||
And I set the field "I agree to the Policy1." to "1"
|
||||
And I press "Next"
|
||||
And I follow "Preferences" in the user menu
|
||||
And I should see "Preferences"
|
||||
|
||||
@@ -70,26 +70,26 @@ Feature: Optional policies
|
||||
And I should see "OwnPageCompulsory1" in the "region-main" "region"
|
||||
And I should see "short text4" in the "region-main" "region"
|
||||
And I should see "full text4" in the "region-main" "region"
|
||||
And I press "I agree to the OwnPageCompulsory1"
|
||||
And I press "I agree to the OwnPageCompulsory1."
|
||||
# Compulsory policies displayed on the consent page are shown next and must be agreed.
|
||||
And I should see "ConsentPageCompulsory1"
|
||||
And I should see "short text3" in the "region-main" "region"
|
||||
And I should see "full text3" in the "region-main" "region"
|
||||
And I press "Next"
|
||||
And I should see "Please agree to the following policies"
|
||||
And I set the field "I agree to the ConsentPageCompulsory1" to "1"
|
||||
And I should see "Please agree to the following policies:"
|
||||
And I set the field "I agree to the ConsentPageCompulsory1." to "1"
|
||||
And I press "Next"
|
||||
# The signup form can be submitted and a new account created.
|
||||
And I set the following fields to these values:
|
||||
| Username | user3 |
|
||||
| Password | user3 |
|
||||
| Email address | user3@address.invalid |
|
||||
| Email (again) | user3@address.invalid |
|
||||
| Email address | user3@example.com |
|
||||
| Email (again) | user3@example.com |
|
||||
| First name | User3 |
|
||||
| Last name | L3 |
|
||||
And I press "Create my new account"
|
||||
And I should see "Confirm your account"
|
||||
And I should see "An email should have been sent to your address at user3@address.invalid"
|
||||
And I should see "An email should have been sent to your address at user3@example.com"
|
||||
And I confirm email for "user3"
|
||||
And I should see "Thanks, User3 L3"
|
||||
And I should see "Your registration has been confirmed"
|
||||
@@ -99,7 +99,7 @@ Feature: Optional policies
|
||||
Then I should see "OwnPageOptional1"
|
||||
And I should see "short text5" in the "region-main" "region"
|
||||
And I should see "full text5" in the "region-main" "region"
|
||||
And I press "No thanks, I decline OwnPageOptional1"
|
||||
And I press "I don't agree to the OwnPageOptional1"
|
||||
# Then come policies displayed on the consent page.
|
||||
And I should see "ConsentPageOptional1" in the "region-main" "region"
|
||||
And I should see "short text1" in the "region-main" "region"
|
||||
@@ -109,9 +109,9 @@ Feature: Optional policies
|
||||
And I should see "short text2" in the "region-main" "region"
|
||||
And I should see "full text2" in the "region-main" "region"
|
||||
And I press "Next"
|
||||
And I should see "Please agree to the following policies"
|
||||
And I set the field "I agree to the ConsentPageOptional1" to "1"
|
||||
And I set the field "No thanks, I decline ConsentPageOptional2" to "0"
|
||||
And I should see "Please agree to the following policies:"
|
||||
And I set the field "I agree to the ConsentPageOptional1." to "1"
|
||||
And I set the field "I don't agree to the ConsentPageOptional2" to "0"
|
||||
And I press "Next"
|
||||
# Accepted and declined policies are shown in the profile.
|
||||
And I follow "Profile" in the user menu
|
||||
@@ -132,14 +132,14 @@ Feature: Optional policies
|
||||
Then I should see "OwnPageOptional1"
|
||||
And I should see "short text5" in the "region-main" "region"
|
||||
And I should see "full text5" in the "region-main" "region"
|
||||
And I press "I agree to the OwnPageOptional1"
|
||||
And I press "I agree to the OwnPageOptional1."
|
||||
# Then come policies displayed on the consent page.
|
||||
And I should see "ConsentPageOptional1" in the "region-main" "region"
|
||||
And I should see "short text1" in the "region-main" "region"
|
||||
And I should see "full text1" in the "region-main" "region"
|
||||
And I press "Next"
|
||||
And I should see "Please agree to the following policies"
|
||||
And I set the field "No thanks, I decline ConsentPageOptional1" to "0"
|
||||
And I should see "Please agree to the following policies:"
|
||||
And I set the field "I don't agree to the ConsentPageOptional1" to "0"
|
||||
And I press "Next"
|
||||
# Accepted and declined policies are shown in the profile.
|
||||
And I follow "Profile" in the user menu
|
||||
@@ -152,7 +152,7 @@ Feature: Optional policies
|
||||
| Name | Content | Summary | Agreementstyle | Optional |
|
||||
| OwnPageOptional1 | full text1 | short text1 | 1 | 1 |
|
||||
And I log in as "user1"
|
||||
And I press "I agree to the OwnPageOptional1"
|
||||
And I press "I agree to the OwnPageOptional1."
|
||||
And I follow "Profile" in the user menu
|
||||
And I follow "Policies and agreements"
|
||||
And "Accepted" "text" should exist in the "OwnPageOptional1" "table_row"
|
||||
@@ -177,7 +177,7 @@ Feature: Optional policies
|
||||
| Name | Content | Summary | Agreementstyle | Optional |
|
||||
| OwnPageOptional1 | full text1 | short text1 | 1 | 1 |
|
||||
And I log in as "user1"
|
||||
And I press "I agree to the OwnPageOptional1"
|
||||
And I press "I agree to the OwnPageOptional1."
|
||||
And I follow "Profile" in the user menu
|
||||
And I follow "Policies and agreements"
|
||||
And "Accepted" "text" should exist in the "OwnPageOptional1" "table_row"
|
||||
@@ -202,12 +202,12 @@ Feature: Optional policies
|
||||
| OwnPageOptional1 | full text1 | short text1 | 1 | 1 |
|
||||
| OwnPageOptional2 | full text2 | short text2 | 1 | 1 |
|
||||
And I log in as "user1"
|
||||
And I press "I agree to the OwnPageOptional1"
|
||||
And I press "No thanks, I decline OwnPageOptional2"
|
||||
And I press "I agree to the OwnPageOptional1."
|
||||
And I press "I don't agree to the OwnPageOptional2"
|
||||
And I log out
|
||||
And I log in as "manager"
|
||||
And I press "I agree to the OwnPageOptional1"
|
||||
And I press "I agree to the OwnPageOptional2"
|
||||
And I press "I agree to the OwnPageOptional1."
|
||||
And I press "I agree to the OwnPageOptional2."
|
||||
When I navigate to "Users > Privacy and policies > User agreements" in site administration
|
||||
# User One has accepted just some policies.
|
||||
Then "Partially accepted" "text" should exist in the "User One" "table_row"
|
||||
@@ -228,8 +228,8 @@ Feature: Optional policies
|
||||
| OwnPageOptional1 | full text1 | short text1 | 1 | 1 |
|
||||
| OwnPageOptional2 | full text2 | short text2 | 1 | 1 |
|
||||
And I log in as "user1"
|
||||
And I press "I agree to the OwnPageOptional1"
|
||||
And I press "No thanks, I decline OwnPageOptional2"
|
||||
And I press "I agree to the OwnPageOptional1."
|
||||
And I press "I don't agree to the OwnPageOptional2"
|
||||
And I log out
|
||||
And I log in as "admin"
|
||||
When I navigate to "Users > Privacy and policies > User agreements" in site administration
|
||||
|
||||
@@ -178,12 +178,7 @@ class tool_uploadcourse_helper {
|
||||
* @return enrol_plugin[]
|
||||
*/
|
||||
public static function get_enrolment_plugins() {
|
||||
$cache = cache::make('tool_uploadcourse', 'helper');
|
||||
if (($enrol = $cache->get('enrol')) === false) {
|
||||
$enrol = enrol_get_plugins(false);
|
||||
$cache->set('enrol', $enrol);
|
||||
}
|
||||
return $enrol;
|
||||
return enrol_get_plugins(false);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -208,12 +208,11 @@ class helper {
|
||||
* @return \moodle_url The URL.
|
||||
*/
|
||||
public static function get_duplicate_tour_link($tourid) {
|
||||
$link = new \moodle_url('/admin/tool/usertours/configure.php', [
|
||||
return new \moodle_url('/admin/tool/usertours/configure.php', [
|
||||
'action' => manager::ACTION_DUPLICATETOUR,
|
||||
'id' => $tourid,
|
||||
'sesskey' => sesskey(),
|
||||
]);
|
||||
|
||||
return $link;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -503,8 +503,9 @@ class manager {
|
||||
* @param int $tourid The ID of the tour to duplicate.
|
||||
*/
|
||||
protected function duplicate_tour($tourid) {
|
||||
$tour = helper::get_tour($tourid);
|
||||
require_sesskey();
|
||||
|
||||
$tour = helper::get_tour($tourid);
|
||||
$export = $tour->to_record();
|
||||
// Remove the id.
|
||||
unset($export->id);
|
||||
|
||||
@@ -102,7 +102,6 @@ $string['name'] = 'Name';
|
||||
$string['name_help'] = 'The name of a tour may be added as plain text, enclosed in multilang tags (for use with the multi-language content filter) if required.
|
||||
|
||||
Alternatively, a language string ID may be entered in the format identifier,component (with no brackets or space after the comma).';
|
||||
$string['newstep'] = 'Create step';
|
||||
$string['newstep'] = 'New step';
|
||||
$string['newtour'] = 'Create a new tour';
|
||||
$string['next'] = 'Next';
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
@tool @tool_xmldb
|
||||
Feature: The Reconcile XMLDB files report works and all the files are ok
|
||||
In order to ensure that all the XMLDB Editor xml files are generated properly
|
||||
As a developer
|
||||
I need to be able to run the Reconcile XMLDB files report and verify that everything is ok
|
||||
|
||||
Scenario: The Reconcile XMLDB files reports that all files are ok
|
||||
Given I log in as "admin"
|
||||
And I navigate to "Development > XMLDB editor" in site administration
|
||||
When I follow "[Reconcile XMLDB files]"
|
||||
Then I should see "Look for XMLDB files needing reconciling"
|
||||
And I should see "All files are OK. No reconciling is needed."
|
||||
@@ -1925,6 +1925,7 @@ class model {
|
||||
$uniqueid = $this->get_time_splitting()->append_rangeindex($dbprediction->sampleid, $dbprediction->rangeindex);
|
||||
$predictionrecords[$uniqueid]->id = $dbprediction->id;
|
||||
}
|
||||
$dbpredictions->close();
|
||||
}
|
||||
|
||||
return $predictionrecords;
|
||||
|
||||
@@ -15,13 +15,13 @@ Feature: User must accept policy when logging in and signing up
|
||||
And I set the following fields to these values:
|
||||
| Username | user1 |
|
||||
| Password | user1 |
|
||||
| Email address | user1@address.invalid |
|
||||
| Email (again) | user1@address.invalid |
|
||||
| Email address | student1@example.com |
|
||||
| Email (again) | student1@example.com |
|
||||
| First name | User1 |
|
||||
| Last name | L1 |
|
||||
And I press "Create my new account"
|
||||
And I should see "Confirm your account"
|
||||
And I should see "An email should have been sent to your address at user1@address.invalid"
|
||||
And I should see "An email should have been sent to your address at student1@example.com"
|
||||
And I confirm email for "user1"
|
||||
And I should see "Thanks, User1 L1"
|
||||
And I should see "Your registration has been confirmed"
|
||||
@@ -45,14 +45,14 @@ Feature: User must accept policy when logging in and signing up
|
||||
And I set the following fields to these values:
|
||||
| Username | user1 |
|
||||
| Password | user1 |
|
||||
| Email address | user1@address.invalid |
|
||||
| Email (again) | user1@address.invalid |
|
||||
| Email address | user1@example.com |
|
||||
| Email (again) | user1@example.com |
|
||||
| First name | User1 |
|
||||
| Last name | L1 |
|
||||
| I understand and agree | 1 |
|
||||
And I press "Create my new account"
|
||||
And I should see "Confirm your account"
|
||||
And I should see "An email should have been sent to your address at user1@address.invalid"
|
||||
And I should see "An email should have been sent to your address at user1@example.com"
|
||||
And I confirm email for "user1"
|
||||
And I should see "Thanks, User1 L1"
|
||||
And I should see "Your registration has been confirmed"
|
||||
@@ -67,8 +67,8 @@ Feature: User must accept policy when logging in and signing up
|
||||
Scenario Outline: Email validation during email registration
|
||||
Given the following config values are set as admin:
|
||||
| allowaccountssameemail | <allowsameemail> |
|
||||
| registerauth | email |
|
||||
| passwordpolicy | 0 |
|
||||
| registerauth | email |
|
||||
| passwordpolicy | 0 |
|
||||
And the following "users" exist:
|
||||
| username | firstname | lastname | email |
|
||||
| s1 | John | Doe | s1@example.com |
|
||||
|
||||
@@ -117,6 +117,11 @@ abstract class frontend {
|
||||
foreach ($enabled as $plugin => $info) {
|
||||
// Create plugin front-end object.
|
||||
$class = '\availability_' . $plugin . '\frontend';
|
||||
if (!class_exists($class)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
/** @var \core_availability\frontend $frontend */
|
||||
$frontend = new $class();
|
||||
|
||||
// Add to array of required YUI modules.
|
||||
|
||||
@@ -792,11 +792,10 @@ abstract class info {
|
||||
// plugin could also rely on the completion plugin.
|
||||
$pluginmanager = \core_plugin_manager::instance();
|
||||
$enabled = $pluginmanager->get_enabled_plugins('availability');
|
||||
$componentparams = new \stdClass();
|
||||
foreach ($enabled as $plugin => $info) {
|
||||
// Use the static method.
|
||||
/** @var \core_availability\condition $class */
|
||||
$class = '\availability_' . $plugin . '\condition';
|
||||
if ($class::completion_value_used($course, $cmid)) {
|
||||
if (class_exists($class) && $class::completion_value_used($course, $cmid)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -220,9 +220,9 @@ class tree extends tree_node {
|
||||
|
||||
// First see if it's a condition. These have a defined type.
|
||||
if (isset($child->type)) {
|
||||
// Look for a plugin of this type.
|
||||
/** @var \core_availability\condition $classname */
|
||||
$classname = '\availability_' . $child->type . '\condition';
|
||||
if (!array_key_exists($child->type, $enabled)) {
|
||||
if (!array_key_exists($child->type, $enabled) || !class_exists($classname)) {
|
||||
if ($lax) {
|
||||
// On load of existing settings, ignore if class
|
||||
// doesn't exist.
|
||||
|
||||
@@ -197,8 +197,7 @@ abstract class restore_qtype_plugin extends restore_plugin {
|
||||
$this->questionanswercacheid = $newquestionid;
|
||||
// Cache all cleaned answers for a simple text match.
|
||||
foreach ($answers as $answer) {
|
||||
// MDL-30018: Clean in the same way as {@link xml_writer::xml_safe_utf8()}.
|
||||
$clean = preg_replace('/[\x-\x8\xb-\xc\xe-\x1f\x7f]/is','', $answer->answer); // Clean CTRL chars.
|
||||
$clean = core_text::trim_ctrl_chars($answer->answer); // Clean CTRL chars.
|
||||
$clean = preg_replace("/\r\n|\r/", "\n", $clean); // Normalize line ending.
|
||||
$this->questionanswercache[$clean] = $answer->id;
|
||||
}
|
||||
|
||||
@@ -5271,8 +5271,7 @@ class restore_create_categories_and_questions extends restore_structure_step {
|
||||
$potentialhints = $DB->get_records('question_hints',
|
||||
array('questionid' => $newquestionid), '', 'id, hint');
|
||||
foreach ($potentialhints as $potentialhint) {
|
||||
// Clean in the same way than {@link xml_writer::xml_safe_utf8()}.
|
||||
$cleanhint = preg_replace('/[\x-\x8\xb-\xc\xe-\x1f\x7f]/is','', $potentialhint->hint); // Clean CTRL chars.
|
||||
$cleanhint = core_text::trim_ctrl_chars($potentialhint->hint); // Clean CTRL chars.
|
||||
$cleanhint = preg_replace("/\r\n|\r/", "\n", $cleanhint); // Normalize line ending.
|
||||
if ($cleanhint === $data->hint) {
|
||||
$newitemid = $data->id;
|
||||
|
||||
@@ -253,14 +253,14 @@ class xml_writer {
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform some UTF-8 cleaning, stripping the control chars (\x0-\x1f)
|
||||
* but tabs (\x9), newlines (\xa) and returns (\xd). The delete control
|
||||
* Perform some UTF-8 cleaning, stripping the control chars (\x00-\x1f)
|
||||
* but tabs (\x09), newlines (\xa) and returns (\xd). The delete control
|
||||
* char (\x7f) is also included. All them are forbiden in XML 1.0 specs.
|
||||
* The expression below seems to be UTF-8 safe too because it simply
|
||||
* ignores the rest of characters. Also normalize linefeeds and return chars.
|
||||
*/
|
||||
protected function xml_safe_utf8($content) {
|
||||
$content = preg_replace('/[\x-\x8\xb-\xc\xe-\x1f\x7f]/is', '', $content ?? ''); // clean CTRL chars.
|
||||
$content = core_text::trim_ctrl_chars($content ?? '');
|
||||
$content = preg_replace("/\r\n|\r/", "\n", $content); // Normalize line&return=>line
|
||||
return fix_utf8($content);
|
||||
}
|
||||
|
||||
+112
-58
@@ -60,6 +60,7 @@ if (!empty($issuedbadge->recipient->id)) {
|
||||
$assertionid = $assertion->get_assertion_hash();
|
||||
$assertionentityid = $assertiondata['id'];
|
||||
$badgeadded = false;
|
||||
$issuerexists = false;
|
||||
if (badges_open_badges_backpack_api() == OPEN_BADGES_V2) {
|
||||
$sitebackpack = badges_get_site_primary_backpack();
|
||||
$api = new \core_badges\backpack_api($sitebackpack);
|
||||
@@ -71,62 +72,75 @@ if (!empty($issuedbadge->recipient->id)) {
|
||||
$issuer = $assertion->get_issuer();
|
||||
if (!($issuerentityid = badges_external_get_mapping($sitebackpack->id, OPEN_BADGES_V2_TYPE_ISSUER, $issuer['email']))) {
|
||||
$response = $api->put_issuer($issuer);
|
||||
if (!$response) {
|
||||
throw new moodle_exception('invalidrequest', 'error');
|
||||
if ($response) {
|
||||
$issuerexists = true;
|
||||
$issuerentityid = $response->id;
|
||||
badges_external_create_mapping(
|
||||
$sitebackpack->id,
|
||||
OPEN_BADGES_V2_TYPE_ISSUER,
|
||||
$issuer['email'],
|
||||
$issuerentityid,
|
||||
);
|
||||
}
|
||||
$issuerentityid = $response->id;
|
||||
badges_external_create_mapping($sitebackpack->id, OPEN_BADGES_V2_TYPE_ISSUER, $issuer['email'],
|
||||
$issuerentityid);
|
||||
}
|
||||
// Create badge.
|
||||
$badge = $assertion->get_badge_class(false);
|
||||
$badgeid = $assertion->get_badge_id();
|
||||
if (!($badgeentityid = badges_external_get_mapping($sitebackpack->id, OPEN_BADGES_V2_TYPE_BADGE, $badgeid))) {
|
||||
$response = $api->put_badgeclass($issuerentityid, $badge);
|
||||
if (!$response) {
|
||||
throw new moodle_exception('invalidrequest', 'error');
|
||||
if ($issuerexists) {
|
||||
// Create badge.
|
||||
$badge = $assertion->get_badge_class(false);
|
||||
$badgeid = $assertion->get_badge_id();
|
||||
if (!($badgeentityid = badges_external_get_mapping($sitebackpack->id, OPEN_BADGES_V2_TYPE_BADGE, $badgeid))) {
|
||||
$response = $api->put_badgeclass($issuerentityid, $badge);
|
||||
if ($response) {
|
||||
$badgeentityid = $response->id;
|
||||
badges_external_create_mapping(
|
||||
$sitebackpack->id,
|
||||
OPEN_BADGES_V2_TYPE_BADGE,
|
||||
$badgeid,
|
||||
$badgeentityid,
|
||||
);
|
||||
}
|
||||
}
|
||||
$badgeentityid = $response->id;
|
||||
badges_external_create_mapping($sitebackpack->id, OPEN_BADGES_V2_TYPE_BADGE, $badgeid,
|
||||
$badgeentityid);
|
||||
}
|
||||
|
||||
// Create assertion (Award the badge!).
|
||||
$assertionentityid = badges_external_get_mapping(
|
||||
$sitebackpack->id,
|
||||
OPEN_BADGES_V2_TYPE_ASSERTION,
|
||||
$assertionid
|
||||
);
|
||||
|
||||
if ($assertionentityid && strpos($sitebackpack->backpackapiurl, 'badgr')) {
|
||||
$assertionentityid = badges_generate_badgr_open_url(
|
||||
$sitebackpack,
|
||||
OPEN_BADGES_V2_TYPE_ASSERTION,
|
||||
$assertionentityid
|
||||
);
|
||||
}
|
||||
|
||||
// Create an assertion for the recipient in the issuer's account.
|
||||
if (!$assertionentityid) {
|
||||
$response = $api->put_badgeclass_assertion($badgeentityid, $assertiondata);
|
||||
if (!$response) {
|
||||
throw new moodle_exception('invalidrequest', 'error');
|
||||
}
|
||||
$assertionentityid = badges_generate_badgr_open_url($sitebackpack, OPEN_BADGES_V2_TYPE_ASSERTION, $response->id);
|
||||
$badgeadded = true;
|
||||
badges_external_create_mapping($sitebackpack->id, OPEN_BADGES_V2_TYPE_ASSERTION, $assertionid,
|
||||
$response->id);
|
||||
} else {
|
||||
// An assertion already exists. Make sure it's up to date.
|
||||
$internalid = badges_external_get_mapping(
|
||||
// Create assertion (Award the badge!).
|
||||
$assertionentityid = badges_external_get_mapping(
|
||||
$sitebackpack->id,
|
||||
OPEN_BADGES_V2_TYPE_ASSERTION,
|
||||
$assertionid,
|
||||
'externalid'
|
||||
$assertionid
|
||||
);
|
||||
$response = $api->update_assertion($internalid, $assertiondata);
|
||||
if (!$response) {
|
||||
throw new moodle_exception('invalidrequest', 'error');
|
||||
|
||||
if ($assertionentityid && strpos($sitebackpack->backpackapiurl, 'badgr')) {
|
||||
$assertionentityid = badges_generate_badgr_open_url(
|
||||
$sitebackpack,
|
||||
OPEN_BADGES_V2_TYPE_ASSERTION,
|
||||
$assertionentityid
|
||||
);
|
||||
}
|
||||
|
||||
// Create an assertion for the recipient in the issuer's account.
|
||||
if (!$assertionentityid) {
|
||||
$response = $api->put_badgeclass_assertion($badgeentityid, $assertiondata);
|
||||
if ($response) {
|
||||
$assertionentityid = badges_generate_badgr_open_url(
|
||||
$sitebackpack,
|
||||
OPEN_BADGES_V2_TYPE_ASSERTION,
|
||||
$response->id,
|
||||
);
|
||||
$badgeadded = true;
|
||||
badges_external_create_mapping(
|
||||
$sitebackpack->id,
|
||||
OPEN_BADGES_V2_TYPE_ASSERTION,
|
||||
$assertionid,
|
||||
$response->id,
|
||||
);
|
||||
}
|
||||
} else {
|
||||
// An assertion already exists. Make sure it's up to date.
|
||||
$internalid = badges_external_get_mapping(
|
||||
$sitebackpack->id,
|
||||
OPEN_BADGES_V2_TYPE_ASSERTION,
|
||||
$assertionid,
|
||||
'externalid'
|
||||
);
|
||||
$response = $api->update_assertion($internalid, $assertiondata);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -136,21 +150,61 @@ if (!empty($issuedbadge->recipient->id)) {
|
||||
// - If a user and site backpack have the same provider we can skip this as Badgr automatically maps recipients
|
||||
// based on email address.
|
||||
// - This is only needed when the backpacks are from different regions.
|
||||
if ($assertionentityid && !badges_external_get_mapping($userbackpack->id, OPEN_BADGES_V2_TYPE_ASSERTION, $assertionid)) {
|
||||
if (
|
||||
$assertionentityid
|
||||
&& (!$issuerexists || !badges_external_get_mapping($userbackpack->id, OPEN_BADGES_V2_TYPE_ASSERTION, $assertionid))
|
||||
) {
|
||||
$userapi = new \core_badges\backpack_api($userbackpack, $backpack);
|
||||
$userapi->authenticate();
|
||||
$response = $userapi->import_badge_assertion($assertionentityid);
|
||||
if (!$response) {
|
||||
throw new moodle_exception('invalidrequest', 'error');
|
||||
if ($response) {
|
||||
$assertionentityid = $response->id;
|
||||
$badgeadded = true;
|
||||
badges_external_create_mapping(
|
||||
$userbackpack->id,
|
||||
OPEN_BADGES_V2_TYPE_ASSERTION,
|
||||
$assertionid,
|
||||
$assertionentityid,
|
||||
);
|
||||
}
|
||||
$assertionentityid = $response->id;
|
||||
$badgeadded = true;
|
||||
badges_external_create_mapping($userbackpack->id, OPEN_BADGES_V2_TYPE_ASSERTION, $assertionid,
|
||||
$assertionentityid);
|
||||
}
|
||||
|
||||
$response = $badgeadded ? ['success' => 'addedtobackpack'] : ['warning' => 'existsinbackpack'];
|
||||
redirect(new moodle_url('/badges/mybadges.php', $response));
|
||||
if ($badgeadded) {
|
||||
$message = get_string('addedtobackpack', 'badges');
|
||||
$messagetype = \core\output\notification::NOTIFY_SUCCESS;
|
||||
} else {
|
||||
if (isset($userapi) && !empty($userapi->get_errors())) {
|
||||
// If the api used to import the badge to the backpack has errors, show them to inform the user.
|
||||
if (array_filter($userapi->get_errors(), fn($element) => str_contains($element, "DUPLICATE_BADGE"))) {
|
||||
// Duplicated badges are displayed as a warning.
|
||||
$message = get_string('existsinbackpack', 'badges');
|
||||
$messagetype = \core\output\notification::NOTIFY_WARNING;
|
||||
} else {
|
||||
// If the userapi has any other errors, we will use those to inform the user.
|
||||
$message = get_string(
|
||||
'error:cannotsendtobackpack',
|
||||
'badges',
|
||||
implode($userapi->get_errors()),
|
||||
);
|
||||
$messagetype = \core\output\notification::NOTIFY_ERROR;
|
||||
}
|
||||
} else if (isset($api) && !empty($api->get_errors())) {
|
||||
// If the api used to create/update the issuer has errors, show them to inform the user.
|
||||
$errors = $api->get_errors() ?? [get_string('invalidrequest', 'error')];
|
||||
$message = get_string(
|
||||
'error:cannotsendtobackpack',
|
||||
'badges',
|
||||
implode($errors),
|
||||
);
|
||||
$messagetype = \core\output\notification::NOTIFY_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
redirect(
|
||||
url: new moodle_url('/badges/mybadges.php'),
|
||||
message: $message,
|
||||
messagetype: $messagetype,
|
||||
);
|
||||
} else {
|
||||
redirect(new moodle_url('/badges/mybadges.php'));
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ if ($action == 'delete' && $confirm && confirm_sesskey()) {
|
||||
} else {
|
||||
$msg = get_string('sitebackpacknotdeleted', 'badges');
|
||||
}
|
||||
} else if ($action == 'moveup' || $action == 'movedown') {
|
||||
} else if (($action == 'moveup' || $action == 'movedown') && confirm_sesskey()) {
|
||||
// If no backpack has been selected, there isn't anything to move.
|
||||
if (empty($id)) {
|
||||
redirect($url);
|
||||
|
||||
@@ -668,6 +668,20 @@ class backpack_api {
|
||||
return backpack_api_mapping::get_authentication_error();
|
||||
}
|
||||
|
||||
/**
|
||||
* List all errors occurred during the requests to the backpack.
|
||||
*
|
||||
* @return array The list of errors.
|
||||
*/
|
||||
public function get_errors(): array {
|
||||
$errors = [];
|
||||
foreach ($this->mappings as $mapping) {
|
||||
$errors = array_merge($errors, $mapping->get_errors());
|
||||
}
|
||||
|
||||
return $errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of badges in a collection.
|
||||
*
|
||||
|
||||
@@ -85,6 +85,9 @@ class backpack_api_mapping {
|
||||
/** @var int OpenBadges version 1 or 2. */
|
||||
protected $backpackapiversion;
|
||||
|
||||
/** @var array Errors encountered during the request. */
|
||||
protected $errors = [];
|
||||
|
||||
/**
|
||||
* Create a mapping.
|
||||
*
|
||||
@@ -150,6 +153,26 @@ class backpack_api_mapping {
|
||||
return self::$authenticationerror;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the errors encountered during the request.
|
||||
*
|
||||
* @return array The list of errors.
|
||||
*/
|
||||
public function get_errors() {
|
||||
return $this->errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an error to the list of errors.
|
||||
*
|
||||
* @param string $error The error message.
|
||||
* @return self This instance for method chaining.
|
||||
*/
|
||||
public function add_error(string $error): self {
|
||||
$this->errors[] = $error;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Does the action match this mapping?
|
||||
*
|
||||
@@ -372,6 +395,23 @@ class backpack_api_mapping {
|
||||
$response = $curl->put($url, $post, $options);
|
||||
}
|
||||
$response = json_decode($response);
|
||||
if ($response === null) {
|
||||
$this->add_error(get_string('invalidrequest', 'error'));
|
||||
return null;
|
||||
}
|
||||
if (isset($response->status) && isset($response->status->success) && $response->status->success != true) {
|
||||
// If the response wasn't successful, store the errors and return null.
|
||||
if (isset($response->validationErrors)) {
|
||||
$error = implode(', ', $response->validationErrors);
|
||||
} else if (isset($response->status->description)) {
|
||||
$error = $response->status->description;
|
||||
} else {
|
||||
$error = get_string('invalidrequest', 'error');
|
||||
}
|
||||
$this->add_error($error);
|
||||
return null;
|
||||
}
|
||||
|
||||
if (isset($response->result)) {
|
||||
$response = $response->result;
|
||||
}
|
||||
|
||||
@@ -56,13 +56,13 @@
|
||||
<td> {{{backpackweburl}}} </td>
|
||||
<td>
|
||||
{{#canmoveup}}
|
||||
<a href="{{baseurl}}?id={{id}}&action=moveup">{{#pix}}t/up, core,{{#str}}moveup{{/str}}{{/pix}}</a>
|
||||
<a href="{{baseurl}}?id={{id}}&sesskey={{sesskey}}&action=moveup">{{#pix}}t/up, core,{{#str}}moveup{{/str}}{{/pix}}</a>
|
||||
{{/canmoveup}}
|
||||
{{^canmoveup}}
|
||||
{{#pix}}spacer, moodle{{/pix}}
|
||||
{{/canmoveup}}
|
||||
{{#canmovedown}}
|
||||
<a href="{{baseurl}}?id={{id}}&action=movedown">{{#pix}}t/down, core,{{#str}}movedown{{/str}}{{/pix}}</a>
|
||||
<a href="{{baseurl}}?id={{id}}&sesskey={{sesskey}}&action=movedown">{{#pix}}t/down, core,{{#str}}movedown{{/str}}{{/pix}}</a>
|
||||
{{/canmovedown}}
|
||||
{{^canmovedown}}
|
||||
{{#pix}}spacer, moodle{{/pix}}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Script to let a user edit the properties of a particular RSS feed.
|
||||
* Script to let a user view the output of a particular RSS feed.
|
||||
*
|
||||
* @package block_rss_client
|
||||
* @copyright 2009 Tim Hunt
|
||||
@@ -26,9 +26,6 @@ require_once(__DIR__ . '/../../config.php');
|
||||
require_once($CFG->libdir .'/simplepie/moodle_simplepie.php');
|
||||
|
||||
require_login();
|
||||
if (isguestuser()) {
|
||||
throw new \moodle_exception('guestsarenotallowed');
|
||||
}
|
||||
|
||||
$returnurl = optional_param('returnurl', '', PARAM_LOCALURL);
|
||||
$courseid = optional_param('courseid', 0, PARAM_INT);
|
||||
@@ -46,6 +43,11 @@ if ($courseid) {
|
||||
$PAGE->set_context($context);
|
||||
}
|
||||
|
||||
$managesharedfeeds = has_capability('block/rss_client:manageanyfeeds', $context);
|
||||
if (!$managesharedfeeds) {
|
||||
require_capability('block/rss_client:manageownfeeds', $context);
|
||||
}
|
||||
|
||||
$urlparams = array('rssid' => $rssid);
|
||||
if ($courseid) {
|
||||
$urlparams['courseid'] = $courseid;
|
||||
@@ -56,10 +58,18 @@ if ($returnurl) {
|
||||
$PAGE->set_url('/blocks/rss_client/viewfeed.php', $urlparams);
|
||||
$PAGE->set_pagelayout('popup');
|
||||
|
||||
$rssrecord = $DB->get_record('block_rss_client', array('id' => $rssid), '*', MUST_EXIST);
|
||||
if ($managesharedfeeds) {
|
||||
$select = 'id = :id AND (userid = :userid OR shared = 1)';
|
||||
} else {
|
||||
$select = 'id = :id AND userid = :userid';
|
||||
}
|
||||
|
||||
$rssrecord = $DB->get_record_select('block_rss_client', $select, [
|
||||
'id' => $rssid,
|
||||
'userid' => $USER->id,
|
||||
], '*', MUST_EXIST);
|
||||
|
||||
$rss = new moodle_simplepie($rssrecord->url);
|
||||
|
||||
if ($rss->error()) {
|
||||
debugging($rss->error());
|
||||
throw new \moodle_exception('errorfetchingrssfeed');
|
||||
|
||||
+26
-17
@@ -34,15 +34,21 @@ $PAGE->set_url(new moodle_url('/blog/external_blogs.php'));
|
||||
require_capability('moodle/blog:manageexternal', $context);
|
||||
|
||||
$delete = optional_param('delete', null, PARAM_INT);
|
||||
$confirm = optional_param('confirm', false, PARAM_BOOL);
|
||||
|
||||
$strexternalblogs = get_string('externalblogs', 'blog');
|
||||
$straddnewexternalblog = get_string('addnewexternalblog', 'blog');
|
||||
$strblogs = get_string('blogs', 'blog');
|
||||
$message = null;
|
||||
|
||||
if ($delete && confirm_sesskey()) {
|
||||
$externalblog = $DB->get_record('blog_external', array('id' => $delete));
|
||||
if ($externalblog->userid == $USER->id) {
|
||||
$PAGE->set_title("{$strblogs}: {$strexternalblogs}");
|
||||
$PAGE->set_pagelayout('standard');
|
||||
|
||||
if ($delete) {
|
||||
$externalblog = $DB->get_record('blog_external', ['id' => $delete, 'userid' => $USER->id], '*', MUST_EXIST);
|
||||
|
||||
if ($confirm) {
|
||||
require_sesskey();
|
||||
|
||||
// Delete the external blog.
|
||||
$DB->delete_records('blog_external', array('id' => $delete));
|
||||
|
||||
@@ -60,23 +66,28 @@ if ($delete && confirm_sesskey()) {
|
||||
$event = \core\event\blog_external_removed::create($eventparms);
|
||||
$event->add_record_snapshot('blog_external', $externalblog);
|
||||
$event->trigger();
|
||||
$message = get_string('externalblogdeleted', 'blog');
|
||||
|
||||
redirect($PAGE->url, get_string('externalblogdeleted', 'blog'));
|
||||
} else {
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading("{$strexternalblogs}: " . s($externalblog->name), 2);
|
||||
|
||||
echo $OUTPUT->confirm(
|
||||
get_string('deleteexternalblog', 'blog'),
|
||||
new moodle_url($PAGE->url->out_omit_querystring(), ['delete' => $delete, 'confirm' => 1]),
|
||||
$PAGE->url,
|
||||
);
|
||||
|
||||
echo $OUTPUT->footer();
|
||||
die;
|
||||
}
|
||||
}
|
||||
|
||||
$blogs = $DB->get_records('blog_external', array('userid' => $USER->id));
|
||||
|
||||
$PAGE->set_heading(fullname($USER));
|
||||
$PAGE->set_title("$strblogs: $strexternalblogs");
|
||||
$PAGE->set_pagelayout('standard');
|
||||
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading($strexternalblogs, 2);
|
||||
|
||||
if (!empty($message)) {
|
||||
echo $OUTPUT->notification($message);
|
||||
}
|
||||
|
||||
echo $OUTPUT->box_start('generalbox boxaligncenter');
|
||||
|
||||
if (!empty($blogs)) {
|
||||
@@ -99,10 +110,8 @@ if (!empty($blogs)) {
|
||||
$editurl = new moodle_url('/blog/external_blog_edit.php', array('id' => $blog->id));
|
||||
$editicon = $OUTPUT->action_icon($editurl, new pix_icon('t/edit', get_string('editexternalblog', 'blog')));
|
||||
|
||||
$deletelink = new moodle_url('/blog/external_blogs.php', array('delete' => $blog->id, 'sesskey' => sesskey()));
|
||||
$action = new confirm_action(get_string('externalblogdeleteconfirm', 'blog'));
|
||||
$deleteicon = $OUTPUT->action_icon($deletelink, new pix_icon('t/delete', get_string('deleteexternalblog', 'blog')),
|
||||
$action);
|
||||
$deletelink = new moodle_url('/blog/external_blogs.php', ['delete' => $blog->id]);
|
||||
$deleteicon = $OUTPUT->action_icon($deletelink, new pix_icon('t/delete', get_string('deleteexternalblog', 'blog')));
|
||||
|
||||
$table->data[] = new html_table_row(array($blog->name,
|
||||
$blog->url,
|
||||
|
||||
@@ -55,11 +55,11 @@ class cohorts extends system_report {
|
||||
"{$entitymainalias}.component");
|
||||
|
||||
// Check if report needs to show a specific category.
|
||||
$contextid = $this->get_parameter('contextid', 0, PARAM_INT);
|
||||
$showall = $this->get_parameter('showall', true, PARAM_BOOL);
|
||||
if (!$showall) {
|
||||
if (!$this->get_context() instanceof context_system || !$this->get_parameter('showall', false, PARAM_BOOL)) {
|
||||
$paramcontextid = database::generate_param_name();
|
||||
$this->add_base_condition_sql("{$entitymainalias}.contextid = :$paramcontextid", [$paramcontextid => $contextid]);
|
||||
$this->add_base_condition_sql("{$entitymainalias}.contextid = :{$paramcontextid}", [
|
||||
$paramcontextid => $this->get_context()->id,
|
||||
]);
|
||||
}
|
||||
|
||||
// Now we can call our helper methods to add the content we want to include in the report.
|
||||
@@ -77,14 +77,7 @@ class cohorts extends system_report {
|
||||
* @return bool
|
||||
*/
|
||||
protected function can_view(): bool {
|
||||
$contextid = $this->get_parameter('contextid', 0, PARAM_INT);
|
||||
if ($contextid) {
|
||||
$context = context::instance_by_id($contextid, MUST_EXIST);
|
||||
} else {
|
||||
$context = context_system::instance();
|
||||
}
|
||||
|
||||
return has_any_capability(['moodle/cohort:manage', 'moodle/cohort:view'], $context);
|
||||
return has_any_capability(['moodle/cohort:manage', 'moodle/cohort:view'], $this->get_context());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -98,10 +91,8 @@ class cohorts extends system_report {
|
||||
public function add_columns(cohort $cohortentity): void {
|
||||
|
||||
$entitymainalias = $cohortentity->get_table_alias('cohort');
|
||||
$showall = $this->get_parameter('showall', false, PARAM_BOOL);
|
||||
|
||||
// Category column. An extra callback is appended in order to extend the current column formatting.
|
||||
if ($showall) {
|
||||
if ($this->get_context() instanceof context_system && $this->get_parameter('showall', false, PARAM_BOOL)) {
|
||||
$this->add_column_from_entity('cohort:context')
|
||||
->add_callback(static function(string $value, stdClass $cohort): string {
|
||||
$context = context::instance_by_id($cohort->contextid);
|
||||
@@ -195,10 +186,11 @@ class cohorts extends system_report {
|
||||
*/
|
||||
protected function add_actions(): void {
|
||||
|
||||
$contextid = $this->get_parameter('contextid', 0, PARAM_INT);
|
||||
$showall = $this->get_parameter('showall', true, PARAM_BOOL);
|
||||
$returnurl = (new moodle_url('/cohort/index.php',
|
||||
['id' => ':id', 'contextid' => $contextid, 'showall' => $showall]))->out(false);
|
||||
$returnurl = (new moodle_url('/cohort/index.php', [
|
||||
'id' => ':id',
|
||||
'contextid' => $this->get_context()->id,
|
||||
'showall' => $this->get_parameter('showall', false, PARAM_BOOL),
|
||||
]))->out(false);
|
||||
|
||||
// Hide action. It will be only shown if the property 'visible' is true and user has 'moodle/cohort:manage' capabillity.
|
||||
$this->add_action((new action(
|
||||
|
||||
+1
-2
@@ -104,8 +104,7 @@ if ($editcontrols = cohort_edit_controls($context, $baseurl)) {
|
||||
echo $OUTPUT->render($editcontrols);
|
||||
}
|
||||
|
||||
$reportparams = ['contextid' => $context->id, 'showall' => $showall];
|
||||
$report = system_report_factory::create(cohorts::class, $context, '', '', 0, $reportparams);
|
||||
$report = system_report_factory::create(cohorts::class, $context, '', '', 0, ['showall' => $showall]);
|
||||
|
||||
// Check if it needs to search by name.
|
||||
if (!empty($searchquery)) {
|
||||
|
||||
+35
-10
@@ -941,6 +941,8 @@ class core_course_external extends external_api {
|
||||
$params = self::validate_parameters(self::create_courses_parameters(),
|
||||
array('courses' => $courses));
|
||||
|
||||
$courseconfig = get_config('moodlecourse');
|
||||
|
||||
$availablethemes = core_component::get_plugin_list('theme');
|
||||
$availablelangs = get_string_manager()->get_list_of_translations();
|
||||
|
||||
@@ -967,6 +969,14 @@ class core_course_external extends external_api {
|
||||
throw new moodle_exception('errorinvalidparam', 'webservice', '', 'shortname');
|
||||
}
|
||||
|
||||
// Make sure start/end date are correctly set.
|
||||
if (!array_key_exists('startdate', $course)) {
|
||||
$course['startdate'] = usergetmidnight(time());
|
||||
}
|
||||
if (!array_key_exists('enddate', $course) && $courseconfig->courseenddateenabled) {
|
||||
$course['enddate'] = $course['startdate'] + $courseconfig->courseduration;
|
||||
}
|
||||
|
||||
// Make sure lang is valid
|
||||
if (array_key_exists('lang', $course)) {
|
||||
if (empty($availablelangs[$course['lang']])) {
|
||||
@@ -988,6 +998,8 @@ class core_course_external extends external_api {
|
||||
}
|
||||
}
|
||||
|
||||
$course['showactivitydates'] = $courseconfig->showactivitydates;
|
||||
|
||||
//force visibility if ws user doesn't have the permission to set it
|
||||
$category = $DB->get_record('course_categories', array('id' => $course['categoryid']));
|
||||
if (!has_capability('moodle/course:visibility', $context)) {
|
||||
@@ -995,7 +1007,6 @@ class core_course_external extends external_api {
|
||||
}
|
||||
|
||||
//set default value for completion
|
||||
$courseconfig = get_config('moodlecourse');
|
||||
if (completion_info::is_enabled_for_site()) {
|
||||
if (!array_key_exists('enablecompletion', $course)) {
|
||||
$course['enablecompletion'] = $courseconfig->enablecompletion;
|
||||
@@ -4252,7 +4263,7 @@ class core_course_external extends external_api {
|
||||
|
||||
self::validate_context($usercontext);
|
||||
|
||||
if ($userid != $USER->id and !has_capability('moodle/user:viewdetails', $usercontext)) {
|
||||
if ($userid != $USER->id && !has_capability('moodle/user:viewalldetails', $usercontext)) {
|
||||
return array();
|
||||
}
|
||||
|
||||
@@ -4302,22 +4313,28 @@ class core_course_external extends external_api {
|
||||
* @param int $groupid Group id from which the users will be obtained
|
||||
* @param bool $onlyactive Whether to return only the active enrolled users or all enrolled users in the course.
|
||||
* @return array List of users
|
||||
* @throws invalid_parameter_exception
|
||||
*/
|
||||
public static function get_enrolled_users_by_cmid(int $cmid, int $groupid = 0, bool $onlyactive = false) {
|
||||
global $PAGE;
|
||||
global $PAGE;
|
||||
|
||||
$warnings = [];
|
||||
|
||||
self::validate_parameters(self::get_enrolled_users_by_cmid_parameters(), [
|
||||
'cmid' => $cmid,
|
||||
'groupid' => $groupid,
|
||||
'onlyactive' => $onlyactive,
|
||||
[
|
||||
'cmid' => $cmid,
|
||||
'groupid' => $groupid,
|
||||
'onlyactive' => $onlyactive,
|
||||
] = self::validate_parameters(self::get_enrolled_users_by_cmid_parameters(), [
|
||||
'cmid' => $cmid,
|
||||
'groupid' => $groupid,
|
||||
'onlyactive' => $onlyactive,
|
||||
]);
|
||||
|
||||
list($course, $cm) = get_course_and_cm_from_cmid($cmid);
|
||||
$coursecontext = context_course::instance($course->id);
|
||||
self::validate_context($coursecontext);
|
||||
|
||||
course_require_view_participants($coursecontext);
|
||||
|
||||
$enrolledusers = get_enrolled_users($coursecontext, '', $groupid, 'u.*', null, 0, 0, $onlyactive);
|
||||
|
||||
$users = array_map(function ($user) use ($PAGE) {
|
||||
@@ -4596,9 +4613,17 @@ class core_course_external extends external_api {
|
||||
$coursecontext = context_course::instance($courseid);
|
||||
self::validate_context($coursecontext);
|
||||
|
||||
$activeplugin = get_config('core', 'activitychooseractivefooter');
|
||||
// The active plugin must be set, and be present on the site.
|
||||
$activeplugin = clean_param(
|
||||
get_config('core', 'activitychooseractivefooter'),
|
||||
PARAM_COMPONENT,
|
||||
);
|
||||
|
||||
if ($activeplugin !== COURSE_CHOOSER_FOOTER_NONE) {
|
||||
if (
|
||||
$activeplugin !== COURSE_CHOOSER_FOOTER_NONE &&
|
||||
!empty($activeplugin) &&
|
||||
core_component::get_component_directory($activeplugin) !== null
|
||||
) {
|
||||
$footerdata = component_callback($activeplugin, 'custom_chooser_footer', [$courseid, $sectionid]);
|
||||
return [
|
||||
'footer' => true,
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -422,8 +422,10 @@ export default class {
|
||||
* @param {array} cmIds the list of course modules ids
|
||||
* @param {bool} complete the new completion value
|
||||
*/
|
||||
cmCompletion(stateManager, cmIds, complete) {
|
||||
async cmCompletion(stateManager, cmIds, complete) {
|
||||
const newState = (complete) ? 1 : 0;
|
||||
const action = (newState == 1) ? 'cm_complete' : 'cm_uncomplete';
|
||||
const logEntry = this._getLoggerEntry(stateManager, action, cmIds);
|
||||
stateManager.setReadOnly(false);
|
||||
cmIds.forEach((id) => {
|
||||
const element = stateManager.get('cm', id);
|
||||
@@ -433,6 +435,7 @@ export default class {
|
||||
}
|
||||
});
|
||||
stateManager.setReadOnly(true);
|
||||
stateManager.addLoggerEntry(await logEntry);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -362,6 +362,9 @@ class stateactions {
|
||||
// We need to get the latest modinfo on each iteration because the section numbers change.
|
||||
$modinfo = get_fast_modinfo($course);
|
||||
$section = $modinfo->get_section_info_by_id($sectionid, MUST_EXIST);
|
||||
if (!course_can_delete_section($course, $section)) {
|
||||
continue;
|
||||
}
|
||||
// Send all activity deletions.
|
||||
if (!empty($modinfo->sections[$section->section])) {
|
||||
foreach ($modinfo->sections[$section->section] as $modnumber) {
|
||||
|
||||
@@ -150,47 +150,3 @@ Feature: Course index completion icons
|
||||
| 1 | False |
|
||||
When I am on the "C1" "Course" page logged in as "student1"
|
||||
And "Done" "icon" should exist in the "courseindex-content" "region"
|
||||
|
||||
@javascript
|
||||
Scenario: Activities with custom completion rules could fail
|
||||
Given the following "activity" exists:
|
||||
| activity | scorm |
|
||||
| course | C1 |
|
||||
| name | Music history |
|
||||
| packagefilepath | mod/scorm/tests/packages/RuntimeMinimumCalls_SCORM12-mini.zip |
|
||||
| maxattempt | 1 |
|
||||
| latattemptlock | 1 |
|
||||
# Add requirements
|
||||
| completion | 2 |
|
||||
| completionscorerequired | 90 |
|
||||
Given I am on the "Music history" "scorm activity" page logged in as student1
|
||||
# We need a little taller window because Firefox is, apparently, unable to auto-scroll within
|
||||
# an iframe, so we need to ensure that the "Save changes" button is visible in the viewport.
|
||||
And I change window size to "large"
|
||||
And I press "Enter"
|
||||
And I switch to the main frame
|
||||
And I click on "Par?" "list_item"
|
||||
And I switch to "scorm_object" iframe
|
||||
And I wait until the page is ready
|
||||
And I switch to the main frame
|
||||
And I click on "Keeping Score" "list_item"
|
||||
And I switch to "scorm_object" iframe
|
||||
And I wait until the page is ready
|
||||
And I switch to the main frame
|
||||
And I click on "Other Scoring Systems" "list_item"
|
||||
And I switch to "scorm_object" iframe
|
||||
And I wait until the page is ready
|
||||
And I switch to the main frame
|
||||
And I click on "The Rules of Golf" "list_item"
|
||||
And I switch to "scorm_object" iframe
|
||||
And I wait until the page is ready
|
||||
And I switch to the main frame
|
||||
And I click on "Playing Golf Quiz" "list_item"
|
||||
And I switch to "scorm_object" iframe
|
||||
And I wait until the page is ready
|
||||
And I click on "[id='question_com.scorm.golfsamples.interactions.playing_1_1']" "css_element"
|
||||
And I press "Submit Answers"
|
||||
And I wait until "Score: 20" "text" exists
|
||||
And I switch to the main frame
|
||||
And I click on "Exit activity" "link"
|
||||
And "Failed" "icon" should exist in the "courseindex-content" "region"
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
<?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/>.
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace core_courseformat\external;
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
use core_courseformat\stateactions;
|
||||
use core_courseformat\stateupdates;
|
||||
|
||||
global $CFG;
|
||||
require_once($CFG->dirroot . '/webservice/tests/helpers.php');
|
||||
|
||||
/**
|
||||
* Tests for the delete section test class.
|
||||
*
|
||||
* @package core_courseformat
|
||||
* @copyright 2025 Laurent David <laurent.david@moodle.com>
|
||||
* @category test
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @coversDefaultClass \core_courseformat\stateactions
|
||||
*/
|
||||
final class delete_section_test extends \externallib_advanced_testcase {
|
||||
|
||||
/**
|
||||
* Setup to ensure that fixtures are loaded.
|
||||
*/
|
||||
public static function setupBeforeClass(): void { // phpcs:ignore
|
||||
global $CFG;
|
||||
require_once($CFG->dirroot . '/course/format/tests/fixtures/format_theunittestdelete.php');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the webservice can execute the section_delete action.
|
||||
*
|
||||
* @covers ::section_delete
|
||||
* @dataProvider section_delete_provider
|
||||
* @param int $sectionum
|
||||
* @param string $format
|
||||
* @param array $formatoptions
|
||||
* @param int $expectedsectionum
|
||||
*
|
||||
* @throws \moodle_exception
|
||||
*/
|
||||
public function test_delete_section(int $sectionum, string $format, array $formatoptions, int $expectedsectionum): void {
|
||||
$this->resetAfterTest();
|
||||
|
||||
$course =
|
||||
$this->getDataGenerator()->create_course(array_merge(
|
||||
['numsections' => $sectionum, 'format' => $format],
|
||||
$formatoptions,
|
||||
));
|
||||
$teacher = $this->getDataGenerator()->create_and_enrol($course, 'editingteacher');
|
||||
// Execute the method.
|
||||
$courseformat = course_get_format($course->id);
|
||||
$updates = new stateupdates($courseformat);
|
||||
$modinfo = get_fast_modinfo($course);
|
||||
$sections = $modinfo->get_section_info_all();
|
||||
$sectionsid = array_map(function ($section) {
|
||||
return $section->id;
|
||||
}, $sections);
|
||||
$actions = new stateactions();
|
||||
$this->setUser($teacher);
|
||||
$actions->section_delete(
|
||||
$updates,
|
||||
$course,
|
||||
$sectionsid
|
||||
);
|
||||
// Check result.
|
||||
$modinfo = get_fast_modinfo($course);
|
||||
$sections = $modinfo->get_section_info_all();
|
||||
$this->assertCount($expectedsectionum, $sections);
|
||||
if ($format == 'theunittestdelete') {
|
||||
$this->assertDebuggingCalled();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Data provider for the test_delete_section method.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function section_delete_provider(): array {
|
||||
return [
|
||||
'format topic' => [
|
||||
'sectionum' => 4,
|
||||
'format' => 'topics',
|
||||
'formatoptions' => [],
|
||||
'expectedsectionum' => 1,
|
||||
],
|
||||
'format theunittestdelete' => [
|
||||
'sectionum' => 4,
|
||||
'format' => 'theunittestdelete',
|
||||
'formatoptions' => [],
|
||||
'expectedsectionum' => 5,
|
||||
],
|
||||
'format theunittestdelete can delete' => [
|
||||
'sectionum' => 4,
|
||||
'format' => 'theunittestdelete',
|
||||
'formatoptions' => ['can_delete_sections' => true],
|
||||
'expectedsectionum' => 1,
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
<?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/>.
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
require_once(__DIR__ . '/format_theunittest.php');
|
||||
|
||||
/**
|
||||
* Fixture for fake course format testing course format API.
|
||||
*
|
||||
* @package core_courseformat
|
||||
* @copyright 2025 Laurent David <laurent.david@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class format_theunittestdelete extends format_theunittest {
|
||||
|
||||
/**
|
||||
* Definitions of the additional options that format uses
|
||||
*
|
||||
* @param bool $foreditform
|
||||
* @return array of options
|
||||
*/
|
||||
public function course_format_options($foreditform = false) {
|
||||
static $courseformatoptions = false;
|
||||
if ($courseformatoptions === false) {
|
||||
$courseformatoptions = parent::course_format_options(true);
|
||||
$courseformatoptionsadditional = [
|
||||
'can_delete_sections' => [
|
||||
'default' => false,
|
||||
'type' => PARAM_BOOL,
|
||||
],
|
||||
];
|
||||
$courseformatoptions = array_merge_recursive($courseformatoptions, $courseformatoptionsadditional);
|
||||
}
|
||||
return $courseformatoptions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether this format allows to delete sections
|
||||
*
|
||||
* Here for test purpose we just can delete one section every two sections
|
||||
*
|
||||
* Do not call this function directly, instead use course_can_delete_section()
|
||||
*
|
||||
* @param int|stdClass|section_info $section
|
||||
* @return bool
|
||||
*/
|
||||
public function can_delete_section($section) {
|
||||
return $this->get_format_options()['can_delete_sections'] ?? false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if this course format uses sections
|
||||
*/
|
||||
public function uses_sections() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
+8
-1
@@ -1156,7 +1156,14 @@ class core_course_renderer extends plugin_renderer_base {
|
||||
// This is a request for the course information.
|
||||
$courseid = required_param('courseid', PARAM_INT);
|
||||
|
||||
$course = $DB->get_record('course', array('id' => $courseid), '*', MUST_EXIST);
|
||||
$course = $DB->get_record('course', ['id' => $courseid], '*', IGNORE_MISSING);
|
||||
if ($course === false) {
|
||||
throw new \moodle_exception('invalidcourseid');
|
||||
}
|
||||
$coursecontext = context_course::instance($course->id, MUST_EXIST);
|
||||
if ($course->visible == 0 && !has_capability('moodle/course:viewhiddencourses', $coursecontext)) {
|
||||
throw new \moodle_exception('invalidcourseid');
|
||||
}
|
||||
|
||||
$chelper = new coursecat_helper();
|
||||
$chelper->set_show_courses(self::COURSECAT_SHOW_COURSES_EXPANDED);
|
||||
|
||||
@@ -3850,6 +3850,12 @@ final class externallib_test extends externallib_advanced_testcase {
|
||||
$this->assignUserCapability('moodle/user:viewdetails', $usercontext, $teacherroleid);
|
||||
|
||||
// Sorted by course id DESC.
|
||||
// User without moodle/user:viewalldetails capability will not be able to see the course details.
|
||||
$result = core_course_external::get_recent_courses($student->id);
|
||||
$this->assertCount(0, $result);
|
||||
|
||||
// User with moodle/user:viewalldetails capability will be able to see the course details.
|
||||
$this->assignUserCapability('moodle/user:viewalldetails', $usercontext, $teacherroleid);
|
||||
$result = core_course_external::get_recent_courses($student->id);
|
||||
$this->assertCount(1, $result);
|
||||
$this->assertEquals($courses[0]->id, array_shift($result)->id);
|
||||
@@ -3953,6 +3959,12 @@ final class externallib_test extends externallib_advanced_testcase {
|
||||
|
||||
$this->assertEquals(2, count($users['users']));
|
||||
$this->assertEquals($expectedusers, $users);
|
||||
|
||||
// Prohibit the capability for viewing course participants.
|
||||
$this->unassignUserCapability('moodle/course:viewparticipants', null, null, $course1->id);
|
||||
$this->expectException(required_capability_exception::class);
|
||||
$this->expectExceptionMessage('Sorry, but you do not currently have permissions to do that (View participants)');
|
||||
core_course_external::get_enrolled_users_by_cmid($forum1->cmid);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+10
-1
@@ -84,11 +84,20 @@ function filter_tex_sanitize_formula(string $texexp): string {
|
||||
'\afterassignment', '\expandafter', '\noexpand', '\special',
|
||||
'\let', '\futurelet', '\else', '\fi', '\chardef', '\makeatletter', '\afterground',
|
||||
'\noexpand', '\line', '\mathcode', '\item', '\section', '\mbox', '\declarerobustcommand',
|
||||
'\ExplSyntaxOn', '\pdffiledump',
|
||||
'\ExplSyntaxOn', '\pdffiledump', '\mathtex',
|
||||
];
|
||||
|
||||
$allowlist = ['inputenc'];
|
||||
|
||||
// Add encoded backslash (\) versions of backslashed items to deny list.
|
||||
$encodedslashdenylist = array_map(function($value) {
|
||||
$encoded = str_replace('\\', '\', $value);
|
||||
// Return an encoded slash version if a slash is found, otherwise null so we can filter it off.
|
||||
return $encoded != $value ? $encoded : null;
|
||||
}, $denylist);
|
||||
$encodedslashdenylist = array_filter($encodedslashdenylist);
|
||||
$denylist = array_merge($denylist, $encodedslashdenylist);
|
||||
|
||||
// Prepare the denylist for regular expression.
|
||||
$denylist = array_map(function($value){
|
||||
return '/' . preg_quote($value, '/') . '/i';
|
||||
|
||||
+1
-1
@@ -203,7 +203,7 @@ class fetch extends external_api {
|
||||
$definitionid,
|
||||
'remark',
|
||||
$filling['remark'],
|
||||
(int) $filling['remarkformat']
|
||||
(int) FORMAT_HTML
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -857,16 +857,19 @@ class gradingform_guide_instance extends gradingform_instance {
|
||||
parent::update($data);
|
||||
|
||||
foreach ($data['criteria'] as $criterionid => $record) {
|
||||
// Hardcoding/defaulting to html format for new/existing record
|
||||
$record['remarkformat'] = FORMAT_HTML;
|
||||
|
||||
if (!array_key_exists($criterionid, $currentgrade['criteria'])) {
|
||||
$newrecord = array('instanceid' => $this->get_id(), 'criterionid' => $criterionid,
|
||||
'score' => $record['score'], 'remarkformat' => FORMAT_MOODLE);
|
||||
'score' => $record['score'], 'remarkformat' => $record['remarkformat']);
|
||||
if (isset($record['remark'])) {
|
||||
$newrecord['remark'] = $record['remark'];
|
||||
}
|
||||
$DB->insert_record('gradingform_guide_fillings', $newrecord);
|
||||
} else {
|
||||
$newrecord = array('id' => $currentgrade['criteria'][$criterionid]['id']);
|
||||
foreach (array('score', 'remark'/*, 'remarkformat' TODO */) as $key) {
|
||||
foreach (array('score', 'remark', 'remarkformat') as $key) {
|
||||
if (isset($record[$key]) && $currentgrade['criteria'][$criterionid][$key] != $record[$key]) {
|
||||
$newrecord[$key] = $record[$key];
|
||||
}
|
||||
|
||||
+1
-1
@@ -196,7 +196,7 @@ class fetch extends external_api {
|
||||
$definitionid,
|
||||
'remark',
|
||||
$filling['remark'],
|
||||
(int) $filling['remarkformat']
|
||||
(int) FORMAT_HTML
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -863,16 +863,19 @@ class gradingform_rubric_instance extends gradingform_instance {
|
||||
$currentgrade = $this->get_rubric_filling();
|
||||
parent::update($data);
|
||||
foreach ($data['criteria'] as $criterionid => $record) {
|
||||
// Hardcoding/defaulting to html format for new/existing record
|
||||
$record['remarkformat'] = FORMAT_HTML;
|
||||
|
||||
if (!array_key_exists($criterionid, $currentgrade['criteria'])) {
|
||||
$newrecord = array('instanceid' => $this->get_id(), 'criterionid' => $criterionid,
|
||||
'levelid' => $record['levelid'], 'remarkformat' => FORMAT_MOODLE);
|
||||
'levelid' => $record['levelid'], 'remarkformat' => $record['remarkformat']);
|
||||
if (isset($record['remark'])) {
|
||||
$newrecord['remark'] = $record['remark'];
|
||||
}
|
||||
$DB->insert_record('gradingform_rubric_fillings', $newrecord);
|
||||
} else {
|
||||
$newrecord = array('id' => $currentgrade['criteria'][$criterionid]['id']);
|
||||
foreach (array('levelid', 'remark'/*, 'remarkformat' */) as $key) {
|
||||
foreach (array('levelid', 'remark', 'remarkformat') as $key) {
|
||||
// TODO MDL-31235 format is not supported yet
|
||||
if (isset($record[$key]) && $currentgrade['criteria'][$criterionid][$key] != $record[$key]) {
|
||||
$newrecord[$key] = $record[$key];
|
||||
|
||||
@@ -115,6 +115,16 @@ class gradingform_rubric_renderer extends plugin_renderer_base {
|
||||
$descriptiontdparams['aria-label'] = get_string('criterion', 'gradingform_rubric', s($criterion['description']));
|
||||
}
|
||||
|
||||
// Default value for criterion ids.
|
||||
// Edge case: submitting empty grade when remark field is disabled.
|
||||
// Reason: we need the criteria keys for the clear_attempt to clear the rubric fillings.
|
||||
if ($mode == gradingform_rubric_controller::DISPLAY_EVAL) {
|
||||
$criteriontemplate .= html_writer::empty_tag('input', [
|
||||
'type' => 'hidden',
|
||||
'name' => '{NAME}[criteria][{CRITERION-id}][]',
|
||||
]);
|
||||
}
|
||||
|
||||
// Description cell.
|
||||
$criteriontemplate .= html_writer::tag('td', $description, $descriptiontdparams);
|
||||
|
||||
|
||||
@@ -77,6 +77,7 @@ class grade_import_form extends moodleform {
|
||||
$mform->addElement('text', 'iprestriction', get_string('keyiprestriction', 'userkey'), array('size'=>80));
|
||||
$mform->addHelpButton('iprestriction', 'keyiprestriction', 'userkey');
|
||||
$mform->setDefault('iprestriction', getremoteaddr()); // own IP - just in case somebody does not know what user key is
|
||||
$mform->setType('iprestriction', PARAM_RAW_TRIMMED);
|
||||
|
||||
$mform->addElement('date_time_selector', 'validuntil', get_string('keyvaliduntil', 'userkey'), array('optional'=>true));
|
||||
$mform->addHelpButton('validuntil', 'keyvaliduntil', 'userkey');
|
||||
|
||||
@@ -140,17 +140,21 @@ class provider implements
|
||||
break;
|
||||
default:
|
||||
if (strpos($name, 'grade_report_grader_collapsed_categories') === 0) {
|
||||
$prefname = 'grade_report_grader_collapsed_categories';
|
||||
$prefname = $name;
|
||||
$courseid = substr($name, strlen('grade_report_grader_collapsed_categories'));
|
||||
$transformedvalue = $value;
|
||||
$course = get_course($courseid);
|
||||
$prefdescription = get_string(
|
||||
'privacy:request:preference:'.$prefname,
|
||||
'gradereport_grader',
|
||||
(object) [
|
||||
'name' => $course->fullname,
|
||||
]
|
||||
);
|
||||
try {
|
||||
$course = get_course($courseid);
|
||||
$prefdescription = get_string(
|
||||
'privacy:request:preference:grade_report_grader_collapsed_categories',
|
||||
'gradereport_grader',
|
||||
(object) [
|
||||
'name' => $course->fullname,
|
||||
]
|
||||
);
|
||||
} catch (\dml_missing_record_exception $exception) {
|
||||
continue 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -90,12 +90,22 @@ final class provider_test extends \core_privacy\tests\provider_testcase {
|
||||
* Ensure that export_user_preferences returns preferences.
|
||||
*/
|
||||
public function test_export_user_preferences_multiple(): void {
|
||||
// Create a course and add a user preference.
|
||||
$user = $this->getDataGenerator()->create_user();
|
||||
$this->setUser($user);
|
||||
$course = $this->getDataGenerator()->create_course();
|
||||
$collapsed = serialize(['aggregatesonly' => array(), 'gradesonly' => array()]);
|
||||
set_user_preference('grade_report_grader_collapsed_categories'.$course->id, $collapsed, $user);
|
||||
|
||||
// Set preference for an invalid course.
|
||||
set_user_preference('grade_report_grader_collapsed_categories42', serialize(['gradesonly' => []]));
|
||||
|
||||
// Set preferences for a couple of valid courses.
|
||||
$courseone = $this->getDataGenerator()->create_course();
|
||||
$courseonepreferencename = "grade_report_grader_collapsed_categories{$courseone->id}";
|
||||
$courseonepreferencevalue = serialize(['aggregatesonly' => [], 'gradesonly' => []]);
|
||||
set_user_preference($courseonepreferencename, $courseonepreferencevalue);
|
||||
|
||||
$coursetwo = $this->getDataGenerator()->create_course();
|
||||
$coursetwopreferencename = "grade_report_grader_collapsed_categories{$coursetwo->id}";
|
||||
$coursetwopreferencevalue = serialize(['gradesonly' => [], 'aggregatesonly' => []]);
|
||||
set_user_preference($coursetwopreferencename, $coursetwopreferencevalue);
|
||||
|
||||
// Validate exported data.
|
||||
provider::export_user_preferences($user->id);
|
||||
@@ -104,10 +114,22 @@ final class provider_test extends \core_privacy\tests\provider_testcase {
|
||||
$writer = writer::with_context($context);
|
||||
$this->assertTrue($writer->has_any_data());
|
||||
$prefs = $writer->get_user_preferences('gradereport_grader');
|
||||
$this->assertCount(1, (array) $prefs);
|
||||
$this->assertCount(2, (array) $prefs);
|
||||
|
||||
$this->assertEquals($courseonepreferencevalue, $prefs->{$courseonepreferencename}->value);
|
||||
$this->assertEquals(
|
||||
get_string('privacy:request:preference:grade_report_grader_collapsed_categories', 'gradereport_grader', ['name' => $course->fullname]),
|
||||
$prefs->grade_report_grader_collapsed_categories->description
|
||||
get_string('privacy:request:preference:grade_report_grader_collapsed_categories', 'gradereport_grader', [
|
||||
'name' => $courseone->fullname,
|
||||
]),
|
||||
$prefs->{$courseonepreferencename}->description,
|
||||
);
|
||||
|
||||
$this->assertEquals($coursetwopreferencevalue, $prefs->{$coursetwopreferencename}->value);
|
||||
$this->assertEquals(
|
||||
get_string('privacy:request:preference:grade_report_grader_collapsed_categories', 'gradereport_grader', [
|
||||
'name' => $coursetwo->fullname,
|
||||
]),
|
||||
$prefs->{$coursetwopreferencename}->description,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,6 +107,7 @@ switch ($itemtype) {
|
||||
// display the user select zero state.
|
||||
if (is_null($itemid) || !array_key_exists($itemid, grade_report::get_gradable_users($courseid, $currentgroup))) {
|
||||
$itemtype = 'user_select';
|
||||
unset($SESSION->gradereport_singleview["useritem-{$context->id}"]);
|
||||
}
|
||||
break;
|
||||
case 'grade_select':
|
||||
@@ -129,6 +130,7 @@ switch ($itemtype) {
|
||||
// The item id (grade item id) cannot be defined, display the grade select zero state.
|
||||
if (is_null($itemid) || !array_key_exists($itemid, $gtree->get_items())) {
|
||||
$itemtype = 'grade_select';
|
||||
unset($SESSION->gradereport_singleview["gradeitem-{$context->id}"]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -237,6 +237,9 @@ Feature: We can use Single view
|
||||
When I navigate to "View > Single view" in the course gradebook
|
||||
Then I should see "Search for a user to view all their grades" in the "region-main" "region"
|
||||
And I should not see "Gronya,Beecham" in the "region-main" "region"
|
||||
# edge case coverage: to ensure session variable not causing error upon second visit
|
||||
And I reload the page
|
||||
And I should see "Search for a user to view all their grades" in the "region-main" "region"
|
||||
|
||||
Scenario: Teacher does not see his last viewed user report if that user is no longer enrolled in the course.
|
||||
Given I navigate to "View > Single view" in the course gradebook
|
||||
@@ -247,6 +250,9 @@ Feature: We can use Single view
|
||||
When I am on the "Course 1" "grades > Single view > View" page
|
||||
Then I should see "Search for a user to view all their grades" in the "region-main" "region"
|
||||
And I should not see "Gronya,Beecham" in the "region-main" "region"
|
||||
# edge case coverage: to ensure session variable not causing error upon second visit
|
||||
And I reload the page
|
||||
And I should see "Search for a user to view all their grades" in the "region-main" "region"
|
||||
|
||||
Scenario: Teacher does not see his last viewed grade item report if the item no longer exists in the course.
|
||||
Given I navigate to "View > Single view" in the course gradebook
|
||||
@@ -258,3 +264,6 @@ Feature: We can use Single view
|
||||
When I navigate to "View > Single view" in the course gradebook
|
||||
Then I should see "Select a grade item above" in the "region-main" "region"
|
||||
And I should not see "Test grade item" in the "region-main" "region"
|
||||
# edge case coverage: to ensure session variable not causing error upon second visit
|
||||
And I reload the page
|
||||
And I should see "Select a grade item above" in the "region-main" "region"
|
||||
|
||||
@@ -20,11 +20,11 @@
|
||||
* Do not edit this file manually! It contains just a subset of strings
|
||||
* needed during the very first steps of installation. This file was
|
||||
* generated automatically by export-installer.php (which is part of AMOS
|
||||
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
|
||||
* list of strings defined in /install/stringnames.txt.
|
||||
* {@link https://moodledev.io/general/projects/api/amos}) using the
|
||||
* list of strings defined in install/stringnames.txt file.
|
||||
*
|
||||
* @package installer
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
@@ -20,11 +20,11 @@
|
||||
* Do not edit this file manually! It contains just a subset of strings
|
||||
* needed during the very first steps of installation. This file was
|
||||
* generated automatically by export-installer.php (which is part of AMOS
|
||||
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
|
||||
* list of strings defined in /install/stringnames.txt.
|
||||
* {@link https://moodledev.io/general/projects/api/amos}) using the
|
||||
* list of strings defined in install/stringnames.txt file.
|
||||
*
|
||||
* @package installer
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
@@ -20,11 +20,11 @@
|
||||
* Do not edit this file manually! It contains just a subset of strings
|
||||
* needed during the very first steps of installation. This file was
|
||||
* generated automatically by export-installer.php (which is part of AMOS
|
||||
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
|
||||
* list of strings defined in /install/stringnames.txt.
|
||||
* {@link https://moodledev.io/general/projects/api/amos}) using the
|
||||
* list of strings defined in install/stringnames.txt file.
|
||||
*
|
||||
* @package installer
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
@@ -20,11 +20,11 @@
|
||||
* Do not edit this file manually! It contains just a subset of strings
|
||||
* needed during the very first steps of installation. This file was
|
||||
* generated automatically by export-installer.php (which is part of AMOS
|
||||
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
|
||||
* list of strings defined in /install/stringnames.txt.
|
||||
* {@link https://moodledev.io/general/projects/api/amos}) using the
|
||||
* list of strings defined in install/stringnames.txt file.
|
||||
*
|
||||
* @package installer
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
@@ -20,11 +20,11 @@
|
||||
* Do not edit this file manually! It contains just a subset of strings
|
||||
* needed during the very first steps of installation. This file was
|
||||
* generated automatically by export-installer.php (which is part of AMOS
|
||||
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
|
||||
* list of strings defined in /install/stringnames.txt.
|
||||
* {@link https://moodledev.io/general/projects/api/amos}) using the
|
||||
* list of strings defined in install/stringnames.txt file.
|
||||
*
|
||||
* @package installer
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
@@ -20,11 +20,11 @@
|
||||
* Do not edit this file manually! It contains just a subset of strings
|
||||
* needed during the very first steps of installation. This file was
|
||||
* generated automatically by export-installer.php (which is part of AMOS
|
||||
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
|
||||
* list of strings defined in /install/stringnames.txt.
|
||||
* {@link https://moodledev.io/general/projects/api/amos}) using the
|
||||
* list of strings defined in install/stringnames.txt file.
|
||||
*
|
||||
* @package installer
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
@@ -20,11 +20,11 @@
|
||||
* Do not edit this file manually! It contains just a subset of strings
|
||||
* needed during the very first steps of installation. This file was
|
||||
* generated automatically by export-installer.php (which is part of AMOS
|
||||
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
|
||||
* list of strings defined in /install/stringnames.txt.
|
||||
* {@link https://moodledev.io/general/projects/api/amos}) using the
|
||||
* list of strings defined in install/stringnames.txt file.
|
||||
*
|
||||
* @package installer
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
@@ -20,11 +20,11 @@
|
||||
* Do not edit this file manually! It contains just a subset of strings
|
||||
* needed during the very first steps of installation. This file was
|
||||
* generated automatically by export-installer.php (which is part of AMOS
|
||||
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
|
||||
* list of strings defined in /install/stringnames.txt.
|
||||
* {@link https://moodledev.io/general/projects/api/amos}) using the
|
||||
* list of strings defined in install/stringnames.txt file.
|
||||
*
|
||||
* @package installer
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
@@ -20,11 +20,11 @@
|
||||
* Do not edit this file manually! It contains just a subset of strings
|
||||
* needed during the very first steps of installation. This file was
|
||||
* generated automatically by export-installer.php (which is part of AMOS
|
||||
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
|
||||
* list of strings defined in /install/stringnames.txt.
|
||||
* {@link https://moodledev.io/general/projects/api/amos}) using the
|
||||
* list of strings defined in install/stringnames.txt file.
|
||||
*
|
||||
* @package installer
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
@@ -20,11 +20,11 @@
|
||||
* Do not edit this file manually! It contains just a subset of strings
|
||||
* needed during the very first steps of installation. This file was
|
||||
* generated automatically by export-installer.php (which is part of AMOS
|
||||
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
|
||||
* list of strings defined in /install/stringnames.txt.
|
||||
* {@link https://moodledev.io/general/projects/api/amos}) using the
|
||||
* list of strings defined in install/stringnames.txt file.
|
||||
*
|
||||
* @package installer
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
@@ -20,11 +20,11 @@
|
||||
* Do not edit this file manually! It contains just a subset of strings
|
||||
* needed during the very first steps of installation. This file was
|
||||
* generated automatically by export-installer.php (which is part of AMOS
|
||||
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
|
||||
* list of strings defined in /install/stringnames.txt.
|
||||
* {@link https://moodledev.io/general/projects/api/amos}) using the
|
||||
* list of strings defined in install/stringnames.txt file.
|
||||
*
|
||||
* @package installer
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
@@ -20,11 +20,11 @@
|
||||
* Do not edit this file manually! It contains just a subset of strings
|
||||
* needed during the very first steps of installation. This file was
|
||||
* generated automatically by export-installer.php (which is part of AMOS
|
||||
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
|
||||
* list of strings defined in /install/stringnames.txt.
|
||||
* {@link https://moodledev.io/general/projects/api/amos}) using the
|
||||
* list of strings defined in install/stringnames.txt file.
|
||||
*
|
||||
* @package installer
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
@@ -20,11 +20,11 @@
|
||||
* Do not edit this file manually! It contains just a subset of strings
|
||||
* needed during the very first steps of installation. This file was
|
||||
* generated automatically by export-installer.php (which is part of AMOS
|
||||
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
|
||||
* list of strings defined in /install/stringnames.txt.
|
||||
* {@link https://moodledev.io/general/projects/api/amos}) using the
|
||||
* list of strings defined in install/stringnames.txt file.
|
||||
*
|
||||
* @package installer
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
@@ -20,11 +20,11 @@
|
||||
* Do not edit this file manually! It contains just a subset of strings
|
||||
* needed during the very first steps of installation. This file was
|
||||
* generated automatically by export-installer.php (which is part of AMOS
|
||||
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
|
||||
* list of strings defined in /install/stringnames.txt.
|
||||
* {@link https://moodledev.io/general/projects/api/amos}) using the
|
||||
* list of strings defined in install/stringnames.txt file.
|
||||
*
|
||||
* @package installer
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
@@ -20,11 +20,11 @@
|
||||
* Do not edit this file manually! It contains just a subset of strings
|
||||
* needed during the very first steps of installation. This file was
|
||||
* generated automatically by export-installer.php (which is part of AMOS
|
||||
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
|
||||
* list of strings defined in /install/stringnames.txt.
|
||||
* {@link https://moodledev.io/general/projects/api/amos}) using the
|
||||
* list of strings defined in install/stringnames.txt file.
|
||||
*
|
||||
* @package installer
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
@@ -20,11 +20,11 @@
|
||||
* Do not edit this file manually! It contains just a subset of strings
|
||||
* needed during the very first steps of installation. This file was
|
||||
* generated automatically by export-installer.php (which is part of AMOS
|
||||
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
|
||||
* list of strings defined in /install/stringnames.txt.
|
||||
* {@link https://moodledev.io/general/projects/api/amos}) using the
|
||||
* list of strings defined in install/stringnames.txt file.
|
||||
*
|
||||
* @package installer
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
@@ -20,11 +20,11 @@
|
||||
* Do not edit this file manually! It contains just a subset of strings
|
||||
* needed during the very first steps of installation. This file was
|
||||
* generated automatically by export-installer.php (which is part of AMOS
|
||||
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
|
||||
* list of strings defined in /install/stringnames.txt.
|
||||
* {@link https://moodledev.io/general/projects/api/amos}) using the
|
||||
* list of strings defined in install/stringnames.txt file.
|
||||
*
|
||||
* @package installer
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
@@ -20,11 +20,11 @@
|
||||
* Do not edit this file manually! It contains just a subset of strings
|
||||
* needed during the very first steps of installation. This file was
|
||||
* generated automatically by export-installer.php (which is part of AMOS
|
||||
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
|
||||
* list of strings defined in /install/stringnames.txt.
|
||||
* {@link https://moodledev.io/general/projects/api/amos}) using the
|
||||
* list of strings defined in install/stringnames.txt file.
|
||||
*
|
||||
* @package installer
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
@@ -20,11 +20,11 @@
|
||||
* Do not edit this file manually! It contains just a subset of strings
|
||||
* needed during the very first steps of installation. This file was
|
||||
* generated automatically by export-installer.php (which is part of AMOS
|
||||
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
|
||||
* list of strings defined in /install/stringnames.txt.
|
||||
* {@link https://moodledev.io/general/projects/api/amos}) using the
|
||||
* list of strings defined in install/stringnames.txt file.
|
||||
*
|
||||
* @package installer
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
@@ -20,11 +20,11 @@
|
||||
* Do not edit this file manually! It contains just a subset of strings
|
||||
* needed during the very first steps of installation. This file was
|
||||
* generated automatically by export-installer.php (which is part of AMOS
|
||||
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
|
||||
* list of strings defined in /install/stringnames.txt.
|
||||
* {@link https://moodledev.io/general/projects/api/amos}) using the
|
||||
* list of strings defined in install/stringnames.txt file.
|
||||
*
|
||||
* @package installer
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
@@ -20,11 +20,11 @@
|
||||
* Do not edit this file manually! It contains just a subset of strings
|
||||
* needed during the very first steps of installation. This file was
|
||||
* generated automatically by export-installer.php (which is part of AMOS
|
||||
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
|
||||
* list of strings defined in /install/stringnames.txt.
|
||||
* {@link https://moodledev.io/general/projects/api/amos}) using the
|
||||
* list of strings defined in install/stringnames.txt file.
|
||||
*
|
||||
* @package installer
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
@@ -20,11 +20,11 @@
|
||||
* Do not edit this file manually! It contains just a subset of strings
|
||||
* needed during the very first steps of installation. This file was
|
||||
* generated automatically by export-installer.php (which is part of AMOS
|
||||
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
|
||||
* list of strings defined in /install/stringnames.txt.
|
||||
* {@link https://moodledev.io/general/projects/api/amos}) using the
|
||||
* list of strings defined in install/stringnames.txt file.
|
||||
*
|
||||
* @package installer
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
@@ -20,11 +20,11 @@
|
||||
* Do not edit this file manually! It contains just a subset of strings
|
||||
* needed during the very first steps of installation. This file was
|
||||
* generated automatically by export-installer.php (which is part of AMOS
|
||||
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
|
||||
* list of strings defined in /install/stringnames.txt.
|
||||
* {@link https://moodledev.io/general/projects/api/amos}) using the
|
||||
* list of strings defined in install/stringnames.txt file.
|
||||
*
|
||||
* @package installer
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
@@ -20,11 +20,11 @@
|
||||
* Do not edit this file manually! It contains just a subset of strings
|
||||
* needed during the very first steps of installation. This file was
|
||||
* generated automatically by export-installer.php (which is part of AMOS
|
||||
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
|
||||
* list of strings defined in /install/stringnames.txt.
|
||||
* {@link https://moodledev.io/general/projects/api/amos}) using the
|
||||
* list of strings defined in install/stringnames.txt file.
|
||||
*
|
||||
* @package installer
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
@@ -20,11 +20,11 @@
|
||||
* Do not edit this file manually! It contains just a subset of strings
|
||||
* needed during the very first steps of installation. This file was
|
||||
* generated automatically by export-installer.php (which is part of AMOS
|
||||
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
|
||||
* list of strings defined in /install/stringnames.txt.
|
||||
* {@link https://moodledev.io/general/projects/api/amos}) using the
|
||||
* list of strings defined in install/stringnames.txt file.
|
||||
*
|
||||
* @package installer
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
@@ -20,11 +20,11 @@
|
||||
* Do not edit this file manually! It contains just a subset of strings
|
||||
* needed during the very first steps of installation. This file was
|
||||
* generated automatically by export-installer.php (which is part of AMOS
|
||||
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
|
||||
* list of strings defined in /install/stringnames.txt.
|
||||
* {@link https://moodledev.io/general/projects/api/amos}) using the
|
||||
* list of strings defined in install/stringnames.txt file.
|
||||
*
|
||||
* @package installer
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user