Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update my repo #4

Merged
merged 56 commits into from
May 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
82482a0
MDL-62229 tool_mobile: Add missing supported module
jleyva Apr 26, 2018
75bff87
MDL-62386 theme: Fix audio playback display for HTML audio
May 11, 2018
13a215e
MDL-62228 core: remove unnecessary context check in privacy providers
mdjnelson May 14, 2018
4d2dc42
MDL-62447 user: Fix component name typo
May 15, 2018
17d4aea
Merge branch 'MDL-62228_34' of git://github.com/markn86/moodle into M…
May 15, 2018
dc15df1
MDL-62448 block_rss_client: Export all feeds from Privacy API
sarjona May 15, 2018
f9d6769
Merge branch 'MDL-62448-34' of git://github.com/sarjona/moodle into M…
stronk7 May 15, 2018
7f7e03e
Merge branch 'MDL-62447_34' of git://github.com/dmonllao/moodle into …
stronk7 May 15, 2018
8596627
MDL-62134 privacy: consistantly call components methods
marinaglancy May 15, 2018
2f477b5
MDL-62426 enrol_flatfile: make provider a plugin provider
snake May 15, 2018
321d41a
MDL-62426 core_enrol: control enrolment subcontexts at the provider
snake May 16, 2018
d44adb9
Merge branch 'MDL-62426-34' of https://github.com/snake/moodle into M…
andrewnicols May 16, 2018
e6a65ee
MDL-62134 core_privacy: Allow for a failure handler
andrewnicols May 15, 2018
b066f55
Merge branch 'MDL-62134-34' of git://github.com/andrewnicols/moodle i…
snake May 16, 2018
d5f69f0
MDL-62456 mod_lti: add missing add_external_location_link call
mdjnelson May 16, 2018
212b6da
MDL-62147 privacy: corrections to tables, temporary tables
marinaglancy May 16, 2018
6f0e3c7
MDL-62463 mod_glossary: Fix SQL query
andrewnicols May 16, 2018
3a20fb2
MDL-62147 privacy: unittest ensures that all tables covered
marinaglancy May 9, 2018
f2f7255
MDL-62147 portfolio: add missing tables to privacy provider
marinaglancy May 16, 2018
5c1b473
MDL-62147 core_grades: Declare metadata of scales and import tables
marinaglancy May 16, 2018
9510c3c
MDL-62147 core_grades: Report contexts and data related to scales
FMCorz May 16, 2018
97a8001
Merge branch 'MDL-62463-34' of git://github.com/andrewnicols/moodle i…
junpataleta May 16, 2018
4c2a5ce
Merge branch 'wip-MDL-62147-34' of git://github.com/marinaglancy/mood…
andrewnicols May 16, 2018
2f3bcbc
Merge branch 'MDL-62456_34' of git://github.com/markn86/moodle into M…
May 16, 2018
24fc1d0
IOMAD: User firstname and lastname should be trimmed for leading/trai…
turf212 May 16, 2018
e5c3ba2
MDL-62469 qtype_calculated: check remaining placeholders, see MDL-62275
marinaglancy May 16, 2018
05a4342
Moodle release 3.4.3
stronk7 May 16, 2018
a534d3e
MDL-62440 participants: out-of-memory is many site-wide role assigns
timhunt May 14, 2018
d7cdf10
MDL-62482 file_storage: may have many files with same content hash
timhunt May 17, 2018
83acfca
MDL-62488 filebrowser: Stop unit tests assuming number of categories
May 17, 2018
4cc2b64
MDL-61893 JavaScript: Accept any node version but Carbon (LTS)
scara May 3, 2018
dd61328
MDL-61893 JavaScript: Bumped npm packages
May 3, 2018
68f2241
IOMAD: Warning emails should not be sent to managers when the user em…
turf212 May 18, 2018
63e64aa
MDL-62500 tag: Update checkbox label when updating tag
andrewnicols May 20, 2018
dc387ce
Merge branch 'MDL-62386-34' of git://github.com/bmbrands/moodle into …
andrewnicols May 21, 2018
841b8c5
MDL-62516 mod_forum: Only delete files for requested user
andrewnicols May 21, 2018
f25a5f4
Merge branch 'MDL-62440_34' of git://github.com/timhunt/moodle into M…
snake May 21, 2018
88d0b05
Merge branch 'MDL-62229-34' of git://github.com/jleyva/moodle into MO…
junpataleta May 21, 2018
5aa946d
Merge branch 'MDL-62516-34' of git://github.com/andrewnicols/moodle i…
May 21, 2018
eeb84ca
MDL-61015 course: consistently display hidden sections
marinaglancy Apr 9, 2018
3221180
MDL-61015 course: consistently display hidden sections
lucaboesch May 1, 2018
137508e
Merge branch 'm34_MDL-61893_Accept_Any_Node_Carbon_Version' of https:…
May 21, 2018
e306188
MDL-62239 QTYPE: iOS 11.3 broke Moodle drag-drop question types
May 14, 2018
48dbc76
Merge branch 'MDL-62500-34' of git://github.com/andrewnicols/moodle i…
stronk7 May 21, 2018
0ffd592
IOMAD: user cannot get own certificate if they are a manager. #927
turf212 May 21, 2018
e41a1d1
Merge branch 'MDL-61015-34' of https://github.com/lucaboesch/moodle i…
snake May 22, 2018
69471d8
Merge branch 'MDL-62488_34_STABLE' of https://github.com/marxjohnson/…
andrewnicols May 22, 2018
7c8dc9b
Merge branch 'MDL-62482_34' of git://github.com/timhunt/moodle into M…
andrewnicols May 22, 2018
41d477d
Merge branch 'wip-MDL-62239-34' of https://github.com/Beedell/moodle …
junpataleta May 22, 2018
a866202
MDL-61932 mod_glossary: Display site-level glossaries on section 1
junpataleta Apr 11, 2018
1fc9b81
MDL-61932 mod_glossary: Fetch the correct front page section 1 ID
junpataleta May 22, 2018
dde3643
Merge branch 'MDL-61932-34' of git://github.com/junpataleta/moodle in…
snake May 23, 2018
951febb
MDL-61189 editor_tinymce: save data before submitting
lameze May 22, 2018
3e2ec06
Merge branch 'MOODLE_34_STABLE' of git://git.moodle.org/moodle into I…
turf212 May 23, 2018
9cf74e2
weekly release 3.4.3+
May 24, 2018
583e0fa
Merge branch 'MOODLE_34_STABLE' of git://git.moodle.org/moodle into I…
turf212 May 28, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ matrix:
include:
# Run grunt/npm install on highest version ('node' is an alias for the latest node.js version.)
- php: 7.2
env: DB=none TASK=GRUNT NVM_VERSION='8.9'
env: DB=none TASK=GRUNT NVM_VERSION='lts/carbon'

