Code

Updated .php files.
[gosa.git] / gosa-core / html / getbin.php
1 <?php
2 /*
3    This code is part of GOsa (https://gosa.gonicus.de)
4    Copyright (C) 2003  Cajus Pollmeier
6    This program is free software; you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation; either version 2 of the License, or
9    (at your option) any later version.
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.
16    You should have received a copy of the GNU General Public License
17    along with this program; if not, write to the Free Software
18    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
21 /* Basic setup, remove eventually registered sessions */
22 @require_once ("../include/php_setup.inc");
23 @require_once ("functions.inc");
24 error_reporting (0);
25 session::start();
26 session::set('errorsAlreadyPosted',array());
28 /* Logged in? Simple security check */
29 if (!session::is_set('ui')){
30   new log("security","unknown","",array(),"Error: getbin.php called without session") ;
31   header ("Location: index.php");
32   exit;
33 }
35 header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
36 header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
37 header("Cache-Control: no-cache");
38 header("Pragma: no-cache");
39 header("Cache-Control: post-check=0, pre-check=0");
40 $bintype = session::is_set('binarytype')
41   ? session::get('binarytype') : "octet-stream";
42 header("Content-type: " . $bintype);
43 if (session::is_set('binaryfile')) {
44   header( "Content-disposition: attachment; filename=" 
45     . session::get('binaryfile'));
46 }
48 echo session::get('binary');
49 error_reporting (E_ALL | E_STRICT);
51 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
52 ?>