public function go() { $id = Request::get_id(); $c_id = Request::get_c_id(); $repo = LinkRepository::instance(); $link = $repo->find_one_by_id($c_id, $id); $url = $link->url; event_link($id); Header::cache_control('no-store, no-cache, must-revalidate'); Header::pragma('no-cache'); Redirect::go($url); }
* @author Thomas Depraetere, Hugues Peeters, Christophe Gesch� - original versions * @package chamilo.link */ /* INIT SECTION */ require_once '../inc/global.inc.php'; require_once api_get_path(LIBRARY_PATH) . 'link.lib.php'; $this_section = SECTION_COURSES; $linkId = intval($_GET['link_id']); $linkInfo = get_link_info($linkId); if ($linkInfo['target'] == '_in_header') { $tpl = $app['template']; $url = $linkInfo['url']; $interbreadcrumb[] = array('url' => 'link.php', 'name' => get_lang('Links')); $frame = '<iframe name="page" onload="javascript:resizeIframe(this);" style="width:100%;height:500px" frameBorder=0px; src="' . $url . '"> </iframe>'; $js = "<script>\n function resizeIframe(obj) {\n /*var body = obj.contentWindow.document.body;\n var height =\$(obj, top.document).height();\n console.log(height);\n console.log(jQuery('iframe',top.document).height());\n obj.style.height = height;*/\n }\n </script>"; $tpl->assign('content', $js . $frame); $tpl->display_one_col_template(); } else { $link_url = html_entity_decode(Security::remove_XSS($_GET['link_url'])); // Launch event event_link($linkId); header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1 header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); // HTTP/1.0 header("Location: {$link_url}"); // To be sure that the script stops running after the redirection exit; }
* - It gets name of URL * - It calls the event function * - It redirects the user to the linked page * * Need the liens.id, user.user_id et cours.code when called * ?link_id=$myrow[0]&link_url=$myrow[1] * url is given to avoid a new select * * @author Thomas Depraetere, Hugues Peeters, Christophe Gesch� - original versions * @package chamilo.link */ /* INIT SECTION */ require_once '../inc/global.inc.php'; $this_section = SECTION_COURSES; $link_url = html_entity_decode(Security::remove_XSS($_GET['link_url'])); $link_id = intval($_GET['link_id']); // Launch event event_link($link_id); header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1 header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); // HTTP/1.0 header("Location: $link_url"); // To be sure that the script stops running after the redirection exit;