link_goto.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php // $Id: link_goto.php 22201 2009-07-17 19:57:03Z cfasanando $
  2. /*
  3. ==============================================================================
  4. Dokeos - elearning and course management software
  5. Copyright (c) 2004-2005 Dokeos S.A.
  6. Copyright (c) 2003 Ghent University (UGent)
  7. Copyright (c) 2001 Universite catholique de Louvain (UCL)
  8. For a full list of contributors, see "credits.txt".
  9. The full license can be read in "license.txt".
  10. This program is free software; you can redistribute it and/or
  11. modify it under the terms of the GNU General Public License
  12. as published by the Free Software Foundation; either version 2
  13. of the License, or (at your option) any later version.
  14. See the GNU General Public License for more details.
  15. Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
  16. ==============================================================================
  17. */
  18. /**
  19. ==============================================================================
  20. * This page is used to launch an event when a user clicks
  21. * on a page linked in a course.
  22. * - It gets name of URL
  23. * - It calls the event function
  24. * - It redirects the user to the linked page
  25. * |
  26. * Need the liens.id, user.user_id et cours.code when called
  27. * ?link_id=$myrow[0]&link_url=$myrow[1] |
  28. * url is given to avoid a new select
  29. *
  30. * @author Thomas Depraetere, Hugues Peeters, Christophe Gesch� - original versions
  31. * @package dokeos.link
  32. ==============================================================================
  33. */
  34. /*
  35. ==============================================================================
  36. INIT SECTION
  37. ==============================================================================
  38. */
  39. include('../inc/global.inc.php');
  40. $this_section=SECTION_COURSES;
  41. $link_url = Security::remove_XSS($_GET['link_url']);
  42. $link_id = Security::remove_XSS($_GET['link_id']);
  43. // launch event
  44. event_link($link_id);
  45. header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
  46. header("Cache-Control: post-check=0, pre-check=0", false);
  47. header("Pragma: no-cache"); // HTTP/1.0
  48. header("Location: $link_url");
  49. //to be sure that the script stops running after the redirection
  50. exit;
  51. ?>