From 423e9b64664aeb18cb6c045c5913ea9fc4ecd982 Mon Sep 17 00:00:00 2001 From: jmontoyaa Date: Fri, 26 Jan 2018 13:29:22 +0100 Subject: [PATCH] Add settin allow_teachers_to_access_blocked_lp_by_prerequisite BT#13923 Allow teachers, drhs and admins to access blocked LP's because a prerequisite. --- main/install/configuration.dist.php | 10 +++++++--- main/lp/learnpath.class.php | 7 +++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/main/install/configuration.dist.php b/main/install/configuration.dist.php index a6c2444bc6..e36660b647 100755 --- a/main/install/configuration.dist.php +++ b/main/install/configuration.dist.php @@ -725,12 +725,16 @@ $_configuration['gradebook_badge_sidebar'] = [ // Show skills as a hierarchical table //$_configuration['table_of_hierarchical_skill_presentation'] = false; +// Restrict course chat only for course coach in sessions +// Course coaches will can chat with students only. And students will can chat with all course coaches +//$_configuration['course_chat_restrict_to_coach'] = false; + +// Allow teachers, drhs and admins to access blocked LP's because a prerequisite. +//$_configuration['allow_teachers_to_access_blocked_lp_by_prerequisite'] = false; + // ------ Custom DB changes // Add user activation by confirmation email // This option prevents the new user to login in the platform if your account is not confirmed via email // You need add a new option called "confirmation" to the registration settings //INSERT INTO settings_options (variable, value, display_text) VALUES ('allow_registration', 'confirmation', 'MailConfirmation'); // ------ (End) Custom DB changes -// Restrict course chat only for course coach in sessions -// Course coaches will can chat with students only. And students will can chat with all course coaches -//$_configuration['course_chat_restrict_to_coach'] = false; diff --git a/main/lp/learnpath.class.php b/main/lp/learnpath.class.php index fcf5c42a29..2dc32ee2f3 100755 --- a/main/lp/learnpath.class.php +++ b/main/lp/learnpath.class.php @@ -2311,6 +2311,13 @@ class learnpath $courseInfo, $sessionId ) { + $allow = api_get_configuration_value('allow_teachers_to_access_blocked_lp_by_prerequisite'); + if ($allow) { + if (api_is_allowed_to_edit() || api_is_platform_admin() || api_is_drh()) { + return false; + } + } + $isBlocked = false; if (!empty($prerequisite)) {