1<?php
2/**
3 * @package tikiwiki
4 */
5// (c) Copyright by authors of the Tiki Wiki CMS Groupware Project
6//
7// All Rights Reserved. See copyright.txt for details and a complete list of authors.
8// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
9// $Id$
10
11require_once('tiki-setup.php');
12include_once('lib/minical/minicallib.php');
13
14$access->check_feature('feature_minical', '');
15$access->check_permission('tiki_p_minical');
16
17if (! $user) {
18	die;
19}
20if (! isset($_REQUEST["topicId"])) {
21	die;
22}
23$info = $minicallib->minical_get_topic($user, $_REQUEST["topicId"]);
24$type = & $info["filetype"];
25$file = & $info["filename"];
26$content = & $info["data"];
27header("Content-type: $type");
28header("Content-Disposition: inline; filename=$file");
29echo "$content";
30