mirror of
https://github.com/unraid/webgui.git
synced 2026-03-13 14:30:29 -05:00
initial commit
This commit is contained in:
37
plugins/dynamix/include/Download.php
Normal file
37
plugins/dynamix/include/Download.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?PHP
|
||||
/* Copyright 2015, Bergware International.
|
||||
* Copyright 2015, Lime Technology
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
$docroot = $_SERVER['DOCUMENT_ROOT'];
|
||||
$file = $_POST['file'];
|
||||
switch ($_POST['cmd']) {
|
||||
case 'save':
|
||||
$source = $_POST['source'];
|
||||
if (pathinfo($source, PATHINFO_EXTENSION) == 'txt') {
|
||||
exec("zip -qlj $docroot/$file $source");
|
||||
} else {
|
||||
$tmp = "/var/tmp/".basename($source).".txt";
|
||||
copy($source, $tmp);
|
||||
exec("zip -qlj $docroot/$file $tmp");
|
||||
@unlink($tmp);
|
||||
}
|
||||
echo "/$file";
|
||||
break;
|
||||
case 'delete':
|
||||
@unlink("$docroot/$file");
|
||||
break;
|
||||
case 'diag':
|
||||
exec("$docroot/webGui/scripts/diagnostics $docroot/$file");
|
||||
echo "/$file";
|
||||
break;
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user