コード例 #1
0
ファイル: file.php プロジェクト: ilosada/chamilo-lms-icpna
 *      - several documents (file and/or folders) zipped together
 *
 * Used to transfer files to another application through http.
 *
 * Script parameters:
 *
 *      - id        id(s) of the document id=1 or id=1,2,4
 *      - cidReq    course code
 *
 * Note this script enables key authentication so access with a key token is possible.
 *
 * @package chamilo.document
 * @license see /license.txt
 * @author Laurent Opprecht <*****@*****.**> for the Univesity of Geneva
 */
KeyAuth::enable();
require_once __DIR__ . '/../inc/global.inc.php';
$has_access = api_protect_course_script();
if (!$has_access) {
    exit;
}
session_cache_limiter('none');
$ids = Request::get('id', '');
$ids = $ids ? explode(',', $ids) : array();
$course = Course::current();
/**
 * No files requested. We make sure we return 404 error to tell the client
 * that the call failed.
 */
if (count($ids) == 0 || empty($course)) {
    Response::not_found();