From 06f946b33bf7a6e7f49d7ed467fdc27eba919f49 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Thu, 6 Aug 2015 08:42:47 +0200 Subject: tftp_files.php - major code cleanup and fixes - fix copyright header - fix code indentation - XHTML valid code - make it possible to actually unset the selected TFTPD interfaces --- config/tftp2/tftp_files.php | 169 ++++++++++++++++++++++++-------------------- 1 file changed, 91 insertions(+), 78 deletions(-) (limited to 'config/tftp2') diff --git a/config/tftp2/tftp_files.php b/config/tftp2/tftp_files.php index 3562cd9f..eebe4c5e 100644 --- a/config/tftp2/tftp_files.php +++ b/config/tftp2/tftp_files.php @@ -1,10 +1,11 @@ @@ -141,78 +146,81 @@ if ($savemsg) { - \n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
+ - - +
-
-

TFTP Daemon Interfaces
+ +

TFTP Daemon Interfaces



- -
+ foreach ($ifdescs as $ifent => $ifdesc) { + $selected = ""; + if (in_array($ifent, $pconfig['tftpdinterface'])) { + $selected = " selected=\"selected\""; + } + echo "\t\t\t\n"; + } + ?> +
+

TFTP files
-
- 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. -

+

TFTP files
+ 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.
+

+

-
+ + + + +
File to upload: -
    -
-
- -
-
- - \n"; - echo "
\n"; - echo "Backup / Restore
\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 "

\n"; - echo "
\n"; - echo " \n"; - if (file_exists('/root/backup/tftp.bak.tgz')) { - echo " \n"; - } - echo "
\n"; - echo "

\n\n"; - ?> - + +

+ + + + + + +
+ Backup / Restore
+ The 'Backup' button compresses /tftpboot/ to /root/backup/tftp.bak.tgz; after that it presents the backup for download.
+ If the backup file does not exist in /root/backup/tftp.bak.tgz then the 'Restore' button will be hidden.
+ Use Diagnostics -> Command -> File to upload: to browse to the file and then click on upload.
+ After that, backup will be ready to be restored.

+
+ + \n"; + } + ?> +
+

@@ -225,28 +233,33 @@ if ($savemsg) { if ($handle = opendir('/tftpboot')) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { - $tftp_filesize = filesize('/tftpboot/'.$file); + $tftp_filesize = filesize("/tftpboot/{$file}"); $tftp_filesize = tftp_byte_convert($tftp_filesize); echo "\n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; } } -- cgit v1.2.3
\n"; - echo " \n"; - echo " $file"; - echo " "; - echo " \n"; - echo date ("F d Y H:i:s", filemtime('/tftpboot/'.$file)); - echo " \n"; - echo " ".$tftp_filesize; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo "
\n"; - echo "
"; + echo "{$file}"; + echo ""; + echo "\t\t" . date("F d Y H:i:s", filemtime('/tftpboot/'. $file)); + echo ""; + echo "\t\t{$tftp_filesize}"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo "\t
\n"; + echo "\t\t\n"; + echo "\t\t\n"; + echo "\t
\n"; + echo "
"; + echo "\"\""; + echo "
\n"; + echo "