courses.php 672 B

1234567891011121314151617181920
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. require_once '../main/inc/global.inc.php';
  4. /**
  5. * Redirects "courses/ABC/document/my_file.html" to
  6. * "public/courses/ABCa0d/document/my_file.html"
  7. * That route uses the Symfony ResourceController see:
  8. * /src/CoreBundle/Controller/ResourceController.php.
  9. */
  10. $publicPath = api_get_path(WEB_PUBLIC_PATH);
  11. // http://localhost/chamilo2/courses/ABC/document/aa.html
  12. $courseCode = Security::remove_XSS($_GET['courseCode']);
  13. $path = Security::remove_XSS($_GET['url']);
  14. $type = Security::remove_XSS($_GET['type'] ?? 'show');
  15. $url = $publicPath."courses/$courseCode/document/$path?type=$type";
  16. header("Location: $url");
  17. exit;