Add config "block_editor_file_manager_for_students" BT#15437

Block student's access to the course documents
when using the ckeditor "Browse server" button
pull/2864/head
Julio 7 years ago
parent dcc6bcc6c8
commit 4cb8f2e1b4
  1. 11
      main/inc/lib/elfinder/connectorAction.php
  2. 3
      main/install/configuration.dist.php
  3. 5
      src/Chamilo/CoreBundle/Component/Editor/Driver/CourseDriver.php

@ -20,6 +20,17 @@ if (empty($driverList)) {
//'CourseUserDriver',
//'HomeDriver'
];
$block = api_get_configuration_value('block_editor_file_manager_for_students');
$newDriverList = [];
if ($block && !api_is_allowed_to_edit()) {
foreach ($driverList as $driver) {
if ($driver === 'CourseDriver') {
continue;
}
$newDriverList[] = $driver;
}
$driverList = $newDriverList;
}
}
$connector->setDriverList($driverList);

@ -1156,6 +1156,9 @@ VALUES (2, 13, 'session_courses_read_only_mode', 'Lock Course In Session', 1, 1,
// - launch composer install to rebuild the autoload.php
//$_configuration['social_enable_likes_messages'] = false;
// Block student's access to the course documents when using the ckeditor "Browse server" button
//$_configuration['block_editor_file_manager_for_students'] = false;
// KEEP THIS AT THE END
// -------- Custom DB changes
// Add user activation by confirmation email

@ -340,6 +340,11 @@ class CourseDriver extends Driver implements DriverInterface
return false;
}
$block = api_get_configuration_value('block_editor_file_manager_for_students');
if ($block && !api_is_allowed_to_edit()) {
return false;
}
if (isset($this->connector->course) && !empty($this->connector->course)) {
return true;
}

Loading…
Cancel
Save