26 lines
631 B
PHP
26 lines
631 B
PHP
<?php
|
|
|
|
session_start();
|
|
|
|
if ( ($_SESSION['auth'] != true) || (($_SESSION['authId'] != 1) && ($_SESSION['authId'] != 3)) )
|
|
{
|
|
$_SESSION['auth'] = false;
|
|
header("Location: ../login.php");
|
|
}
|
|
|
|
$filename = $_GET['file'];
|
|
$download = $_GET['download'];
|
|
|
|
if($download == 0)
|
|
{
|
|
header("Content-Type: application/pdf");
|
|
readfile("../pdf_listen/$filename");
|
|
}
|
|
else
|
|
{
|
|
header("Content-Disposition: attachment; filename=" . Urlencode($filename));
|
|
header("Content-Type: application/octet-stream");
|
|
readfile("../pdf_listen/$filename");
|
|
}
|
|
|
|
?>
|