You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							34 lines
						
					
					
						
							859 B
						
					
					
				
			
		
		
	
	
							34 lines
						
					
					
						
							859 B
						
					
					
				<?php
 | 
						|
/* For licensing terms, see /license.txt */
 | 
						|
 | 
						|
/**
 | 
						|
 * This file is responsible for  passing requested documents to the browser.
 | 
						|
 * Html files are parsed to fix a few problems with URLs,
 | 
						|
 * but this code will hopefully be replaced soon by an Apache URL
 | 
						|
 * rewrite mechanism.
 | 
						|
 *
 | 
						|
 * @package chamilo.work
 | 
						|
 */
 | 
						|
require_once __DIR__.'/../inc/global.inc.php';
 | 
						|
require_once 'work.lib.php';
 | 
						|
 | 
						|
$current_course_tool = TOOL_STUDENTPUBLICATION;
 | 
						|
$this_section = SECTION_COURSES;
 | 
						|
 | 
						|
// Course protection
 | 
						|
api_protect_course_script(true);
 | 
						|
 | 
						|
$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
 | 
						|
$courseInfo = api_get_course_info();
 | 
						|
 | 
						|
if (empty($courseInfo) || empty($id)) {
 | 
						|
    api_not_allowed(true);
 | 
						|
}
 | 
						|
 | 
						|
$correction = isset($_REQUEST['correction']) ? true : false;
 | 
						|
$result = downloadFile($id, $courseInfo, $correction);
 | 
						|
if ($result === false) {
 | 
						|
    api_not_allowed(true);
 | 
						|
}
 | 
						|
 | 
						|
exit;
 | 
						|
 |