From d33e33fc4e9985b7d5cad7ac66553e7497eee1ee Mon Sep 17 00:00:00 2001 From: doktornotor Date: Sat, 31 Oct 2015 13:05:02 +0100 Subject: Make the GUI look a bit civilized --- config/tftp2/tftp_files.php | 135 ++++++++++++++++++++++---------------------- 1 file changed, 69 insertions(+), 66 deletions(-) (limited to 'config/tftp2') diff --git a/config/tftp2/tftp_files.php b/config/tftp2/tftp_files.php index eebe4c5e..0352f4a0 100644 --- a/config/tftp2/tftp_files.php +++ b/config/tftp2/tftp_files.php @@ -29,6 +29,7 @@ POSSIBILITY OF SUCH DAMAGE. */ require_once("guiconfig.inc"); +require_once("util.inc"); require_once("/usr/local/pkg/tftp.inc"); $pconfig['tftpdinterface'] = explode(",", $config['installedpackages']['tftpd']['config'][0]['tftpdinterface']); @@ -43,7 +44,7 @@ if (($_GET['a'] == "download") && $_GET['t'] == "backup") { conf_mount_rw(); $filename = $backup_filename; $download_dir = $backup_dir; - system("tar -czC / -f {$backup_path} tftpboot"); + mwexec("/usr/bin/tar -czC / -f {$backup_path} tftpboot"); conf_mount_ro(); } @@ -73,8 +74,8 @@ if ($_GET['a'] == "other") { if (file_exists($backup_path)) { //echo "The file $filename exists"; conf_mount_rw(); - system("tar -xpzC / -f {$backup_path}"); - system("chmod -R 744 {$files_dir}/*"); + mwexec("/usr/bin/tar -xpzC / -f {$backup_path}"); + mwexec("/bin/chmod -R 744 {$files_dir}/*"); header( 'Location: tftp_files.php?savemsg=Backup+has+been+restored.' ) ; conf_mount_ro(); } else { @@ -100,7 +101,7 @@ if (($_POST['submit'] == "Upload") && is_uploaded_file($_FILES['ulfile']['tmp_na conf_mount_rw(); move_uploaded_file($_FILES['ulfile']['tmp_name'], "{$files_dir}/{$_FILES['ulfile']['name']}"); $savemsg = "Uploaded file to {$files_dir}/" . htmlentities($_FILES['ulfile']['name']); - system('chmod -R 744 {$files_dir}/*'); + mwexec('/bin/chmod -R 744 {$files_dir}/*'); unset($_POST['txtCommand']); conf_mount_ro(); } @@ -122,7 +123,7 @@ include("head.inc"); -

TFTP: Files

+

TFTP: Settings/Files

@@ -145,14 +146,16 @@ if ($savemsg) { +
+
+ - + + + +
- + + + - + -
TFTP Daemon Interfaces
Select TFTP Daemon Interface(s).
-

TFTP Daemon Interfaces

-


- +

+ + Choose the interfaces where you want the TFTP Daemon to accept connections.
+ Hint: If you simply need to (re)start tftpd/inetd, just use the Save button without making any changes here.

+
+
-

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 Upload
-
-
-
- - - - - - - - - -
File to upload: - -
    - -
-
-
-

- - - - + -
- 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"; - } - ?> + Use the file upload to add files to the /tftpboot directory. +
+ 1. Select file to upload:  + +
+ 2. Upload the selected file:  + +
-

- - - - + + + + + + + + - - + -
File Name (download)Last ModifiedSizeTFTP Files Download
Click on the file from the file list below to download it.
+ + + + + + + + + + +
File Name (download)Last ModifiedSize
+
TFTP Backup / Restore
-
Use the file upload to add files to the /tftpboot directory. + Backup: 'Backup' button compresses /tftpboot/ to /root/backup/tftp.bak.tgz; after that it presents the backup for download.
+ Restore: If the backup file does not exist in /root/backup/tftp.bak.tgz then the 'Restore' button will be hidden. + To 'Restore' a previously downloaded backup, use Diagnostics -> Command Prompt -> File to upload to browse to the file and then click on upload.
+ After that, backup will be ready to be restored.

+
+ + \n"; + } + ?> +
+ +
+
-- cgit v1.2.3