1<?php
2
3// Pandora FMS - http://pandorafms.com
4// ==================================================
5// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
6// Please see http://pandorafms.org for full contribution list
7
8// This program is free software; you can redistribute it and/or
9// modify it under the terms of the GNU General Public License
10// as published by the Free Software Foundation for version 2.
11// This program is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14// GNU General Public License for more details.
15
16require_once ("../../include/functions_incidents.php");
17require_once ("../../include/config.php");
18
19$id_file = $_GET["id_file"];
20$filename = $_GET["filename"];
21$id_user = $_GET["id_user"];
22
23$integria_api = $config['integria_url']."/include/api.php?return_type=csv&user=".$config['id_user']."&pass=".io_output_password($config['integria_api_password']);
24
25$url = $integria_api."&op=download_file&params=".$id_file;
26
27// Call the integria API
28$file = incidents_call_api($url);
29
30header("Content-type: binary");
31header("Content-Disposition: attachment; filename=\"".$filename."\"");
32header("Pragma: no-cache");
33header("Expires: 0");
34
35echo base64_decode($file);
36?>
37