link_goto.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * This page is used to launch an event when a user clicks
  5. * on a page linked in a course.
  6. * - It gets name of URL
  7. * - It calls the event function
  8. * - It redirects the user to the linked page
  9. *
  10. * Need the liens.id, user.user_id et cours.code when called
  11. * ?link_id=$myrow[0]&link_url=$myrow[1]
  12. * url is given to avoid a new select
  13. *
  14. * @author Thomas Depraetere, Hugues Peeters, Christophe Gesch� - original versions
  15. * @package chamilo.link
  16. */
  17. /* INIT SECTION */
  18. require_once '../inc/global.inc.php';
  19. $this_section = SECTION_COURSES;
  20. require_once api_get_path(LIBRARY_PATH).'link.lib.php';
  21. $this_section = SECTION_COURSES;
  22. $linkId = intval($_GET['link_id']);
  23. $linkInfo = Link::get_link_info($linkId);
  24. $linkUrl = html_entity_decode(Security::remove_XSS($linkInfo['url']));
  25. // Launch event
  26. event_link($linkId);
  27. header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
  28. header("Cache-Control: post-check=0, pre-check=0", false);
  29. header("Pragma: no-cache"); // HTTP/1.0
  30. header("Location: $linkUrl");
  31. exit;