Location: PHPKode > projects > SnortCenter 2.x > snortcenter-release/dl.php
<?php
    /*
    ** SnortCenter Copyright (C) 2001,2002,2003 Stefan Dens
    **
    ** Author: Stefan Dens <hide@address.com>
    **
    ** This program is free software; you can redistribute it and/or modify
    ** it under the terms of the GNU General Public License as published by
    ** the Free Software Foundation; either version 2 of the License, or
    ** (at your option) any later version.
    **
    ** This program is distributed in the hope that it will be useful,
        ** but WITHOUT ANY WARRANTY; without even the implied warranty of
    ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    ** GNU General Public License for more details.
    **
    ** You should have received a copy of the GNU General Public License
    ** along with this program; if not, write to the Free Software
    ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    */
?>
<?php
    include("config.php");
    include("login.inc.php");
    include("sensor.inc.php");
    $db = NewACIDDBConnection($DBlib_path, $DBtype);
    $db->acidConnect($DB_dbname, $DB_host, $DB_port, $DB_user, $DB_password);
    $sensor_name = create_config("download", $sensor_id, $db);
     
    if ($sensor_name) {
         
        global $HTTP_USER_AGENT;
        global $senstmpfnam;
        $name = $sensor_name. '.snort.conf';
        $size = filesize($senstmpfnam);
         
        header("Content-Type: text/html");
        header("Content-Type: application/force-download");
        header("Content-Lenght: ".$size);
         
        if (preg_match("/MSIE 5.5/", $HTTP_USER_AGENT)) {
            #    header("Content-Disposition: filename=".$name);
            header("Content-Disposition: inline; filename=".$name);
        } else {
            #    header("Content-Disposition: attachment; filename=".$name);
            header("Content-Disposition: inline; filename=".$name);
        }
        readfile($senstmpfnam);
        unlink($senstmpfnam);
    }
?>
Return current item: SnortCenter 2.x