<?php
//=======================================================//
// Session Check
//=======================================================//
require_once ("../session/session_manage.php");
if ( sm_session_check_on_popup() == FALSE )
{
	require_once ("../multilang/multilang_api.php");
	// language information by url start
		$t_lang_from_url = explode('/', trim($_SERVER['REQUEST_URI']), 3);

		lang_set_active_language($t_lang_from_url[1]);
  	// language information by url end
	
	echo "<script>alert('".lang_get('login_msg_6')."');</script>";
	echo "<meta http-equiv='refresh' content='0; url=../login/login.php'>";
	die();	
}
session_write_close();

$fw_file_name = $_POST['confFile'];
$filename = str_replace(',', '_', $fw_file_name);
$file = '/boot/config/'.$fw_file_name;

header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment;; filename=$filename");
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".(string)(filesize($file)));
header("Cache-Control: cache, must-revalidate");
header("Pragma: no-cache");
header("Expires:0");

$fp=fopen($file,"rb");
if(!fpassthru($fp)){
	fclose($fp);
}

?>
