Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3517c9c9ad | |||
| f2a6066b0d | |||
| 5d369ee04d | |||
| b80489c01c | |||
| cd6bec2042 | |||
| b4503b3f20 | |||
| 2dc47fdeba | |||
| d797697168 | |||
| a5b845891b | |||
| 086d433a2e | |||
| 8aa5030df3 | |||
| ab3d922f3b | |||
| 75d5f1ce78 | |||
| 26a7f1ed03 | |||
| cbc2ed8aa5 | |||
| feb968ae94 | |||
| 91dce7a047 | |||
| e56b93b7e4 | |||
| 1ddc287877 | |||
| 04e2aa2586 | |||
| 1a62662461 | |||
| e4e40d2195 | |||
| 7e82728088 | |||
| 29618440bc | |||
| a91a8ff1f1 | |||
| c0f0fe29f6 |
+2
-3
@@ -2,10 +2,9 @@
|
||||
# process (which uses our internal CI system) this file is here for the benefit
|
||||
# of community developers git clones - see MDL-51458.
|
||||
|
||||
# We currently disable Travis notifications entirely until https://github.com/travis-ci/travis-ci/issues/4976
|
||||
# is fixed.
|
||||
notifications:
|
||||
email: false
|
||||
email:
|
||||
if: env(MOODLE_EMAIL) != no
|
||||
|
||||
language: php
|
||||
|
||||
|
||||
@@ -872,36 +872,31 @@ class tool_uploadcourse_course {
|
||||
unset($method['delete']);
|
||||
unset($method['disable']);
|
||||
|
||||
if (!empty($instance) && $todelete) {
|
||||
if ($todelete) {
|
||||
// Remove the enrolment method.
|
||||
foreach ($instances as $instance) {
|
||||
if ($instance->enrol == $enrolmethod) {
|
||||
$plugin = $enrolmentplugins[$instance->enrol];
|
||||
$plugin->delete_instance($instance);
|
||||
break;
|
||||
}
|
||||
if ($instance) {
|
||||
$plugin = $enrolmentplugins[$instance->enrol];
|
||||
$plugin->delete_instance($instance);
|
||||
}
|
||||
} else if (!empty($instance) && $todisable) {
|
||||
// Disable the enrolment.
|
||||
foreach ($instances as $instance) {
|
||||
if ($instance->enrol == $enrolmethod) {
|
||||
$plugin = $enrolmentplugins[$instance->enrol];
|
||||
$plugin->update_status($instance, ENROL_INSTANCE_DISABLED);
|
||||
$enrol_updated = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$plugin = $enrolmentplugins[$instance->enrol];
|
||||
$plugin->update_status($instance, ENROL_INSTANCE_DISABLED);
|
||||
$enrol_updated = true;
|
||||
} else {
|
||||
$plugin = null;
|
||||
|
||||
$status = ($todisable) ? ENROL_INSTANCE_DISABLED : ENROL_INSTANCE_ENABLED;
|
||||
|
||||
if (empty($instance)) {
|
||||
$plugin = $enrolmentplugins[$enrolmethod];
|
||||
$instance = new stdClass();
|
||||
$instance->id = $plugin->add_default_instance($course);
|
||||
$instanceid = $plugin->add_default_instance($course);
|
||||
$instance = $DB->get_record('enrol', ['id' => $instanceid]);
|
||||
$instance->roleid = $plugin->get_config('roleid');
|
||||
$instance->status = ENROL_INSTANCE_ENABLED;
|
||||
$plugin->update_status($instance, $status);
|
||||
} else {
|
||||
$plugin = $enrolmentplugins[$instance->enrol];
|
||||
$plugin->update_status($instance, ENROL_INSTANCE_ENABLED);
|
||||
$plugin->update_status($instance, $status);
|
||||
}
|
||||
|
||||
// Now update values.
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
@tool @tool_uploadcourse @_file_upload
|
||||
Feature: An admin can update courses enrolments using a CSV file
|
||||
In order to update courses enrolments using a CSV file
|
||||
As an admin
|
||||
I need to be able to upload a CSV file with enrolment methods for the courses
|
||||
|
||||
Background:
|
||||
Given the following "courses" exist:
|
||||
| fullname | shortname | category |
|
||||
| Course 1 | C1 | 0 |
|
||||
And I log in as "admin"
|
||||
|
||||
@javascript
|
||||
Scenario: Creating enrolment method by enable it
|
||||
Given I am on "Course 1" course homepage
|
||||
And I navigate to "Users > Enrolment methods" in current page administration
|
||||
And I click on "Delete" "link" in the "Guest access" "table_row"
|
||||
And I click on "Continue" "button"
|
||||
And I should not see "Guest access" in the "generaltable" "table"
|
||||
And I navigate to "Courses > Upload courses" in site administration
|
||||
And I upload "admin/tool/uploadcourse/tests/fixtures/enrolment_enable.csv" file to "File" filemanager
|
||||
And I set the field "Upload mode" to "Only update existing courses"
|
||||
And I set the field "Update mode" to "Update with CSV data only"
|
||||
And I set the field "Allow deletes" to "Yes"
|
||||
And I click on "Preview" "button"
|
||||
When I click on "Upload courses" "button"
|
||||
Then I should see "Course updated"
|
||||
And I am on "Course 1" course homepage
|
||||
And I navigate to "Users > Enrolment methods" in current page administration
|
||||
And "Disable" "icon" should exist in the "Guest access" "table_row"
|
||||
|
||||
@javascript
|
||||
Scenario: Creating enrolment method by disabling it
|
||||
Given I am on "Course 1" course homepage
|
||||
And I navigate to "Users > Enrolment methods" in current page administration
|
||||
And I click on "Delete" "link" in the "Guest access" "table_row"
|
||||
And I click on "Continue" "button"
|
||||
And I should not see "Guest access" in the "generaltable" "table"
|
||||
And I navigate to "Courses > Upload courses" in site administration
|
||||
And I upload "admin/tool/uploadcourse/tests/fixtures/enrolment_disable.csv" file to "File" filemanager
|
||||
And I set the field "Upload mode" to "Only update existing courses"
|
||||
And I set the field "Update mode" to "Update with CSV data only"
|
||||
And I set the field "Allow deletes" to "Yes"
|
||||
And I click on "Preview" "button"
|
||||
When I click on "Upload courses" "button"
|
||||
Then I should see "Course updated"
|
||||
And I am on "Course 1" course homepage
|
||||
And I navigate to "Users > Enrolment methods" in current page administration
|
||||
And "Enable" "icon" should exist in the "Guest access" "table_row"
|
||||
|
||||
@javascript
|
||||
Scenario: Enabling enrolment method
|
||||
Given I navigate to "Courses > Upload courses" in site administration
|
||||
And I upload "admin/tool/uploadcourse/tests/fixtures/enrolment_enable.csv" file to "File" filemanager
|
||||
And I set the field "Upload mode" to "Only update existing courses"
|
||||
And I set the field "Update mode" to "Update with CSV data only"
|
||||
And I set the field "Allow deletes" to "Yes"
|
||||
And I click on "Preview" "button"
|
||||
When I click on "Upload courses" "button"
|
||||
Then I should see "Course updated"
|
||||
And I am on "Course 1" course homepage
|
||||
And I navigate to "Users > Enrolment methods" in current page administration
|
||||
And "Disable" "icon" should exist in the "Guest access" "table_row"
|
||||
|
||||
@javascript
|
||||
Scenario: Disable an enrolment method
|
||||
Given I am on "Course 1" course homepage
|
||||
And I navigate to "Users > Enrolment methods" in current page administration
|
||||
And I click on "Enable" "link" in the "Guest access" "table_row"
|
||||
And "Disable" "icon" should exist in the "Guest access" "table_row"
|
||||
And I navigate to "Courses > Upload courses" in site administration
|
||||
And I upload "admin/tool/uploadcourse/tests/fixtures/enrolment_disable.csv" file to "File" filemanager
|
||||
And I set the field "Upload mode" to "Only update existing courses"
|
||||
And I set the field "Update mode" to "Update with CSV data only"
|
||||
And I set the field "Allow deletes" to "Yes"
|
||||
And I click on "Preview" "button"
|
||||
When I click on "Upload courses" "button"
|
||||
Then I should see "Course updated"
|
||||
And I am on "Course 1" course homepage
|
||||
And I navigate to "Users > Enrolment methods" in current page administration
|
||||
And "Enable" "icon" should exist in the "Guest access" "table_row"
|
||||
|
||||
@javascript
|
||||
Scenario: Delete an enrolment method
|
||||
Given I navigate to "Courses > Upload courses" in site administration
|
||||
And I upload "admin/tool/uploadcourse/tests/fixtures/enrolment_delete.csv" file to "File" filemanager
|
||||
And I set the field "Upload mode" to "Only update existing courses"
|
||||
And I set the field "Update mode" to "Update with CSV data only"
|
||||
And I set the field "Allow deletes" to "Yes"
|
||||
And I click on "Preview" "button"
|
||||
When I click on "Upload courses" "button"
|
||||
Then I should see "Course updated"
|
||||
And I am on "Course 1" course homepage
|
||||
And I navigate to "Users > Enrolment methods" in current page administration
|
||||
And I should not see "Guest access" in the "generaltable" "table"
|
||||
|
||||
@javascript
|
||||
Scenario: Delete an unexistent enrolment method (nothing should change)
|
||||
Given I am on "Course 1" course homepage
|
||||
And I navigate to "Users > Enrolment methods" in current page administration
|
||||
And I click on "Delete" "link" in the "Guest access" "table_row"
|
||||
And I click on "Continue" "button"
|
||||
And I should not see "Guest access" in the "generaltable" "table"
|
||||
And I navigate to "Courses > Upload courses" in site administration
|
||||
And I upload "admin/tool/uploadcourse/tests/fixtures/enrolment_delete.csv" file to "File" filemanager
|
||||
And I set the field "Upload mode" to "Only update existing courses"
|
||||
And I set the field "Update mode" to "Update with CSV data only"
|
||||
And I set the field "Allow deletes" to "Yes"
|
||||
And I click on "Preview" "button"
|
||||
When I click on "Upload courses" "button"
|
||||
Then I should see "Course updated"
|
||||
And I am on "Course 1" course homepage
|
||||
And I navigate to "Users > Enrolment methods" in current page administration
|
||||
And I should not see "Guest access" in the "generaltable" "table"
|
||||
@@ -0,0 +1,2 @@
|
||||
shortname,category,enrolment_1,enrolment_1_delete
|
||||
C1,1,guest,1
|
||||
|
@@ -0,0 +1,2 @@
|
||||
shortname,category,enrolment_1,enrolment_1_disable
|
||||
C1,1,guest,1
|
||||
|
@@ -0,0 +1,2 @@
|
||||
shortname,category,enrolment_1,enrolment_1_disable
|
||||
C1,1,guest,0
|
||||
|
@@ -362,6 +362,7 @@ class restore_controller extends base_controller {
|
||||
$options = array();
|
||||
$options['keep_roles_and_enrolments'] = $this->get_setting_value('keep_roles_and_enrolments');
|
||||
$options['keep_groups_and_groupings'] = $this->get_setting_value('keep_groups_and_groupings');
|
||||
$options['userid'] = $this->userid;
|
||||
restore_dbops::delete_course_content($this->get_courseid(), $options);
|
||||
}
|
||||
// If this is not a course restore or single activity restore (e.g. duplicate), inform the plan we are not
|
||||
|
||||
@@ -2110,14 +2110,29 @@ class restore_ras_and_caps_structure_step extends restore_structure_step {
|
||||
$data = (object)$data;
|
||||
|
||||
// Check roleid is one of the mapped ones
|
||||
$newroleid = $this->get_mappingid('role', $data->roleid);
|
||||
$newrole = $this->get_mapping('role', $data->roleid);
|
||||
$newroleid = $newrole->newitemid ?? false;
|
||||
$userid = $this->task->get_userid();
|
||||
|
||||
// If newroleid and context are valid assign it via API (it handles dupes and so on)
|
||||
if ($newroleid && $this->task->get_contextid()) {
|
||||
if (!get_capability_info($data->capability)) {
|
||||
if (!$capability = get_capability_info($data->capability)) {
|
||||
$this->log("Capability '{$data->capability}' was not found!", backup::LOG_WARNING);
|
||||
} else {
|
||||
// TODO: assign_capability() needs one userid param to be able to specify our restore userid.
|
||||
assign_capability($data->capability, $data->permission, $newroleid, $this->task->get_contextid());
|
||||
$context = context::instance_by_id($this->task->get_contextid());
|
||||
$overrideableroles = get_overridable_roles($context, ROLENAME_SHORT);
|
||||
$safecapability = is_safe_capability($capability);
|
||||
|
||||
// Check if the new role is an overrideable role AND if the user performing the restore has the
|
||||
// capability to assign the capability.
|
||||
if (in_array($newrole->info['shortname'], $overrideableroles) &&
|
||||
($safecapability && has_capability('moodle/role:safeoverride', $context, $userid) ||
|
||||
!$safecapability && has_capability('moodle/role:override', $context, $userid))
|
||||
) {
|
||||
assign_capability($data->capability, $data->permission, $newroleid, $this->task->get_contextid());
|
||||
} else {
|
||||
$this->log("Insufficient capability to assign capability '{$data->capability}' to role!", backup::LOG_WARNING);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2137,11 +2152,22 @@ class restore_default_enrolments_step extends restore_execution_step {
|
||||
}
|
||||
|
||||
$course = $DB->get_record('course', array('id'=>$this->get_courseid()), '*', MUST_EXIST);
|
||||
// Return any existing course enrolment instances.
|
||||
$enrolinstances = enrol_get_instances($course->id, false);
|
||||
|
||||
if ($enrolinstances) {
|
||||
// Something already added instances.
|
||||
// Get the existing enrolment methods in the course.
|
||||
$enrolmethods = array_map(function($enrolinstance) {
|
||||
return $enrolinstance->enrol;
|
||||
}, $enrolinstances);
|
||||
|
||||
if ($DB->record_exists('enrol', array('courseid'=>$this->get_courseid(), 'enrol'=>'manual'))) {
|
||||
// Something already added instances, do not add default instances.
|
||||
$plugins = enrol_get_plugins(true);
|
||||
foreach ($plugins as $plugin) {
|
||||
foreach ($plugins as $pluginname => $plugin) {
|
||||
// Make sure all default enrolment methods exist in the course.
|
||||
if (!in_array($pluginname, $enrolmethods)) {
|
||||
$plugin->course_updated(true, $course, null);
|
||||
}
|
||||
$plugin->restore_sync_course($course);
|
||||
}
|
||||
|
||||
|
||||
@@ -178,6 +178,219 @@ class core_enrollib_testcase extends advanced_testcase {
|
||||
$this->assertEquals(array($course1->id, $course3->id, $course2->id), array_keys($courses));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test enrol_course_delete() without passing a user id. When a value for user id is not present, the method
|
||||
* should delete all enrolment related data in the course.
|
||||
*/
|
||||
public function test_enrol_course_delete_without_userid() {
|
||||
global $DB;
|
||||
|
||||
$this->resetAfterTest();
|
||||
|
||||
// Create users.
|
||||
$user1 = $this->getDataGenerator()->create_user();
|
||||
$user2 = $this->getDataGenerator()->create_user();
|
||||
// Create a course.
|
||||
$course = $this->getDataGenerator()->create_course();
|
||||
$coursecontext = context_course::instance($course->id);
|
||||
|
||||
$studentrole = $DB->get_record('role', ['shortname' => 'student']);
|
||||
|
||||
$manual = enrol_get_plugin('manual');
|
||||
$manualinstance = $DB->get_record('enrol', ['courseid' => $course->id, 'enrol' => 'manual'], '*', MUST_EXIST);
|
||||
// Enrol user1 as a student in the course using manual enrolment.
|
||||
$manual->enrol_user($manualinstance, $user1->id, $studentrole->id);
|
||||
|
||||
$self = enrol_get_plugin('self');
|
||||
$selfinstance = $DB->get_record('enrol', ['courseid' => $course->id, 'enrol' => 'self'], '*', MUST_EXIST);
|
||||
$self->update_status($selfinstance, ENROL_INSTANCE_ENABLED);
|
||||
// Enrol user2 as a student in the course using self enrolment.
|
||||
$self->enrol_user($selfinstance, $user2->id, $studentrole->id);
|
||||
|
||||
// Delete all enrolment related records in the course.
|
||||
enrol_course_delete($course);
|
||||
|
||||
// The course enrolment of user1 should not exists.
|
||||
$user1enrolment = $DB->get_record('user_enrolments',
|
||||
['enrolid' => $manualinstance->id, 'userid' => $user1->id]);
|
||||
$this->assertFalse($user1enrolment);
|
||||
|
||||
// The role assignment of user1 should not exists.
|
||||
$user1roleassignment = $DB->get_record('role_assignments',
|
||||
['roleid' => $studentrole->id, 'userid'=> $user1->id, 'contextid' => $coursecontext->id]
|
||||
);
|
||||
$this->assertFalse($user1roleassignment);
|
||||
|
||||
// The course enrolment of user2 should not exists.
|
||||
$user2enrolment = $DB->get_record('user_enrolments',
|
||||
['enrolid' => $selfinstance->id, 'userid' => $user2->id]);
|
||||
$this->assertFalse($user2enrolment);
|
||||
|
||||
// The role assignment of user2 should not exists.
|
||||
$user2roleassignment = $DB->get_record('role_assignments',
|
||||
['roleid' => $studentrole->id, 'userid'=> $user2->id, 'contextid' => $coursecontext->id]);
|
||||
$this->assertFalse($user2roleassignment);
|
||||
|
||||
// All existing course enrolment instances should not exists.
|
||||
$enrolmentinstances = enrol_get_instances($course->id, false);
|
||||
$this->assertCount(0, $enrolmentinstances);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test enrol_course_delete() when user id is present.
|
||||
* When a value for user id is present, the method should make sure the user has the proper capability to
|
||||
* un-enrol users before removing the enrolment data. If the capabilities are missing the data should not be removed.
|
||||
*
|
||||
* @dataProvider enrol_course_delete_with_userid_provider
|
||||
* @param array $excludedcapabilities The capabilities that should be excluded from the user's role
|
||||
* @param bool $expected The expected results
|
||||
*/
|
||||
public function test_enrol_course_delete_with_userid($excludedcapabilities, $expected) {
|
||||
global $DB;
|
||||
|
||||
$this->resetAfterTest();
|
||||
// Create users.
|
||||
$user1 = $this->getDataGenerator()->create_user();
|
||||
$user2 = $this->getDataGenerator()->create_user();
|
||||
$user3 = $this->getDataGenerator()->create_user();
|
||||
// Create a course.
|
||||
$course = $this->getDataGenerator()->create_course();
|
||||
$coursecontext = context_course::instance($course->id);
|
||||
|
||||
$studentrole = $DB->get_record('role', ['shortname' => 'student']);
|
||||
$editingteacherrole = $DB->get_record('role', ['shortname' => 'editingteacher']);
|
||||
|
||||
$manual = enrol_get_plugin('manual');
|
||||
$manualinstance = $DB->get_record('enrol', ['courseid' => $course->id, 'enrol' => 'manual'],
|
||||
'*', MUST_EXIST);
|
||||
// Enrol user1 as a student in the course using manual enrolment.
|
||||
$manual->enrol_user($manualinstance, $user1->id, $studentrole->id);
|
||||
// Enrol user3 as an editing teacher in the course using manual enrolment.
|
||||
// By default, the editing teacher role has the capability to un-enroll users which have been enrolled using
|
||||
// the existing enrolment methods.
|
||||
$manual->enrol_user($manualinstance, $user3->id, $editingteacherrole->id);
|
||||
|
||||
$self = enrol_get_plugin('self');
|
||||
$selfinstance = $DB->get_record('enrol', ['courseid' => $course->id, 'enrol' => 'self'],
|
||||
'*', MUST_EXIST);
|
||||
$self->update_status($selfinstance, ENROL_INSTANCE_ENABLED);
|
||||
// Enrol user2 as a student in the course using self enrolment.
|
||||
$self->enrol_user($selfinstance, $user2->id, $studentrole->id);
|
||||
|
||||
foreach($excludedcapabilities as $capability) {
|
||||
// Un-assign the given capability from the editing teacher role.
|
||||
unassign_capability($capability, $editingteacherrole->id);
|
||||
}
|
||||
|
||||
// Delete only enrolment related records in the course where user3 has the required capability.
|
||||
enrol_course_delete($course, $user3->id);
|
||||
|
||||
// Check the existence of the course enrolment of user1.
|
||||
$user1enrolmentexists = (bool) $DB->count_records('user_enrolments',
|
||||
['enrolid' => $manualinstance->id, 'userid' => $user1->id]);
|
||||
$this->assertEquals($expected['User 1 course enrolment exists'], $user1enrolmentexists);
|
||||
|
||||
// Check the existence of the role assignment of user1 in the course.
|
||||
$user1roleassignmentexists = (bool) $DB->count_records('role_assignments',
|
||||
['roleid' => $studentrole->id, 'userid' => $user1->id, 'contextid' => $coursecontext->id]);
|
||||
$this->assertEquals($expected['User 1 role assignment exists'], $user1roleassignmentexists);
|
||||
|
||||
// Check the existence of the course enrolment of user2.
|
||||
$user2enrolmentexists = (bool) $DB->count_records('user_enrolments',
|
||||
['enrolid' => $selfinstance->id, 'userid' => $user2->id]);
|
||||
$this->assertEquals($expected['User 2 course enrolment exists'], $user2enrolmentexists);
|
||||
|
||||
// Check the existence of the role assignment of user2 in the course.
|
||||
$user2roleassignmentexists = (bool) $DB->count_records('role_assignments',
|
||||
['roleid' => $studentrole->id, 'userid' => $user2->id, 'contextid' => $coursecontext->id]);
|
||||
$this->assertEquals($expected['User 2 role assignment exists'], $user2roleassignmentexists);
|
||||
|
||||
// Check the existence of the course enrolment of user3.
|
||||
$user3enrolmentexists = (bool) $DB->count_records('user_enrolments',
|
||||
['enrolid' => $manualinstance->id, 'userid' => $user3->id]);
|
||||
$this->assertEquals($expected['User 3 course enrolment exists'], $user3enrolmentexists);
|
||||
|
||||
// Check the existence of the role assignment of user3 in the course.
|
||||
$user3roleassignmentexists = (bool) $DB->count_records('role_assignments',
|
||||
['roleid' => $editingteacherrole->id, 'userid' => $user3->id, 'contextid' => $coursecontext->id]);
|
||||
$this->assertEquals($expected['User 3 role assignment exists'], $user3roleassignmentexists);
|
||||
|
||||
// Check the existence of the manual enrolment instance in the course.
|
||||
$manualinstance = (bool) $DB->count_records('enrol', ['enrol' => 'manual', 'courseid' => $course->id]);
|
||||
$this->assertEquals($expected['Manual course enrolment instance exists'], $manualinstance);
|
||||
|
||||
// Check existence of the self enrolment instance in the course.
|
||||
$selfinstance = (bool) $DB->count_records('enrol', ['enrol' => 'self', 'courseid' => $course->id]);
|
||||
$this->assertEquals($expected['Self course enrolment instance exists'], $selfinstance);
|
||||
}
|
||||
|
||||
/**
|
||||
* Data provider for test_enrol_course_delete_with_userid().
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function enrol_course_delete_with_userid_provider() {
|
||||
return [
|
||||
'The teacher can un-enrol users in a course' =>
|
||||
[
|
||||
'excludedcapabilities' => [],
|
||||
'results' => [
|
||||
// Whether certain enrolment related data still exists in the course after the deletion.
|
||||
// When the user has the capabilities to un-enrol users and the enrolment plugins allow manual
|
||||
// unenerolment than all course enrolment data should be removed.
|
||||
'Manual course enrolment instance exists' => false,
|
||||
'Self course enrolment instance exists' => false,
|
||||
'User 1 course enrolment exists' => false,
|
||||
'User 1 role assignment exists' => false,
|
||||
'User 2 course enrolment exists' => false,
|
||||
'User 2 role assignment exists' => false,
|
||||
'User 3 course enrolment exists' => false,
|
||||
'User 3 role assignment exists' => false
|
||||
],
|
||||
],
|
||||
'The teacher cannot un-enrol self enrolled users' =>
|
||||
[
|
||||
'excludedcapabilities' => [
|
||||
// Exclude the following capabilities for the editing teacher.
|
||||
'enrol/self:unenrol'
|
||||
],
|
||||
'results' => [
|
||||
// When the user does not have the capabilities to un-enrol self enrolled users, the data
|
||||
// related to this enrolment method should not be removed. Everything else should be removed.
|
||||
'Manual course enrolment instance exists' => false,
|
||||
'Self course enrolment instance exists' => true,
|
||||
'User 1 course enrolment exists' => false,
|
||||
'User 1 role assignment exists' => false,
|
||||
'User 2 course enrolment exists' => true,
|
||||
'User 2 role assignment exists' => true,
|
||||
'User 3 course enrolment exists' => false,
|
||||
'User 3 role assignment exists' => false
|
||||
],
|
||||
],
|
||||
'The teacher cannot un-enrol self and manually enrolled users' =>
|
||||
[
|
||||
'excludedcapabilities' => [
|
||||
// Exclude the following capabilities for the editing teacher.
|
||||
'enrol/manual:unenrol',
|
||||
'enrol/self:unenrol'
|
||||
],
|
||||
'results' => [
|
||||
// When the user does not have the capabilities to un-enrol self and manually enrolled users,
|
||||
// the data related to these enrolment methods should not be removed.
|
||||
'Manual course enrolment instance exists' => true,
|
||||
'Self course enrolment instance exists' => true,
|
||||
'User 1 course enrolment exists' => true,
|
||||
'User 1 role assignment exists' => true,
|
||||
'User 2 course enrolment exists' => true,
|
||||
'User 2 role assignment exists' => true,
|
||||
'User 3 course enrolment exists' => true,
|
||||
'User 3 role assignment exists' => true
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
public function test_enrol_user_sees_own_courses() {
|
||||
global $DB, $CFG;
|
||||
|
||||
|
||||
@@ -35,9 +35,9 @@ $string['cliansweryes'] = 'نعم';
|
||||
$string['cliincorrectvalueerror'] = 'خطأ، القيمة "{$a->value}" غير صحيحة من أجل "{$a->option}"';
|
||||
$string['cliincorrectvalueretry'] = 'قيمة غير صحيحة، حاول مرة أخرى';
|
||||
$string['clitypevalue'] = 'اكتب قيمة';
|
||||
$string['clitypevaluedefault'] = 'اكتب قيمة أو اضغط زر الإدخال لاستخدام القيم الافتراضية ({$a})';
|
||||
$string['clitypevaluedefault'] = 'أدخل القيمة أو إضغط مفتاح Enter لاستعمال القيمة الافتراضية ({$a})';
|
||||
$string['cliunknowoption'] = 'خيارات غير معروفة: {$a} الرجاء استخدام -- خيار المساعدة.';
|
||||
$string['cliyesnoprompt'] = 'أدخل (Y) و تعني نعم أو (N) و تعني لا';
|
||||
$string['environmentrequireinstall'] = 'يجب تثبيته و تمكينه';
|
||||
$string['environmentrequireversion'] = 'مطلوب الإصدار {$a->needed} ، و أنت تشغل الإصدار {$a->current}';
|
||||
$string['cliyesnoprompt'] = 'أدخل y (وتعني نعم) أو n (وتعني لا)';
|
||||
$string['environmentrequireinstall'] = 'يجب تنصيبه/تمكينه';
|
||||
$string['environmentrequireversion'] = 'يتطلب الإصدار {$a->needed}، وأنت تستعمل الإصدار {$a->current}';
|
||||
$string['upgradekeyset'] = 'مفتاح التحديث (اتركها فارغة إن لم ترغب بتحديده)';
|
||||
|
||||
@@ -30,12 +30,12 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$string['cannotcreatedboninstall'] = '<p> لا يمكن إنشاء قاعدة البيانات. </p>
|
||||
<p> لا وجود لقاعدة البيانات المحددة والمستخدم المُعين ليس لديه إذن لإنشاء قاعدة البيانات. </ p>
|
||||
<p> المسؤول عن الموقع يجب أن يتحقق من إعدادات قاعدة بيانات. </p>';
|
||||
$string['cannotcreatedboninstall'] = '<p>لا يمكن إنشاء قاعدة البيانات.</p>
|
||||
<p>لا وجود لقاعدة البيانات المحددة والمستخدم المُعطى ليس لديه صلاحية إنشاء قاعدة البيانات.</p>
|
||||
<p>مسؤول الموقع يجب أن يتحقق من إعدادات قاعدة البيانات.</p>';
|
||||
$string['cannotcreatelangdir'] = 'لا يمكن إنشاء مجلد اللغة';
|
||||
$string['cannotcreatetempdir'] = 'لا يمكن إنشاء المجلد المؤقت';
|
||||
$string['cannotdownloadcomponents'] = 'لم يتم تحميل العناصر';
|
||||
$string['cannotdownloadcomponents'] = 'تعذر تنزيل المُكونات';
|
||||
$string['cannotdownloadzipfile'] = 'لم يتم تحميل الملف المضغوط';
|
||||
$string['cannotfindcomponent'] = 'لم يتم العثور على المكون';
|
||||
$string['cannotsavemd5file'] = 'لم يتم حفظ ملف md5';
|
||||
@@ -46,3 +46,8 @@ $string['dmlexceptiononinstall'] = '<p>حدث خطأ في قاعدة البيا
|
||||
$string['downloadedfilecheckfailed'] = 'فشل التحقق من الملف الذي تم تنزيله';
|
||||
$string['invalidmd5'] = 'المتغير المُختار خاطئ - حاول مرة أخرى';
|
||||
$string['missingrequiredfield'] = 'بعض الحقول المطلوبة مفقودة';
|
||||
$string['remotedownloaderror'] = '<p>فشل تنزيل المكون إلى مُخدمك. لطفاً تحقق من إعدادات الوكيل؛ الامتداد cURL لـ PHP موصى به بشدة.</p>
|
||||
<p>عليك تنزيل الملف <a href="{$a->url}">{$a->url}</a> يدوياً، ونسخه إلى "{$a->dest}" في مُخدمك ثم القيام بفك ضغطه هناك.</p>';
|
||||
$string['wrongdestpath'] = 'مسار الهدف خاطئ';
|
||||
$string['wrongsourcebase'] = 'أساس رابط المصدر خاطئ';
|
||||
$string['wrongzipfilename'] = 'تسمية الملف المضغوط خاطئة';
|
||||
|
||||
+66
-12
@@ -31,22 +31,76 @@
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$string['admindirname'] = 'مجلد الإدارة';
|
||||
$string['availablelangs'] = 'حزم اللغة المتوفره';
|
||||
$string['chooselanguagehead'] = 'اختر اللغة';
|
||||
$string['availablelangs'] = 'حزم اللغات المتاحة';
|
||||
$string['chooselanguagehead'] = 'إختر اللغة';
|
||||
$string['chooselanguagesub'] = 'الرجاء حدد لغة للتثبيت. هذه اللغة ستستخدم أيضاً كاللغة الافتراضية للموقع، لكن يمكنك تغييرها لاحقا.';
|
||||
$string['clialreadyinstalled'] = 'الملف config.php موجود مسبقاً، يرجى استخدام admin/cli/upgrade.php إن كنت تريد تحديث موقعك.';
|
||||
$string['clialreadyconfigured'] = 'ملف التهيئة config.php موجود سلفاً. لطفاً، استعمل الرابط ذي المسار admin/cli/install_database.php لتنصيب مودل في هذا الموقع.';
|
||||
$string['clialreadyinstalled'] = 'ملف التهيئة config.php موجود سلفاً. لطفاً، استعمل الرابط ذي المسار admin/cli/install_database.php لترقية مودل في هذا الموقع.';
|
||||
$string['cliinstallheader'] = 'برنامج تنصيب مودل {$a} عبر سطر الأوامر النصية';
|
||||
$string['databasehost'] = 'مستضيف قاعدة البيانات';
|
||||
$string['databasename'] = 'اسم قاعدة البيانات';
|
||||
$string['databasetypehead'] = 'إختر مشغل قاعدة البيانات';
|
||||
$string['dataroot'] = 'مجلد البيانات';
|
||||
$string['dbprefix'] = 'مقدمة الجداول';
|
||||
$string['datarootpermission'] = 'صلاحيات مجلدات البيانات';
|
||||
$string['dbprefix'] = 'بادئة الجداول';
|
||||
$string['dirroot'] = 'مجلد مودل';
|
||||
$string['environmenthead'] = 'يتم فحص البيئة';
|
||||
$string['installation'] = 'تثبيت';
|
||||
$string['paths'] = 'مسارات';
|
||||
$string['environmentsub2'] = 'كل إصدار من مودل يتطلب وجود إصدار معين من PHP على الأقل مع عدد من امتداداته الإجبارية.
|
||||
يجري فحص شامل لبيئة العمل قبل كل تنصيب وترقية. لطفاً، تواصل مع المشرف على المخدم إن لم تكن على دراية بكيفية تنصيب الإصدار الأحدث من PHP أو امتداداته.';
|
||||
$string['errorsinenvironment'] = 'فشلت مهمة التحقق من بيئة التشغيل!';
|
||||
$string['installation'] = 'التثبيت';
|
||||
$string['langdownloaderror'] = 'مع الأسف، اللغة "{$a}" تعذر تنزيلها. عملية التنصيب ستستمر باللغة الإنجليزية.';
|
||||
$string['memorylimithelp'] = '<p>إن حد استعمال الذاكرة لـ PHP في مخدمك حالياً هو {$a}.</p>
|
||||
|
||||
<p>هذا قد يسبب لمودل مشاكل في الذاكرة لاحقاً، خصوصاً
|
||||
إن كانت لديك الكثير من الوحدات مُمَكَّنة و/أو الكثير من المستخدمين.</p>
|
||||
|
||||
<p>نوصي بضبط ذاكرة PHP على حد أعلى إن أمكن، مثلاً 40M.
|
||||
هناك عدة طرق للقيام بذلك والتي بإمكانك تجربتها:</p>
|
||||
<ol>
|
||||
<li>إن كنت تستطيع القيام بذلك، أعد تجميع PHP مع المفتاح <i>--enable-memory-limit</i>.
|
||||
هذا سيسمح لمودل بضبط حد الذاكرة بنفسه.</li>
|
||||
<li>إن كنت تستطيع الوصول إلى ملف php.ini، يمكنك تغيير الخاصية <b>memory_limit</b>
|
||||
هناك إلى شيء آخر مثل 40M. إن لم يكن بإمكانك الوصول إليه
|
||||
فقد تستطيع مطالبة المشرف بالقيام بذلك من جانبه.</li>
|
||||
<li>في بعض مخدمات PHP يمكنك إنشاء ملف .htaccess في مجلد مودل
|
||||
وجعله محتوياً على السطر الآتي:
|
||||
<blockquote><div>php_value memory_limit 40M</div></blockquote>
|
||||
<p>مع ذلك، في بعض المخدمات، هذا من شأنه منع <b>كل</b> صفحات PHP من العمل
|
||||
(ستشاهد أخطاءً عند النظر إلى الصفحات) مما يحتم عليك إزالة ملف .htaccess.</p></li>
|
||||
</ol>';
|
||||
$string['paths'] = 'المسارات';
|
||||
$string['pathserrcreatedataroot'] = 'مجلد البيانات ({$a->dataroot}) لا يمكن إنشاؤه من قبل برنامج التنصيب.';
|
||||
$string['pathshead'] = 'تأكيد المسارات';
|
||||
$string['phpversion'] = 'أصدار PHP';
|
||||
$string['phpversionhelp'] = '<p> يتطلب مودل على الاقل الأصدار 4.3.0 لـ PHP </p>
|
||||
<p> انت تستخدم الأصدار {$a} </p>
|
||||
<p> يجب عليك ترقية PHP أو الانتقال إلى مستظيف أخر لديه أصدار اجد لـ PHP.</p>
|
||||
في حالة وجود إصدار 5.0 فما بعد يمكنك الرجوع إلى إصدار 4.4 فما بعد';
|
||||
$string['wwwroot'] = 'WWW';
|
||||
$string['pathsrodataroot'] = 'مجلد البيانات الرئيسي غير قابل للكتابة.';
|
||||
$string['pathsroparentdataroot'] = 'المجلد ذي الرتبة الأعلى ({$a->parent}) غير قابل للكتابة. مجلد البيانات ({$a->dataroot}) لا يمكن إنشاؤه من قِبَل برنامج التنصيب.';
|
||||
$string['pathssubadmindir'] = 'القليل جداً من مستضيفي الويب يستعمل /admin بمثابة رابط للوصول إلى لوحة التحكم أو ما سواها. لسوء الحظ هذا يتعارض مع الموضع القياسي لصفحات إدارة مودل. يمكنك حل هذه المشكلة عبر إعادة تسمية مجلد الإدارة admin في نسختك من هذا التنصيب، لتضع هذا الاسم الجديد هنا. مثلاً: <em>moodleadmin</em>. هذا من شأنه إصلاح روابط الإدارة في مودل.';
|
||||
$string['pathssubdataroot'] = '<p>المجلد الذي يخزن فيه مودل كل المحتوى من الملفات التي يرفعها المستخدمون.</p>
|
||||
<p>هذا المجلد ينبغي أن يكون قابلاً للقراءة والكتابة من قبل مستخدم مخدم الويب (عادة هو \'www-data\'، \'nobody\'، أو \'apache\').</p>
|
||||
<p>ينبغي أن لا يكون متاحاً للوصول المباشر عبر الويب.</p>
|
||||
<p>إن كان المجلد غير موجود حالياً، فعملية التنصيب ستحاول إنشاءه.</p>';
|
||||
$string['pathssubdirroot'] = '<p>المسار الكامل للمجلد الذي يحتوي على ترميز نظام مودل.</p>';
|
||||
$string['pathssubwwwroot'] = '<p>العنوان الكامل حيث سيتم الوصول به إلى مودل، بعبارة أخرى، العنوان الذي على المستخدمين إدخاله في شريط العناوين لمستعرض الإنترنت للوصول إلى مودل.</p>
|
||||
<p>ليس من الممكن الوصول إلى مودل عبر عناوين متعددة. إن كان موقعك قابلاً للوصول عبر عناوين متعددة، فعليك اختيار أسهلها واستعمل إعادة توجيه دائمية من باقي العناوين إلى هذا العنوان.</p>
|
||||
<p>إن كان موقعك قابلاً للوصول من شبكة الإنترنت ومن شبكتك الداخلية، الإنترانت، استعمل العنوان الخارجي على الإنترنت هنا.</p>
|
||||
<p>إذا كان العنوان الحالي خاطئاً، لطفاً، غيِّر الرابط في شريط العناوين لمتصفحك ثم أعد عملية التنصيب.</p>';
|
||||
$string['pathsunsecuredataroot'] = 'موضع مجلد البيانات الرئيسي غير مُؤَمن';
|
||||
$string['pathswrongadmindir'] = 'مجلد المشرف غير موجود';
|
||||
$string['phpextension'] = 'إمتداد PHP {$a}';
|
||||
$string['phpversion'] = 'إصدار PHP';
|
||||
$string['phpversionhelp'] = '<p> يتطلب مودل على الاقل وجود PHP بالاصدار 5.6.5 أو 7.1 (الإصدار 7.0.x فيه بعض القيود عند التشغيل).</p>
|
||||
<p> انت تستعمل حالياً الإصدار {$a}.</p>
|
||||
<p> يجب عليك ترقية PHP أو الانتقال إلى مستضيف آخر لديه إصدار أحدث من PHP.</p>';
|
||||
$string['welcomep10'] = '{$a->installername} ({$a->installerversion})';
|
||||
$string['welcomep20'] = 'أنت تشاهد هذه الصفحة لأنك تمكنت بنجاح من تنصيب وإطلاق
|
||||
حزمة <strong>{$a->packname} {$a->packversion}</strong> في حاسبتك. تهانينا!';
|
||||
$string['welcomep30'] = 'الإطلاق العائد لـ <strong>{$a->installername}</strong> يتضمن
|
||||
التطبيقات المعدة لإنشاء بيئة تسمح لـ <strong>مودل</strong> بالعمل، وهي:';
|
||||
$string['welcomep40'] = 'الحزمة تتضمن أيضاً <strong>مودل {$a->moodlerelease} ({$a->moodleversion})</strong>.';
|
||||
$string['welcomep50'] = 'استعمال كل التطبيقات في هذه الحزمة محكوم برخصها. حزمة التنصيب <strong>{$a->installername}</strong> الكاملة هي <a href="https://www.opensource.org/docs/definition_plain.html">مفتوحة المصدر</a> وموزعة بموجب الرخصة <a href="https://www.gnu.org/copyleft/gpl.html">GPL</a>.';
|
||||
$string['welcomep60'] = 'الصفحات الآتية ستقودك عبر خطوات سهلة التتبع لتنصيب
|
||||
وتهيئة <strong>مودل</strong> في حاسبتك. يمكنك قبول
|
||||
الإعدادات الافتراضية، أو إختيارياً، تغييرها بما يتناسب مع احتياجاتك الخاصة.';
|
||||
$string['welcomep70'] = 'أنقر زر "التالي" أدناه لمتابعة عملية تنصيب
|
||||
<strong>مودل</strong>.';
|
||||
$string['wwwroot'] = 'عنوان الويب';
|
||||
|
||||
@@ -34,4 +34,4 @@ $string['language'] = 'اللغة';
|
||||
$string['moodlelogo'] = 'شعار مودل';
|
||||
$string['next'] = 'التالي';
|
||||
$string['previous'] = 'السابق';
|
||||
$string['reload'] = 'إعادة تحميل';
|
||||
$string['reload'] = 'إعادة التحميل';
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
<?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/>.
|
||||
|
||||
/**
|
||||
* Automatically generated strings for Moodle installer
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* @package installer
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$string['thislanguage'] = 'Mapudungún';
|
||||
@@ -30,5 +30,6 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$string['parentlanguage'] = '-';
|
||||
$string['thisdirection'] = 'ltr';
|
||||
$string['thislanguage'] = 'Հայերեն';
|
||||
|
||||
@@ -32,7 +32,7 @@ defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$string['admindirname'] = 'Cartella Admin';
|
||||
$string['availablelangs'] = 'Elenco delle lingue disponibili';
|
||||
$string['chooselanguagehead'] = 'Scegli la lingua';
|
||||
$string['chooselanguagehead'] = 'Seleziona lingua';
|
||||
$string['chooselanguagesub'] = 'Scegli la lingua da usare durante l\'installazione. La lingua usata nel sito e dagli utenti potrà essere modificata in seguito.';
|
||||
$string['clialreadyconfigured'] = 'Il file di configurazione config.php è già presente.
|
||||
Utilizzare admin/cli/install_database.php per installare Moodle.';
|
||||
@@ -53,16 +53,16 @@ $string['installation'] = 'Installazione';
|
||||
$string['langdownloaderror'] = 'Purtroppo non è stato possibile scaricare la lingua "{$a}". L\'installazione proseguirà in lingua Inglese.';
|
||||
$string['memorylimithelp'] = '<p>Il limite di memoria assegnata al PHP attualmente è {$a}.</p>
|
||||
|
||||
<p>Tale limite potrà causare problemi nel funzionamento di Moodle, specialmente se usi molti moduli di attività con molti utenti.</p>
|
||||
<p>Tale limite potrà causare problemi nel funzionamento di Moodle, specialmente se si utilizzano molti moduli di attività con molti utenti.</p>
|
||||
|
||||
<p>Ti raccomandiamo di impostare il PHP con un limite più alto, ad esempio 40M, usando uno dei modi seguenti:
|
||||
<p>Raccomandiamo di impostare il PHP con un limite più alto, ad esempio 40M, usando uno dei modi seguenti:
|
||||
<ol>
|
||||
<li>Se possibile, ricompila il PHP con l\'opzione <i>--enable-memory-limit</i>.
|
||||
<li>Se possibile, ricompilare il PHP con l\'opzione <i>--enable-memory-limit</i>.
|
||||
Questo consentirà a Moodle di impostare in autonomia il limite di memoria.</li>
|
||||
<li>Se hai accesso al file php.ini, è possibile modificare la variabile <b>memory_limit</b> a un valore più alto, ad esempio 40M. Se non hai accesso, puoi chiedere all\'amministratore di sistema di farlo.</li>
|
||||
<li>Se si ha accesso al file php.ini, è possibile modificare la variabile <b>memory_limit</b> a un valore più alto, ad esempio 40M. Se non hai accesso, puoi chiedere all\'amministratore di sistema di farlo.</li>
|
||||
<li>Su alcuni server con il PHP è possibile creare un file .htaccess nella cartella di Moodle contenente questa linea:
|
||||
<blockquote>php_value memory_limit 40M</blockquote>
|
||||
<p>Tuttavia, su alcuni server la direttiva potrebbe impedire a <b>tutte</b> le pagine PHP di funzionare (appariranno degli errori durante la visualizzazione delle pagine), in tal caso dovrai rimuovere il file .htaccess.</li></ol>';
|
||||
<p>Tuttavia, su alcuni server la direttiva potrebbe impedire a <b>tutte</b> le pagine PHP di funzionare (appariranno degli errori durante la visualizzazione delle pagine), in tal caso si dovrà rimuovere il file .htaccess.</li></ol>';
|
||||
$string['paths'] = 'Percorsi';
|
||||
$string['pathserrcreatedataroot'] = 'Lo script di installazione non ha potuto creare la Cartella dei dati ({$a->dataroot}).';
|
||||
$string['pathshead'] = 'Conferma percorsi';
|
||||
|
||||
@@ -32,7 +32,13 @@ defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$string['clianswerno'] = 'n';
|
||||
$string['cliansweryes'] = 'y';
|
||||
$string['cliincorrectvalueerror'] = 'Алдаа! "{$a->option}" - ийн "{$a->value}" утга буруу байна.';
|
||||
$string['cliincorrectvalueretry'] = 'Буруу утга, дахин оролдоно уу';
|
||||
$string['clitypevalue'] = 'төрлийн утга';
|
||||
$string['clitypevaluedefault'] = 'Утга бич, эсвэл Enter дарж ({$a}) тогтмол утга сонго.';
|
||||
$string['cliunknowoption'] = 'Танихгүй сонголтууд:
|
||||
{$a}
|
||||
Тусламж хэсгийг сонгоно уу.';
|
||||
$string['cliyesnoprompt'] = 'y (гэвэл Тийм) n (гэвэл Үгүй)';
|
||||
$string['environmentrequireinstall'] = 'суусан/идэвхжсэн байх ёстой';
|
||||
$string['environmentrequireversion'] = 'та {$a->current} хувилбар ашиглаж байна {$a->needed} хувилбарыг ашиглагх ёстой';
|
||||
|
||||
@@ -44,7 +44,7 @@ $string['dmlexceptiononinstall'] = '<p>Ocorreu um erro de base de dados [{$a->er
|
||||
$string['downloadedfilecheckfailed'] = 'A verificação do ficheiro descarregado falhou.';
|
||||
$string['invalidmd5'] = 'A variável de verificação está errada - tente novamente.';
|
||||
$string['missingrequiredfield'] = 'Um dos campos obrigatórios está em falta';
|
||||
$string['remotedownloaderror'] = 'Não foi possível descarregar o componente para o servidor. Verifique as configurações do proxy. A instalação da extensão cURL do PHP é muito recomendada.<br /><br />Terá de descarregar manualmente o ficheiro <a href="{$a->url}">{$a->url}</a>, copiá-lo para a pasta "{$a->dest}" no seu servidor e descompactá-lo';
|
||||
$string['remotedownloaderror'] = 'Não foi possível descarregar o componente para o servidor. Verifique as configurações do proxy. É altamente recomendado a instalação da extensão cURL do PHP.<br /><br />Terá de descarregar manualmente o ficheiro <a href="{$a->url}">{$a->url}</a>, copiá-lo para a pasta "{$a->dest}" no seu servidor e descompactá-lo.';
|
||||
$string['wrongdestpath'] = 'Caminho de destino errado';
|
||||
$string['wrongsourcebase'] = 'Base do URL de origem errada';
|
||||
$string['wrongzipfilename'] = 'Nome de ficheiro ZIP errado';
|
||||
|
||||
@@ -48,7 +48,7 @@ $string['environmenthead'] = 'A verificar sistema...';
|
||||
$string['environmentsub2'] = 'Cada nova versão do Moodle tem pré-requisitos mínimos relativamente à versão do PHP e extensões necessárias para o seu correto funcionamento. Estes pré-requisitos são verificados sempre que o Moodle é instalado ou atualizado. Contacte o administrador do servidor caso seja necessário atualizar a versão do PHP ou instalar novas extensões.';
|
||||
$string['errorsinenvironment'] = 'A verificação do sistema falhou!';
|
||||
$string['installation'] = 'Instalação';
|
||||
$string['langdownloaderror'] = 'Não foi possível descarregar o idioma <b>{$a}</b> . O processo de instalação continuará em Inglês.';
|
||||
$string['langdownloaderror'] = 'Não foi possível descarregar o idioma \'<b>{$a}</b>\' . O processo de instalação continuará em Inglês.';
|
||||
$string['memorylimithelp'] = '<p>O limite de memória para o PHP definido atualmente no servidor é <b>{$a}</b>.</p><p>Um número elevado de módulos em utilização ou de utilizadores registados pode fazer com que o Moodle apresente problemas de falta de memória.</p><p>É recomendado que o PHP seja configurado com um limite de memória de pelo menos 40MB. Esta configuração pode ser definida de diversas formas:</p><ol><li>Compilação do PHP com o parâmetro <b>--enable-memory-limit</b>. Esta definição permitirá ao próprio Moodle definir o valor a utilizar.</li><li>Alteração do parâmetro <b>memory_limit</b> no ficheiro de configuração do PHP para um valor igual ou superior a 40MB.</li><li>Criação de um ficheiro <b>.htaccess</b> na raiz da pasta do Moodle com a linha <b>php_value memory_limit 40M</b><p><strong>Atenção</strong>: Em alguns servidores esta configuração impedirá o funcionamento de <b>todas</b> as páginas PHP. Nestes casos, não poderá ser utilizado o ficheiro <b>.htaccess</b>.</p></li></ol>';
|
||||
$string['paths'] = 'Caminhos';
|
||||
$string['pathserrcreatedataroot'] = 'O programa de instalação não conseguiu criar a pasta de dados <b>{$a->dataroot}</b>.';
|
||||
@@ -58,8 +58,8 @@ $string['pathsroparentdataroot'] = 'A pasta ascendente <b>{$a->parent}</b> não
|
||||
$string['pathssubadmindir'] = 'Alguns servidores Web utilizam a pasta <strong>admin</strong> em URLs especiais de acesso a funcionalidades especiais, como é o caso de painéis de controlo. Algumas situações podem criar conflitos com a localização normal das páginas de administração do Moodle. Estes problemas podem ser resolvidos renomeando a pasta <strong>admin</strong> na instalação do Moodle e indicando aqui o novo nome a utilizar. Por exemplo:<br /><br /><b>moodleadmin</b><br /><br />Esta ação resolverá os problemas de acesso das hiperligações para as funcionalidades de administração do Moodle.';
|
||||
$string['pathssubdataroot'] = '<p>Uma diretoria em que o Moodle irá armazenar todo o conteúdo de ficheiros enviados pelos utilizadores.</p>
|
||||
<p>Esta diretoria deve ser legível e gravável pelo utilizador do servidor web (geralmente \'www-data\', \'nobody\', ou \'apache\').</p>
|
||||
<p>Não deve ser diretamente acessível através da web.</p>
|
||||
<p> Se a diretoria não existir atualmente, o processo de instalação tentará criá-la.</p>';
|
||||
<p>Não deve ser acessível diretamente através da web.</p>
|
||||
<p>Se a diretoria não existir, o processo de instalação tentará criá-la.</p>';
|
||||
$string['pathssubdirroot'] = 'Caminho completo para a diretoria que contém o código Moodle.';
|
||||
$string['pathssubwwwroot'] = 'Endereço web completo de acesso ao Moodle. Não é possível aceder ao Moodle usando mais do que um endereço. Se o site tiver mais do que um endereço público, devem ser configurados redirecionamentos permanentes em todos eles, à exceção deste. Se o site pode ser acedido a partir da Internet e de Intranet, use o endereço público aqui. Se o endereço atual não está correto, altere o endereço indicado na barra de endereço do seu navegador e reinicie a instalação.';
|
||||
$string['pathsunsecuredataroot'] = 'A localização da pasta de dados não é segura';
|
||||
@@ -74,7 +74,6 @@ $string['welcomep20'] = 'A apresentação desta página confirma a correta insta
|
||||
$string['welcomep30'] = 'Esta versão do pacote <strong>{$a->installername}</strong> inclui as aplicações necessárias para o correto funcionamento do <strong>Moodle</strong>, nomeadamente:';
|
||||
$string['welcomep40'] = 'Este pacote inclui o lançamento <strong>{$a->moodlerelease} do Moodle ({$a->moodleversion})</strong>.';
|
||||
$string['welcomep50'] = 'A utilização de todas as aplicações incluídas neste pacote é limitada pelas respetivas licenças. O pacote completo <strong>{$a->installername}</strong> é <ahref="https://www.opensource.org/docs/definition_plain.html">código aberto</a> e é distribuído nos termos da licença <a href="http://www.gnu.org/copyleft/gpl.html">GPL</a>.';
|
||||
$string['welcomep60'] = 'As páginas seguintes irão levá-lo através de alguns passos simples para
|
||||
configurar e definir o <strong>Moodle</strong> no seu computador. Você pode aceitar as configurações predefinidas ou, opcionalmente, alterá-las para atender às suas próprias necessidades.';
|
||||
$string['welcomep60'] = 'As páginas seguintes irão acompanhá-lo através de algumas etapas simples para configurar e definir o <strong>Moodle</strong> no seu computador. Pode aceitar as configurações predefinidas ou, opcionalmente, alterá-las para adaptar às suas próprias necessidades.';
|
||||
$string['welcomep70'] = 'Clique no botão "Seguinte" para continuar a configuração do <strong>Moodle</strong>.';
|
||||
$string['wwwroot'] = 'Endereço web';
|
||||
|
||||
@@ -45,3 +45,9 @@ $string['componentisuptodate'] = 'కాంపొనెంటు తాజాగ
|
||||
$string['dmlexceptiononinstall'] = '<p>A డేటాబేస్ లోపం ఏర్పడింది [{$ a-> errorcode}]. <br /> {$a->debuginfo} </p>';
|
||||
$string['downloadedfilecheckfailed'] = 'డౌన్లోడ్ చేసిన ఫైల్ తనిఖీ విఫలమైంది';
|
||||
$string['invalidmd5'] = 'చెక్ వేరియబుల్ తప్పు. - మళ్ళీ ప్రయత్నించండి';
|
||||
$string['missingrequiredfield'] = 'కొన్ని అవసరమైన ఫీల్డ్ లేదు';
|
||||
$string['remotedownloaderror'] = '<p> మీ సర్వర్ కు భాగం యొక్క డౌన్లోడ్ విఫలమైంది. దయచేసి ప్రాక్సీ సెట్టింగ్లను ధృవీకరించండి; PHP కర్ల్ పొడిగింపు సిఫారసు చేయబడుతుంది.</p>
|
||||
<p> మీరు <a href="{$a->url} "> {$a->url} </a> ను మానవీయంగా డౌన్ లోడ్ చేసుకోవాలి, దీన్ని మీ సర్వర్లో" {$a->dest} "కు కాపీ చెయ్యండి అక్కడ దాన్ని అన్జిప్ చేయండి.</p>';
|
||||
$string['wrongdestpath'] = 'తప్పు గమ్యం మార్గం';
|
||||
$string['wrongsourcebase'] = 'తప్పు మూలం URL బేస్';
|
||||
$string['wrongzipfilename'] = 'తప్పు జిప్ ఫైల్ పేరు';
|
||||
|
||||
+17
-2
@@ -1064,20 +1064,35 @@ function enrol_user_delete($user) {
|
||||
|
||||
/**
|
||||
* Called when course is about to be deleted.
|
||||
* If a user id is passed, only enrolments that the user has permission to un-enrol will be removed,
|
||||
* otherwise all enrolments in the course will be removed.
|
||||
*
|
||||
* @param stdClass $course
|
||||
* @param int|null $userid
|
||||
* @return void
|
||||
*/
|
||||
function enrol_course_delete($course) {
|
||||
function enrol_course_delete($course, $userid = null) {
|
||||
global $DB;
|
||||
|
||||
$context = context_course::instance($course->id);
|
||||
$instances = enrol_get_instances($course->id, false);
|
||||
$plugins = enrol_get_plugins(true);
|
||||
|
||||
if ($userid) {
|
||||
// If the user id is present, include only course enrolment instances which allow manual unenrolment and
|
||||
// the given user have a capability to perform unenrolment.
|
||||
$instances = array_filter($instances, function($instance) use ($userid, $plugins, $context) {
|
||||
$unenrolcap = "enrol/{$instance->enrol}:unenrol";
|
||||
return $plugins[$instance->enrol]->allow_unenrol($instance) &&
|
||||
has_capability($unenrolcap, $context, $userid);
|
||||
});
|
||||
}
|
||||
|
||||
foreach ($instances as $instance) {
|
||||
if (isset($plugins[$instance->enrol])) {
|
||||
$plugins[$instance->enrol]->delete_instance($instance);
|
||||
}
|
||||
// low level delete in case plugin did not do it
|
||||
$DB->delete_records('user_enrolments', array('enrolid'=>$instance->id));
|
||||
$DB->delete_records('role_assignments', array('itemid'=>$instance->id, 'component'=>'enrol_'.$instance->enrol));
|
||||
$DB->delete_records('user_enrolments', array('enrolid'=>$instance->id));
|
||||
$DB->delete_records('enrol', array('id'=>$instance->id));
|
||||
|
||||
+5
-2
@@ -5270,11 +5270,14 @@ function remove_course_contents($courseid, $showfeedback = true, array $options
|
||||
}
|
||||
unset($childcontexts);
|
||||
|
||||
// Remove all roles and enrolments by default.
|
||||
// Remove roles and enrolments by default.
|
||||
if (empty($options['keep_roles_and_enrolments'])) {
|
||||
// This hack is used in restore when deleting contents of existing course.
|
||||
// During restore, we should remove only enrolment related data that the user performing the restore has a
|
||||
// permission to remove.
|
||||
$userid = $options['userid'] ?? null;
|
||||
enrol_course_delete($course, $userid);
|
||||
role_unassign_all(array('contextid' => $coursecontext->id, 'component' => ''), true);
|
||||
enrol_course_delete($course);
|
||||
if ($showfeedback) {
|
||||
echo $OUTPUT->notification($strdeleted.get_string('type_enrol_plural', 'plugin'), 'notifysuccess');
|
||||
}
|
||||
|
||||
@@ -266,6 +266,7 @@ class mod_data_external extends external_api {
|
||||
'warnings' => $warnings
|
||||
);
|
||||
|
||||
$groupmode = groups_get_activity_groupmode($cm);
|
||||
if (!empty($params['groupid'])) {
|
||||
$groupid = $params['groupid'];
|
||||
// Determine is the group is visible to user.
|
||||
@@ -274,7 +275,6 @@ class mod_data_external extends external_api {
|
||||
}
|
||||
} else {
|
||||
// Check to see if groups are being used here.
|
||||
$groupmode = groups_get_activity_groupmode($cm);
|
||||
if ($groupmode) {
|
||||
$groupid = groups_get_activity_group($cm);
|
||||
} else {
|
||||
@@ -981,10 +981,10 @@ class mod_data_external extends external_api {
|
||||
// Check database is open in time.
|
||||
data_require_time_available($database, null, $context);
|
||||
|
||||
$groupmode = groups_get_activity_groupmode($cm);
|
||||
// Determine default group.
|
||||
if (empty($params['groupid'])) {
|
||||
// Check to see if groups are being used here.
|
||||
$groupmode = groups_get_activity_groupmode($cm);
|
||||
if ($groupmode) {
|
||||
$groupid = groups_get_activity_group($cm);
|
||||
} else {
|
||||
|
||||
@@ -379,6 +379,45 @@ class mod_data_external_testcase extends externallib_advanced_testcase {
|
||||
$this->assertEquals(0, $result['entrieslefttoview']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get_data_access_information with groups.
|
||||
*/
|
||||
public function test_get_data_access_information_groups() {
|
||||
global $DB;
|
||||
|
||||
$DB->set_field('course', 'groupmode', VISIBLEGROUPS, ['id' => $this->course->id]);
|
||||
|
||||
// Check I can see my group.
|
||||
$this->setUser($this->student1);
|
||||
|
||||
$result = mod_data_external::get_data_access_information($this->database->id);
|
||||
$result = external_api::clean_returnvalue(mod_data_external::get_data_access_information_returns(), $result);
|
||||
|
||||
$this->assertEquals($this->group1->id, $result['groupid']); // My group is correctly found.
|
||||
$this->assertFalse($result['canmanageentries']);
|
||||
$this->assertFalse($result['canapprove']);
|
||||
$this->assertTrue($result['canaddentry']); // I can entries in my groups.
|
||||
$this->assertTrue($result['timeavailable']);
|
||||
$this->assertFalse($result['inreadonlyperiod']);
|
||||
$this->assertEquals(0, $result['numentries']);
|
||||
$this->assertEquals(0, $result['entrieslefttoadd']);
|
||||
$this->assertEquals(0, $result['entrieslefttoview']);
|
||||
|
||||
// Check the other course group in visible groups mode.
|
||||
$result = mod_data_external::get_data_access_information($this->database->id, $this->group2->id);
|
||||
$result = external_api::clean_returnvalue(mod_data_external::get_data_access_information_returns(), $result);
|
||||
|
||||
$this->assertEquals($this->group2->id, $result['groupid']); // The group is correctly found.
|
||||
$this->assertFalse($result['canmanageentries']);
|
||||
$this->assertFalse($result['canapprove']);
|
||||
$this->assertFalse($result['canaddentry']); // I cannot add entries in other groups.
|
||||
$this->assertTrue($result['timeavailable']);
|
||||
$this->assertFalse($result['inreadonlyperiod']);
|
||||
$this->assertEquals(0, $result['numentries']);
|
||||
$this->assertEquals(0, $result['entrieslefttoadd']);
|
||||
$this->assertEquals(0, $result['entrieslefttoview']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to populate the database with some entries.
|
||||
*
|
||||
@@ -1095,6 +1134,16 @@ class mod_data_external_testcase extends externallib_advanced_testcase {
|
||||
mod_data_external::add_entry($this->database->id, 0, []);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test add_entry invalid group.
|
||||
*/
|
||||
public function test_add_entry_invalid_group() {
|
||||
$this->setUser($this->student1);
|
||||
$this->expectExceptionMessage(get_string('noaccess', 'data'));
|
||||
$this->expectException('moodle_exception');
|
||||
mod_data_external::add_entry($this->database->id, $this->group2->id, []);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test update_entry.
|
||||
*/
|
||||
|
||||
+1
-1
@@ -24,6 +24,6 @@
|
||||
"xpath": "0.0.23"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0 <15"
|
||||
"node": ">=14.15.0 <15"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,7 +91,6 @@ if ($formaction == 'bulkchange.php') {
|
||||
$columnnames = array(
|
||||
'firstname' => get_string('firstname'),
|
||||
'lastname' => get_string('lastname'),
|
||||
'email' => get_string('email'),
|
||||
);
|
||||
|
||||
$identityfields = get_extra_user_fields($context);
|
||||
@@ -106,7 +105,7 @@ if ($formaction == 'bulkchange.php') {
|
||||
list($insql, $inparams) = $DB->get_in_or_equal($userids);
|
||||
}
|
||||
|
||||
$sql = "SELECT u.firstname, u.lastname, u.email" . $identityfieldsselect . "
|
||||
$sql = "SELECT u.firstname, u.lastname" . $identityfieldsselect . "
|
||||
FROM {user} u
|
||||
WHERE u.id $insql";
|
||||
|
||||
|
||||
+2
-2
@@ -29,11 +29,11 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$version = 2019052008.00; // 20190520 = branching date YYYYMMDD - do not modify!
|
||||
$version = 2019052009.00; // 20190520 = branching date YYYYMMDD - do not modify!
|
||||
// RR = release increments - 00 in DEV branches.
|
||||
// .XX = incremental changes.
|
||||
|
||||
$release = '3.7.8 (Build: 20200914)'; // Human-friendly version name
|
||||
$release = '3.7.9 (Build: 20201109)'; // Human-friendly version name
|
||||
|
||||
$branch = '37'; // This version's branch.
|
||||
$maturity = MATURITY_STABLE; // This version's maturity level.
|
||||
|
||||
Reference in New Issue
Block a user