link_goto.php 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php // $Id: link_goto.php 9246 2006-09-25 13:24:53Z bmol $
  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. include(api_get_path(LIBRARY_PATH)."events.lib.inc.php");
  42. $link_url = $_GET['link_url'];
  43. $link_id = $_GET['link_id'];
  44. // launch event
  45. event_link($link_id);
  46. header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
  47. header("Cache-Control: post-check=0, pre-check=0", false);
  48. header("Pragma: no-cache"); // HTTP/1.0
  49. header("Location: $link_url");
  50. //to be sure that the script stops running after the redirection
  51. exit;
  52. ?>