show_file.php 737 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * This file is responsible for passing requested documents to the browser.
  5. * Html files are parsed to fix a few problems with URLs,
  6. * but this code will hopefully be replaced soon by an Apache URL
  7. * rewrite mechanism.
  8. *
  9. * @package chamilo.work
  10. */
  11. //require_once '../inc/global.inc.php';
  12. require_once 'work.lib.php';
  13. $current_course_tool = TOOL_STUDENTPUBLICATION;
  14. $this_section = SECTION_COURSES;
  15. // Course protection
  16. api_protect_course_script(true);
  17. $id = intval($_GET['id']);
  18. $course_info = api_get_course_info();
  19. if (empty($course_info)) {
  20. api_not_allowed(true);
  21. }
  22. $result = getFile($id, $course_info, false);
  23. if ($result == false) {
  24. api_not_allowed();
  25. }