get_id(); $lp_item_id = $_SESSION['oLP']->current; $lp_item_info = new learnpathItem($lp_item_id); if (!empty($lp_item_info)) { //if (basename($lp_item_info->path) == basename($doc_url)) { $visible = learnpath::is_lp_visible_for_student($lp_id, $user_id); if ($visible) { event_download($doc_url); if (Security::check_abs_path($sys_course_path.$doc_url, $sys_course_path.'/')) { $full_file_name = $sys_course_path.$doc_url; DocumentManager::file_send_for_download($full_file_name); exit; } } //} } } Display::display_error_message(get_lang('ProtectedDocument'));//api_not_allowed backbutton won't work. exit;