aboutsummaryrefslogtreecommitdiffstats
path: root/config/tftp
diff options
context:
space:
mode:
Diffstat (limited to 'config/tftp')
-rw-r--r--config/tftp/tftp.inc296
-rw-r--r--config/tftp/tftp.xml91
-rw-r--r--config/tftp/tftp_files.tmp257
3 files changed, 0 insertions, 644 deletions
diff --git a/config/tftp/tftp.inc b/config/tftp/tftp.inc
deleted file mode 100644
index e19d68bb..00000000
--- a/config/tftp/tftp.inc
+++ /dev/null
@@ -1,296 +0,0 @@
-<?php
-/* $Id$ */
-/*
-/* ========================================================================== */
-/*
- tftp_inc.php
- Copyright (C) 2008 Mark J Crane
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-
-function tftp_guid()
-{
- if (function_exists('com_create_guid')){
- return com_create_guid();
- }else{
- mt_srand((double)microtime()*10000);//optional for php 4.2.0 and up.
- $charid = strtoupper(md5(uniqid(rand(), true)));
- $hyphen = chr(45);// "-"
- $uuid = chr(123)// "{"
- .substr($charid, 0, 8).$hyphen
- .substr($charid, 8, 4).$hyphen
- .substr($charid,12, 4).$hyphen
- .substr($charid,16, 4).$hyphen
- .substr($charid,20,12)
- .chr(125);// "}"
- return $uuid;
- }
-}
-//echo guid();
-
-
-function tftp_pkg_is_service_running($servicename)
-{
- exec("/bin/ps ax | awk '{ print $5 }'", $psout);
- array_shift($psout);
- foreach($psout as $line) {
- $ps[] = trim(array_pop(explode(' ', array_pop(explode('/', $line)))));
- }
- if(is_service_running($servicename, $ps) or is_process_running($servicename) ) {
- return true;
- }
- else {
- return false;
- }
-}
-
-function tftp_byte_convert( $bytes ) {
-
- if ($bytes<=0)
- return '0 Byte';
-
- $convention=1000; //[1000->10^x|1024->2^x]
- $s=array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB');
- $e=floor(log($bytes,$convention));
- return round($bytes/pow($convention,$e),2).' '.$s[$e];
-}
-
-
-function tftp_sync_package()
-{
-
- //global $config;
- //sync_package_tftp_files();
-
- //if (pkg_is_service_running('inetd')) {
- // sync_package_tftp();
- //}
-
-}
-
-
-function tftp_install_command()
-{
-
- global $config;
- conf_mount_rw();
- config_lock();
-
- if (!is_dir('/tftpboot')) {
- // Create the directory
- exec("mkdir /tftpboot");
-
- //Set the directory permissions
- exec("chmod -R 777 /tftpboot");
-
- }
-
- if (!is_dir('/usr/local/www/packages/')) {
- // Create the packages directory
- exec("mkdir /usr/local/www/packages/");
- }
-
- if (!is_dir('/usr/local/www/packages/tftp')) {
- // Create the tftp directory
- exec("mkdir /usr/local/www/packages/tftp");
- }
-
- if (!is_dir('/root/backup/')) {
- // Create the backup directory
- exec("mkdir /root/backup/");
- }
-
-
- //rename PHP files from .tmp to .php
- exec("cp /tmp/tftp_files.tmp /usr/local/www/packages/tftp/tftp_files.php");
- unlink_if_exists("/tmp/tftp_files.tmp");
-
- //prepare inetd.conf for tftp
- $filename = "/etc/inetd.conf";
- $handle = fopen($filename,"rb");
- $contents = fread($handle, filesize($filename));
- fclose($handle);
-
- $handle = fopen($filename,"w");
- $contents = str_replace("#tftp", "tftp", $contents);
- fwrite($handle, $contents);
- unset($contents);
- fclose($handle);
- unset($filename);
-
-
- // add a TFTP DHCP Option to the DHCP Server
- $filename = "/usr/local/www/services_dhcp.php";
- $fout = fopen($filename,"r");
- $tmp = fread($fout, filesize($filename));
- fclose($fout);
-
- //tftp was not found in the string
- if (strpos($tmp, "tftp") === false) {
- $tmpsearch = "\$pconfig['netmask'] = \$config['dhcpd'][\$if]['netmask'];";
- $tmpreplace = "\$pconfig['netmask'] = \$config['dhcpd'][\$if]['netmask'];\n";
- $tmpreplace .= "\$pconfig['tftp'] = \$config['dhcpd'][\$if]['options']['tftp-server-name'];";
- $tmp = str_replace($tmpsearch, $tmpreplace, $tmp);
- unset($tmpsearch, $tmpreplace);
-
- $tmpsearch = "\$config['dhcpd'][\$if]['filename'] = \$_POST['filename'];";
- $tmpreplace = "\$config['dhcpd'][\$if]['filename'] = \$_POST['filename'];\n";
- $tmpreplace .= " \$config['dhcpd'][\$if]['options']['tftp-server-name'] = \$_POST['tftp'];";
- $tmp = str_replace($tmpsearch, $tmpreplace, $tmp);
- unset($tmpsearch, $tmpreplace);
-
- $tmpsearch = "function show_netboot_config() {";
- $tmpreplace = "function show_tftp_config() {\n";
- $tmpreplace .= " document.getElementById(\"showtftpbox\").innerHTML='';\n";
- $tmpreplace .= " aodiv = document.getElementById('showtftp');\n";
- $tmpreplace .= " aodiv.style.display = \"block\";\n";
- $tmpreplace .= "}\n";
- $tmpreplace .= "\n";
- $tmpreplace .= "function show_netboot_config() {";
- $tmp = str_replace($tmpsearch, $tmpreplace, $tmp);
- unset($tmpsearch, $tmpreplace);
-
- $tmpsearch = "<td width=\"22%\" valign=\"top\" class=\"vncell\">Enable Network booting</td>";
- $tmpreplace .= "";
- //$tmpreplace = " <tr>\n";
- $tmpreplace .= "<td width=\"22%\" valign=\"top\" class=\"vncell\">TFTP server</td>\n";
- $tmpreplace .= " <td width=\"78%\" class=\"vtable\">\n";
- $tmpreplace .= " <div id=\"showtftpbox\">\n";
- $tmpreplace .= " <input type=\"button\" onClick=\"show_tftp_config()\" value=\"Advanced\"></input> - Show TFTP configuration</a>\n";
- $tmpreplace .= " </div>\n";
- $tmpreplace .= " <div id=\"showtftp\" style=\"display:none\">\n";
- $tmpreplace .= " <input name=\"tftp\" type=\"text\" class=\"formfld\" id=\"tftp\" size=\"20\" value=\"<"."?=htmlspecialchars(\$pconfig['tftp']);?".">\"><br>\n";
- $tmpreplace .= " </div>\n";
- $tmpreplace .= " </td>\n";
- $tmpreplace .= " </tr>\n";
- $tmpreplace .= "\n";
- $tmpreplace .= " <tr>\n";
- $tmpreplace .= " <td width=\"22%\" valign=\"top\" class=\"vncell\">Enable Network booting</td>";
- $tmpreplace .= "\n";
- $tmp = str_replace($tmpsearch, $tmpreplace, $tmp);
- unset($tmpsearch, $tmpreplace);
-
- $fout = fopen($filename,"w");
- fwrite($fout, $tmp);
- unset($tmp);
- fclose($fout);
- }
- unset($tmp, $filename);
-
-
-
- $filename = "/etc/inc/services.inc";
- $fout = fopen($filename,"r");
- $tmp = fread($fout, filesize($filename));
- fclose($fout);
-
- //tftp was not found in the string
- if (strpos($tmp, "tftp") === false) {
- $tmpsearch = "if (is_array(\$dhcpifconf['ntpserver']) && \$dhcpifconf['ntpserver'][0])";
- $tmpreplace = "if (isset(\$dhcpifconf['options']['tftp-server-name'])) {\n";
- $tmpreplace .= " \$dhcpdconf .= \" option tftp-server-name \\\"\".\$dhcpifconf['options']['tftp-server-name'].\"\\\";\".\"\\n\";\n";
- $tmpreplace .= " }\n";
- $tmpreplace .= " \n";
- $tmpreplace .= " if (is_array(\$dhcpifconf['ntpserver']) && \$dhcpifconf['ntpserver'][0])";
- $tmp = str_replace($tmpsearch, $tmpreplace, $tmp);
- unset($tmpsearch, $tmpreplace);
-
- $fout = fopen($filename,"w");
- fwrite($fout, $tmp);
- fclose($fout);
- }
- unset($tmp, $filename);
-
-
- // if backup file exists restore it
- $filename = 'tftp.bak.tgz';
-
- //extract a specific directory to /usr/local/freeswitch
- if (file_exists('/root/backup/'.$filename)) {
- system('cd /; tar xvpfz /root/backup/tftp.bak.tgz');
- system('chmod -R 744 /tftpboot/*');
- unset($filename);
- }
-
- write_rcfile(array(
- "file" => "tftp.sh",
- "start" => "/usr/sbin/inetd -l",
- "stop" => "killall -9 inetd"
- )
- );
-
-
- //tftp_sync_package();
- $handle = popen("/usr/sbin/inetd", "r");
- pclose($handle);
-
- //if (pkg_is_service_running('inetd')) {
- // temp_sync_package();
- //}
-
- //conf_mount_ro();
- //config_unlock();
-
-}
-
-
-function tftp_deinstall_command()
-{
-
- //prepare inetd.conf for tftp
- //tftp dgram udp wait root /usr/libexec/tftpd tftpd -l -s /tftpboot
-
- //pfsense 2.0 conflicting entry
- //tftp dgram udp wait root /usr/local/sbin/tftp-proxy -v
-
- $filename = "/etc/inetd.conf";
- $handle = fopen($filename,"rb");
- $contents = fread($handle, filesize($filename));
- fclose($handle);
-
- $handle = fopen($filename,"w");
- $contents = str_replace("tftp dgram", "#tftp dgram", $contents);
- $contents = str_replace("tftpd -l -s /tftpboot", "/usr/local/sbin/tftp-proxy -v", $contents);
- fwrite($handle, $contents);
- unset($contents);
- fclose($handle);
- unset($filename);
-
- exec("killall -9 inetd");
-
- unlink_if_exists("/usr/local/pkg/tftp.xml");
- unlink_if_exists("/usr/local/pkg/tftp.inc");
- unlink_if_exists("/usr/local/www/packages/tftp/tftp_files.php");
- exec("rm -R /usr/local/www/packages/tftp/");
-
- //exec("rm -R /tftpboot");
- unlink_if_exists("/usr/local/etc/rc.d/tftp.sh");
- unlink_if_exists("/tmp/pkg_mgr_tftp.log");
-
-}
-
-?>
diff --git a/config/tftp/tftp.xml b/config/tftp/tftp.xml
deleted file mode 100644
index 18cf2e5a..00000000
--- a/config/tftp/tftp.xml
+++ /dev/null
@@ -1,91 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- tftp.xml
- Copyright (C) 2008 Mark J Crane
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description></description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>tftp Settings</name>
- <version>1.0.7</version>
- <title>TFTP: Settings</title>
- <include_file>/usr/local/pkg/tftp.inc</include_file>
- <menu>
- <name>TFTP</name>
- <tooltiptext>Add or Remove files for TFTP.</tooltiptext>
- <section>Services</section>
- <configfile>tftp.xml</configfile>
- <url>/packages/tftp/tftp_files.php</url>
- </menu>
- <service>
- <name>tftp</name>
- <rcfile>tftp.sh</rcfile>
- <executable>inetd</executable>
- <description>TFTP daemon</description>
- </service>
- <tabs>
- <tab>
- <text>Files</text>
- <url>/packages/tftp/tftp_files.php</url>
- </tab>
- </tabs>
- <configpath>installedpackages->package->$packagename->configuration->tftp</configpath>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/tftp/tftp.inc</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/tftp/tftp_files.tmp</item>
- </additional_files_needed>
- <custom_add_php_command>
- </custom_add_php_command>
- <custom_php_resync_config_command>
- tftp_sync_package();
- </custom_php_resync_config_command>
- <custom_delete_php_command>
- tftp_sync_package();
- </custom_delete_php_command>
- <custom_php_install_command>
- tftp_install_command();
- </custom_php_install_command>
- <custom_php_deinstall_command>
- tftp_deinstall_command();
- </custom_php_deinstall_command>
-</packagegui> \ No newline at end of file
diff --git a/config/tftp/tftp_files.tmp b/config/tftp/tftp_files.tmp
deleted file mode 100644
index a55e92c6..00000000
--- a/config/tftp/tftp_files.tmp
+++ /dev/null
@@ -1,257 +0,0 @@
-<?php
-/* $Id$ */
-/*
- tftp_files.php
- Copyright (C) 2008 Mark J Crane
- All rights reserved.
-
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-require_once("guiconfig.inc");
-require_once("/usr/local/pkg/tftp.inc");
-
-$filename = $_GET['filename'];
-if (($_GET['a'] == "download") && $_GET['t'] == "backup") {
- conf_mount_rw();
- $tmp = '/root/backup/';
- $filename = 'tftp.bak.tgz';
- system('cd /;tar cvzf /root/backup/tftp.bak.tgz tftpboot');
- conf_mount_ro();
-}
-if (($_GET['a'] == "download") && file_exists("/root/backup/".$filename)) {
-
- session_cache_limiter('public');
- $fd = fopen("/root/backup/".$filename, "rb");
- header("Content-Type: application/force-download");
- header("Content-Type: application/octet-stream");
- header("Content-Type: application/download");
- header("Content-Description: File Transfer");
- header('Content-Disposition: attachment; filename="'.$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("/root/backup/".$filename));
- fpassthru($fd);
- exit;
-}
-
-
-if ($_GET['a'] == "other") {
- if ($_GET['t'] == "restore") {
- $tmp = '/root/backup/';
- $filename = 'tftp.bak.tgz';
-
- //extract a specific directory to /tftpboot
- if (file_exists('/root/backup/'.$filename)) {
- //echo "The file $filename exists";
- conf_mount_rw();
- system('cd /; tar xvpfz /root/backup/'.$filename);
- system('chmod -R 744 /tftpboot/*');
- header( 'Location: tftp_files.php?savemsg=Backup+has+been+restored.' ) ;
- conf_mount_ro();
- }
- else {
- header( 'Location: tftp_files.php?savemsg=Restore+failed.+Backup+file+not+found.' ) ;
- }
-
- exit;
- }
-}
-
-
-if (($_POST['submit'] == "Upload") && is_uploaded_file($_FILES['ulfile']['tmp_name'])) {
- conf_mount_rw();
- move_uploaded_file($_FILES['ulfile']['tmp_name'], "/tftpboot/" . $_FILES['ulfile']['name']);
- $savemsg = "Uploaded file to /tftpboot/" . htmlentities($_FILES['ulfile']['name']);
- system('chmod -R 744 /tftpboot/*');
- unset($_POST['txtCommand']);
- conf_mount_ro();
-}
-
-
-if ($_GET['act'] == "del") {
- if ($_GET['type'] == 'tftp') {
- conf_mount_rw();
- unlink_if_exists("/tftpboot/".$_GET['filename']);
- conf_mount_ro();
- header("Location: tftp_files.php");
- exit;
- }
-}
-
-include("head.inc");
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<p class="pgtitle">TFTP: Files</p>
-
-<?php
-$savemsg = $_GET["savemsg"];
-if ($savemsg) {
- print_info_box($savemsg);
-}
-?>
-
-<div id="mainlevel">
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
-<tr><td class="tabnavtbl">
-<?php
-
- $tab_array = array();
- $tab_array[] = array(gettext("Files"), false, "/packages/tftp/tftp_files.php");
- display_top_tabs($tab_array);
-
-?>
-</td></tr>
-</table>
-
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="tabcont" >
-
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td><p><span class="vexpl"><span class="red"><strong>TFTP files<br />
- </strong></span>
- Trivial File Transport Protocol is a very simple file transfer
- protocol. Use the file upload to add files to the /tftpboot directory.
- Click on the file from the file list below to download it.
- </span></p></td>
- </tr>
- </table>
- <br />
-
-
- <div id="niftyOutter">
- <form action="tftp_files.php" method="POST" enctype="multipart/form-data" name="frmUpload" onSubmit="">
- <table>
-
- <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>
-
- <br />
- <br />
-
- <?php
- echo "<table width='690' cellpadding='0' cellspacing='0' border='0'>\n";
- echo "<tr>\n";
- echo "<td width='80%'>\n";
- echo "<b>Backup / Restore</b><br />\n";
- echo "The 'backup' button will tar gzip /tftpboot/ to /root/backup/tftp.bak.tgz it then presents a file to download. \n";
- echo "If the backup file does not exist in /root/backup/tftp.bak.tgz then the 'restore' button will be hidden. \n";
- echo "Use Diagnostics->Command->File to upload: to browse to the file and then click on upload it now ready to be restored. \n";
- echo "<br /><br />\n";
- echo "</td>\n";
- echo "<td width='20%' valign='middle' align='right'>\n";
- echo " <input type='button' value='backup' onclick=\"document.location.href='/packages/tftp/tftp_files.php?a=download&t=backup';\" />\n";
- if (file_exists('/root/backup/tftp.bak.tgz')) {
- echo " <input type='button' value='restore' onclick=\"document.location.href='/packages/tftp/tftp_files.php?a=other&t=restore';\" />\n";
- }
- echo "</td>\n";
- echo "</tr>\n";
- echo "</table>\n";
- echo "<br /><br />\n\n";
- ?>
-
-
- <table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td width="25%" class="listhdrr">File Name (download)</td>
- <td width="50%" class="listhdr">Last Modified</td>
- <td width="50%" class="listhdr">Size</td>
- </tr>
-
- <?php
- if ($handle = opendir('/tftpboot')) {
- while (false !== ($file = readdir($handle))) {
- if ($file != "." && $file != "..") {
-
- $tftp_filesize = filesize('/tftpboot/'.$file);
- $tftp_filesize = tftp_byte_convert($tftp_filesize);
-
- echo "<tr>\n";
- echo " <td class=\"listlr\" ondblclick=\"\">\n";
- echo " <a href=\"tftp_files.php?a=download&filename=".$file."\">\n";
- echo " $file";
- echo " </a>";
- echo " </td>\n";
- echo " <td class=\"listlr\" ondblclick=\"\">\n";
- echo date ("F d Y H:i:s", filemtime('/tftpboot/'.$file));
- echo " </td>\n";
- echo " <td class=\"listlr\" ondblclick=\"\">\n";
- echo " ".$tftp_filesize;
- echo " </td>\n";
- echo " <td valign=\"middle\" nowrap class=\"list\">\n";
- echo " <table border=\"0\" cellspacing=\"0\" cellpadding=\"1\">\n";
- echo " <tr>\n";
- echo " <td valign=\"middle\"><form method='POST' action='/edit.php' target='_blank'><input type='hidden' name='savetopath' value='/tftpboot/".$file."'><input type='hidden' name='submit' value='Load'><input type='image' src=\"/themes/".$g['theme']."/images/icons/icon_e.gif\" width=\"17\" height=\"17\" border=\"0\"></form></td>\n";
- echo " <td><a href=\"tftp_files.php?type=tftp&act=del&filename=".$file."\" onclick=\"return confirm('Do you really want to delete this file?')\"><img src=\"/themes/". $g['theme']."/images/icons/icon_x.gif\" width=\"17\" height=\"17\" border=\"0\"></a></td>\n";
- echo " </tr>\n";
- echo " </table>\n";
- echo " </td>\n";
- echo "</tr>\n";
-
- }
- }
- closedir($handle);
- }
- ?>
-
- <tr>
- <td class="list" colspan="3"></td>
- <td class="list"></td>
- </tr>
- </table>
-
-
-<br>
-<br>
-<br>
-<br>
-<br>
-<br>
-
-</td>
-</tr>
-</table>
-
-</div>
-
-<?php include("fend.inc"); ?>
-</body>
-</html>