Chamilo is a learning management system focused on ease of use and accessibility
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
chamilo-lms/main/course_home/redirect.php

23 lines
738 B

<?php
/* For licensing terms, see /license.txt */
/**
* Redirects a session name to a correct session id.
*/
$cidReset = true;
require_once __DIR__.'/../inc/global.inc.php';
$sessionName = isset($_GET['session_name']) ? $_GET['session_name'] : '';
$courseCode = isset($_GET['cidReq']) ? $_GET['cidReq'] : '';
if (!empty($sessionName) && !empty($courseCode)) {
$sessionInfo = SessionManager::get_session_by_name($sessionName);
$courseInfo = api_get_course_info($courseCode);
if (!empty($sessionInfo) && !empty($courseInfo)) {
$url = api_get_path(WEB_COURSE_PATH).$courseInfo['directory'].'/index.php?id_session='.$sessionInfo['id'];
header('Location: '.$url);
exit;
}
}
api_not_allowed(true);