From 7899b28a3c2528ab756ef5790492778c2856b035 Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Fri, 26 Dec 2008 20:59:24 +0000 Subject: TFTP package fix download and file delete. --- packages/tftp/tftp.xml | 2 +- packages/tftp/tftp_files.tmp | 18 +++++++----------- 2 files changed, 8 insertions(+), 12 deletions(-) (limited to 'packages/tftp') diff --git a/packages/tftp/tftp.xml b/packages/tftp/tftp.xml index 8ede05ce..4563cc1c 100644 --- a/packages/tftp/tftp.xml +++ b/packages/tftp/tftp.xml @@ -41,7 +41,7 @@ Describe your package requirements here Currently there are no FAQ items provided. tftp Settings - 0.7.1 + 0.7.2 TFTP: Settings /usr/local/pkg/tftp.inc diff --git a/packages/tftp/tftp_files.tmp b/packages/tftp/tftp_files.tmp index 78f59442..b93e9609 100644 --- a/packages/tftp/tftp_files.tmp +++ b/packages/tftp/tftp_files.tmp @@ -43,7 +43,7 @@ if (($_GET['a'] == "download") && file_exists("/tftpboot/".$_GET['filename'])) { header('Content-Disposition: attachment; filename="'.$_GET['filename'].'"'); header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past - header("Content-Length: " . filesize($recording_dir.$_GET['filename'])); + header("Content-Length: " . filesize("/tftpboot/".$_GET['filename'])); fpassthru($fd); exit; } @@ -56,14 +56,10 @@ if (($_POST['submit'] == "Upload") && is_uploaded_file($_FILES['ulfile']['tmp_na if ($_GET['act'] == "del") { - if ($_GET['type'] == 'ivr') { - if ($a_ivr[$_GET['id']]) { - //unset($a_ivr[$_GET['id']]); - //write_config(); - sync_package_freeswitch_ivr(); - header("Location: tftp_files.php"); - exit; - } + if ($_GET['type'] == 'tftp') { + unlink_if_exists("/tftpboot/".$_GET['filename']); + header("Location: tftp_files.php"); + exit; } } @@ -157,8 +153,8 @@ include("head.inc"); echo " \n"; echo " \n"; echo " \n"; - echo " \n"; - echo " \n"; + //echo " \n"; + echo " \n"; echo " \n"; echo "
\n"; echo " \n"; -- cgit v1.2.3