aboutsummaryrefslogtreecommitdiffstats
path: root/packages/tftp
diff options
context:
space:
mode:
authorMark Crane <mcrane@pfsense.org>2008-12-26 20:00:08 +0000
committerMark Crane <mcrane@pfsense.org>2008-12-26 20:00:08 +0000
commit68e96fbf345846169ffeed749641ad0f4a2ab5eb (patch)
tree68956af6451d8fe8a35ec6befa1123812c405ea4 /packages/tftp
parent3c773829dac7f4a71f9667b5901d530e8dfeaced (diff)
downloadpfsense-packages-68e96fbf345846169ffeed749641ad0f4a2ab5eb.tar.gz
pfsense-packages-68e96fbf345846169ffeed749641ad0f4a2ab5eb.tar.bz2
pfsense-packages-68e96fbf345846169ffeed749641ad0f4a2ab5eb.zip
TFTP package add file upload to the tftpboot directory.
Diffstat (limited to 'packages/tftp')
-rw-r--r--packages/tftp/tftp.inc6
-rw-r--r--packages/tftp/tftp.xml2
-rw-r--r--packages/tftp/tftp_files.tmp37
3 files changed, 37 insertions, 8 deletions
diff --git a/packages/tftp/tftp.inc b/packages/tftp/tftp.inc
index e487247d..deed9c48 100644
--- a/packages/tftp/tftp.inc
+++ b/packages/tftp/tftp.inc
@@ -118,7 +118,7 @@ function php_install_command()
fclose($handle);
$handle = fopen($filename,"w");
- $contents = str_replace("#tftp dgram udp wait root /usr/libexec/tftpd", "tftp dgram udp wait root /usr/libexec/tftpd", $contents);
+ $contents = str_replace("\#tftp dgram udp wait root /usr/libexec/tftpd", "tftp dgram udp wait root /usr/libexec/tftpd", $contents);
fwrite($handle, $contents);
unset($contents);
fclose($handle);
@@ -140,7 +140,7 @@ function php_install_command()
write_rcfile(array(
"file" => "tftp.sh",
- "start" => "/usr/sbin/inetd",
+ "start" => "/usr/sbin/./inetd",
"stop" => "killall -9 /usr/sbin/inetd"
)
);
@@ -170,7 +170,7 @@ function php_deinstall_command()
fclose($handle);
$handle = fopen($filename,"w");
- $contents = str_replace("tftp dgram udp wait root /usr/libexec/tftpd", "#tftp dgram udp wait root /usr/libexec/tftpd", $contents);
+ $contents = str_replace("tftp dgram udp wait root /usr/libexec/tftpd", "\#tftp dgram udp wait root /usr/libexec/tftpd", $contents);
fwrite($handle, $contents);
unset($contents);
fclose($fout);
diff --git a/packages/tftp/tftp.xml b/packages/tftp/tftp.xml
index 9e3fee45..812789e6 100644
--- a/packages/tftp/tftp.xml
+++ b/packages/tftp/tftp.xml
@@ -41,7 +41,7 @@
<requirements>Describe your package requirements here</requirements>
<faq>Currently there are no FAQ items provided.</faq>
<name>tftp Settings</name>
- <version>0.6</version>
+ <version>0.7</version>
<title>TFTP: Settings</title>
<include_file>/usr/local/pkg/tftp.inc</include_file>
<menu>
diff --git a/packages/tftp/tftp_files.tmp b/packages/tftp/tftp_files.tmp
index cd74bd62..d79d39a2 100644
--- a/packages/tftp/tftp_files.tmp
+++ b/packages/tftp/tftp_files.tmp
@@ -48,6 +48,12 @@ if (($_GET['a'] == "download") && file_exists("/tftpboot/".$_GET['filename'])) {
exit;
}
+if (($_POST['submit'] == "Upload") && is_uploaded_file($_FILES['ulfile']['tmp_name'])) {
+ move_uploaded_file($_FILES['ulfile']['tmp_name'], "/tftpboot/" . $_FILES['ulfile']['name']);
+ $ulmsg = "Uploaded file to /tftpboot/" . htmlentities($_FILES['ulfile']['name']);
+ unset($_POST['txtCommand']);
+}
+
if ($_GET['act'] == "del") {
if ($_GET['type'] == 'ivr') {
@@ -87,8 +93,6 @@ include("head.inc");
<tr>
<td class="tabcont" >
-<form action="tftp_files.php" method="post" name="iform" id="iform">
-
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td><p><span class="vexpl"><span class="red"><strong>TFTP files<br />
@@ -99,6 +103,32 @@ include("head.inc");
</tr>
</table>
<br />
+
+
+ <div id="niftyOutter">
+ <form action="tftp_files.php" method="POST" enctype="multipart/form-data" name="frmUpload" onSubmit="">
+ <table>
+
+ <tr>
+ <td colspan="2" valign="top" class="vnsepcell">Upload</td>
+ </tr>
+ <tr>
+ <td align="right">File to upload:</td>
+ <td valign="top" class="label">
+ <input name="ulfile" type="file" class="button" id="ulfile">
+ </td></tr>
+ <tr>
+ <td valign="top">&nbsp;&nbsp;&nbsp;</td>
+ <td valign="top" class="label">
+ <input name="submit" type="submit" class="button" id="upload" value="Upload"></td>
+ </tr>
+
+ </table>
+ </div>
+ </form>
+
+
+ <form action="tftp_files.php" method="post" name="iform" id="iform">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
@@ -145,7 +175,7 @@ include("head.inc");
?>
<tr>
- <td class="list" colspan="3"></td>
+ <td class="list" colspan="2"></td>
<td class="list">
<table border="0" cellspacing="0" cellpadding="1">
<tr>
@@ -179,7 +209,6 @@ include("head.inc");
</div>
-
<?php include("fend.inc"); ?>
</body>
</html>