exclude:
# MySQL - it's just too slow.
Expand Down
3 changes: 0 additions & 3 deletions admin/roles/classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,6 @@ public static function delete_data_for_all_users_in_context(\context $context) {
// Don't belong to the modifier user.

// Remove data from role_assignments.
if (empty($context)) {
return;
}
$DB->delete_records('role_assignments', ['contextid' => $context->id]);
}
/**
Expand Down
2 changes: 1 addition & 1 deletion admin/tool/log/store/standard/classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class provider implements
* @return collection A listing of user data stored through this system.
*/
public static function get_metadata(collection $collection) : collection {
$collection->add_database_table('log', [
$collection->add_database_table('logstore_standard_log', [
'eventname' => 'privacy:metadata:log:eventname',
'userid' => 'privacy:metadata:log:userid',
'relateduserid' => 'privacy:metadata:log:relateduserid',
Expand Down
3 changes: 2 additions & 1 deletion admin/tool/mobile/classes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,8 @@ public static function get_features_list() {
$availablemods = core_plugin_manager::instance()->get_plugins_of_type('mod');
$coursemodules = array();
$appsupportedmodules = array('assign', 'book', 'chat', 'choice', 'data', 'feedback', 'folder', 'forum', 'glossary', 'imscp',
'label', 'lesson', 'lti', 'page', 'quiz', 'resource', 'scorm', 'survey', 'url', 'wiki');
'label', 'lesson', 'lti', 'page', 'quiz', 'resource', 'scorm', 'survey', 'url', 'wiki', 'workshop');

foreach ($availablemods as $mod) {
if (in_array($mod->name, $appsupportedmodules)) {
$coursemodules['$mmCourseDelegate_mmaMod' . ucfirst($mod->name)] = $mod->displayname;
Expand Down
4 changes: 0 additions & 4 deletions auth/oauth2/classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,6 @@ public static function export_user_data(approved_contextlist $contextlist) {
* @param \context $context The context to delete data for.
*/
public static function delete_data_for_all_users_in_context(\context $context) {
if (empty($context)) {
return;
}

if ($context->contextlevel != CONTEXT_USER) {
return;
}
Expand Down
4 changes: 4 additions & 0 deletions blocks/iomad_company_admin/company_user_create_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,10 @@ public function validation($usernew, $files) {
redirect($dashboardurl);
die;
} else if ($data = $mform->get_data()) {
// Trim first and lastnames
$data->firstname = trim($data->firstname);
$data->lastname = trim($data->lastname);

$data->userid = $USER->id;
if ($companyid > 0) {
$data->companyid = $companyid;
Expand Down
4 changes: 4 additions & 0 deletions blocks/iomad_company_admin/editadvanced.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@
$userform->set_data($user);

if ($usernew = $userform->get_data()) {
// Trim first and lastnames
$usernew->firstname = trim($usernew->firstname);
$usernew->lastname = trim($usernew->lastname);

if ($usernew->id == -1) {
$event = \core\event\user_updated::create(array('context' => $systemcontext, 'userid' => $usernew->id, 'relateduserid' => $USER->id));
$event->trigger();
Expand Down
62 changes: 56 additions & 6 deletions blocks/recent_activity/classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@

namespace block_recent_activity\privacy;

use core_privacy\local\metadata\collection;
use core_privacy\local\request\approved_contextlist;
use core_privacy\local\request\contextlist;

defined('MOODLE_INTERNAL') || die();

/**
Expand All @@ -33,15 +37,61 @@
* @copyright 2018 Shamim Rezaie <shamim@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class provider implements \core_privacy\local\metadata\null_provider {
class provider implements \core_privacy\local\metadata\provider,
\core_privacy\local\request\plugin\provider {

/**
* Returns metadata.
*
* @param collection $collection The initialised collection to add items to.
* @return collection A listing of user data stored through this system.
*/
public static function get_metadata(collection $collection) : collection {

// This plugin defines a db table but it is not considered personal data and, therefore, not exported or deleted.
$collection->add_database_table('block_recent_activity', [
'courseid' => 'privacy:metadata:block_recent_activity:courseid',
'cmid' => 'privacy:metadata:block_recent_activity:cmid',
'timecreated' => 'privacy:metadata:block_recent_activity:timecreated',
'userid' => 'privacy:metadata:block_recent_activity:userid',
'action' => 'privacy:metadata:block_recent_activity:action',
'modname' => 'privacy:metadata:block_recent_activity:modname'
], 'privacy:metadata:block_recent_activity');

return $collection;
}

/**
* Get the list of contexts that contain user information for the specified user.
*
* @param int $userid The user to search.
* @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin.
*/
public static function get_contexts_for_userid(int $userid) : contextlist {
return new contextlist();
}

/**
* Export all user data for the specified user, in the specified contexts.
*
* @param approved_contextlist $contextlist The approved contexts to export information for.
*/
public static function export_user_data(approved_contextlist $contextlist) {
}

/**
* Delete all data for all users in the specified context.
*
* @param \context $context The specific context to delete data for.
*/
public static function delete_data_for_all_users_in_context(\context $context) {
}

/**
* Get the language string identifier with the component's language
* file to explain why this plugin stores no data.
* Delete all user data for the specified user, in the specified contexts.
*
* @return string
* @param approved_contextlist $contextlist The approved contexts and user information to delete information for.
*/
public static function get_reason() : string {
return 'privacy:metadata';
public static function delete_data_for_user(approved_contextlist $contextlist) {
}
}
7 changes: 7 additions & 0 deletions blocks/recent_activity/lang/en/block_recent_activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@

$string['pluginname'] = 'Recent activity';
$string['privacy:metadata'] = 'The recent activity block contains a cache of data stored elsewhere in Moodle.';
$string['privacy:metadata:block_recent_activity'] = 'Temporary log of recent teacher activity. Removed after two days';
$string['privacy:metadata:block_recent_activity:action'] = 'Action: created, updated or deleted';
$string['privacy:metadata:block_recent_activity:cmid'] = 'Course module id';
$string['privacy:metadata:block_recent_activity:courseid'] = 'Course id';
$string['privacy:metadata:block_recent_activity:modname'] = 'Module type name (for delete action)';
$string['privacy:metadata:block_recent_activity:timecreated'] = 'Time when action was performed';
$string['privacy:metadata:block_recent_activity:userid'] = 'User performing the action';
$string['recent_activity:addinstance'] = 'Add a new recent activity block';
$string['recent_activity:viewaddupdatemodule'] = 'View added and updated modules in recent activity block';
$string['recent_activity:viewdeletemodule'] = 'View deleted modules in recent activity block';
9 changes: 7 additions & 2 deletions blocks/rss_client/classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,21 @@ public static function get_contexts_for_userid(int $userid) : contextlist {
* @param approved_contextlist $contextlist The approved contexts to export information for.
*/
public static function export_user_data(approved_contextlist $contextlist) {
$rssdata = [];
$results = static::get_records($contextlist->get_user()->id);
foreach ($results as $result) {
$data = (object) [
$rssdata[] = (object) [
'title' => $result->title,
'preferredtitle' => $result->preferredtitle,
'description' => $result->description,
'shared' => \core_privacy\local\request\transform::yesno($result->shared),
'url' => $result->url
];

}
if (!empty($rssdata)) {
$data = (object) [
'feeds' => $rssdata,
];
\core_privacy\local\request\writer::with_context($contextlist->current())->export_data([
get_string('pluginname', 'block_rss_client')], $data);
}
Expand Down
13 changes: 8 additions & 5 deletions blocks/rss_client/tests/privacy_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,21 @@ public function test_export_user_data() {
$user = $this->getDataGenerator()->create_user();
$context = context_user::instance($user->id);

$this->add_rss_feed($user);
$this->add_rss_feed($user);

$writer = \core_privacy\local\request\writer::with_context($context);
$this->assertFalse($writer->has_any_data());
$this->export_context_data_for_user($user->id, $context, 'block_rss_client');

$data = $writer->get_data([get_string('pluginname', 'block_rss_client')]);
$this->assertEquals('BBC News - World', $data->title);
$this->assertEquals('World News', $data->preferredtitle);
$this->assertEquals('Description: BBC News - World', $data->description);
$this->assertEquals(get_string('no'), $data->shared);
$this->assertEquals('http://feeds.bbci.co.uk/news/world/rss.xml?edition=uk', $data->url);
$this->assertCount(2, $data->feeds);
$feed1 = reset($data->feeds);
$this->assertEquals('BBC News - World', $feed1->title);
$this->assertEquals('World News', $feed1->preferredtitle);
$this->assertEquals('Description: BBC News - World', $feed1->description);
$this->assertEquals(get_string('no'), $feed1->shared);
$this->assertEquals('http://feeds.bbci.co.uk/news/world/rss.xml?edition=uk', $feed1->url);
}

/**
Expand Down
4 changes: 0 additions & 4 deletions calendar/classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,6 @@ public static function export_user_preferences(int $userid) {
* @param context $context Transform the specific context to delete data for.
*/
public static function delete_data_for_all_users_in_context(\context $context) {
if (empty($context)) {
return;
}

// Delete all Calendar Events in the specified context in batches.
if ($eventids = array_keys(self::get_calendar_event_ids_by_context($context))) {
self::delete_batch_records('event', 'id', $eventids);
Expand Down
4 changes: 0 additions & 4 deletions cohort/classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,6 @@ public static function export_user_data(approved_contextlist $contextlist) {
* @param context $context A user context.
*/
public static function delete_data_for_all_users_in_context(\context $context) {
if (empty($context)) {
return;
}

if (!$context instanceof \context_system && !$context instanceof \context_coursecat) {
return;
}
Expand Down
55 changes: 27 additions & 28 deletions course/format/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,12 @@ protected function section_header($section, $course, $onsectionpage, $sectionret
$o .= $this->section_availability($section);

$o .= html_writer::start_tag('div', array('class' => 'summary'));
$o .= $this->format_summary_text($section);
if ($section->uservisible || $section->visible) {
// Show summary if section is available or has availability restriction information.
// Do not show summary if section is hidden but we still display it because of course setting
// "Hidden sections are shown in collapsed form".
$o .= $this->format_summary_text($section);
}
$o .= html_writer::end_tag('div');

return $o;
Expand Down Expand Up @@ -443,13 +448,18 @@ protected function section_summary($section, $course, $mods) {
}
$o .= $this->output->heading($title, 3, 'section-title');

$o .= $this->section_availability($section);
$o.= html_writer::start_tag('div', array('class' => 'summarytext'));
$o.= $this->format_summary_text($section);

if ($section->uservisible || $section->visible) {
// Show summary if section is available or has availability restriction information.
// Do not show summary if section is hidden but we still display it because of course setting
// "Hidden sections are shown in collapsed form".
$o .= $this->format_summary_text($section);
}
$o.= html_writer::end_tag('div');
$o.= $this->section_activity_summary($section, $course, null);

$o .= $this->section_availability($section);

$o .= html_writer::end_tag('div');
$o .= html_writer::end_tag('li');

Expand Down Expand Up @@ -552,6 +562,10 @@ protected function section_availability_message($section, $canviewhidden) {
if (!$section->visible) {
if ($canviewhidden) {
$o .= $this->courserenderer->availability_info(get_string('hiddenfromstudents'), 'ishidden');
} else {
// We are here because of the setting "Hidden sections are shown in collapsed form".
// Student can not see the section contents but can see its name.
$o .= $this->courserenderer->availability_info(get_string('notavailable'), 'ishidden');
}
} else if (!$section->uservisible) {
if ($section->availableinfo) {
Expand Down Expand Up @@ -769,20 +783,11 @@ public function print_single_section_page($course, $sections, $mods, $modnames,
$course = course_get_format($course)->get_course();

// Can we view the section in question?
if (!($sectioninfo = $modinfo->get_section_info($displaysection))) {
// This section doesn't exist
print_error('unknowncoursesection', 'error', null, $course->fullname);
return;
}

if (!$sectioninfo->uservisible) {
if (!$course->hiddensections) {
echo $this->start_section_list();
echo $this->section_hidden($displaysection, $course->id);
echo $this->end_section_list();
}
// Can't view this section.
return;
if (!($sectioninfo = $modinfo->get_section_info($displaysection)) || !$sectioninfo->uservisible) {
// This section doesn't exist or is not available for the user.
// We actually already check this in course/view.php but just in case exit from this function as well.
print_error('unknowncoursesection', 'error', course_get_url($course),
format_string($course->fullname));
}

// Copy activity clipboard..
Expand Down Expand Up @@ -891,18 +896,12 @@ public function print_multiple_section_page($course, $sections, $mods, $modnames
continue;
}
// Show the section if the user is permitted to access it, OR if it's not available
// but there is some available info text which explains the reason & should display.
// but there is some available info text which explains the reason & should display,
// OR it is hidden but the course has a setting to display hidden sections as unavilable.
$showsection = $thissection->uservisible ||
($thissection->visible && !$thissection->available &&
!empty($thissection->availableinfo));
($thissection->visible && !$thissection->available && !empty($thissection->availableinfo)) ||
(!$thissection->visible && !$course->hiddensections);
if (!$showsection) {
// If the hiddensections option is set to 'show hidden sections in collapsed
// form', then display the hidden section message - UNLESS the section is
// hidden by the availability system, which is set to hide the reason.
if (!$course->hiddensections && $thissection->available) {
echo $this->section_hidden($section, $course->id);
}

continue;
}

Expand Down
15 changes: 12 additions & 3 deletions enrol/classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,6 @@ public static function export_user_data(approved_contextlist $contextlist) {
public static function delete_data_for_all_users_in_context(\context $context) {
global $DB;

if (empty($context)) {
return;
}
// Sanity check that context is at the User context level.
if ($context->contextlevel == CONTEXT_COURSE) {
$sql = "SELECT ue.id
Expand Down Expand Up @@ -230,4 +227,16 @@ protected static function delete_user_data(string $sql, array $params) {
$DB->delete_records_select('user_enrolments', "id $sql", $params);
}

/**
* Get the subcontext for export.
*
* @param array $subcontext Any additional subcontext to use.
* @return array The array containing the full subcontext, i.e. [enrolments, subcontext]
*/
public static function get_subcontext(array $subcontext) {
return array_merge(
[get_string('privacy:metadata:user_enrolments', 'core_enrol')],
$subcontext
);
}
}
Loading