diff options
author | nachoparker <nacho@ownyourbits.com> | 2019-04-30 05:06:58 +0300 |
---|---|---|
committer | nachoparker <nacho@ownyourbits.com> | 2019-05-01 03:02:58 +0300 |
commit | f34354c336614bc74df41381dafda6cea90642cc (patch) | |
tree | 8688f54a710657e25d4a820098c32913f0c54568 /ncp-web/ncp-launcher.php | |
parent | 01cd4215a530aeff3a62e3a38f07d4cc734cb1bb (diff) |
ncp-web: add backups panelv1.12.0
Diffstat (limited to 'ncp-web/ncp-launcher.php')
-rw-r--r-- | ncp-web/ncp-launcher.php | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/ncp-web/ncp-launcher.php b/ncp-web/ncp-launcher.php index 60f22e65..122a43ba 100644 --- a/ncp-web/ncp-launcher.php +++ b/ncp-web/ncp-launcher.php @@ -137,6 +137,21 @@ else if ( $_POST['action'] == "info" ) } // +// backups +// +else if ( $_POST['action'] == "backups" ) +{ + ob_start(); + include('backups.php'); + $backups_page = ob_get_clean(); + + // return JSON + echo '{ "token": "' . getCSRFToken() . '",'; // Get new token + echo ' "output": ' . json_encode($backups_page) . ' , '; + echo ' "ret": "0" }'; +} + +// // sidebar // else if ( $_POST['action'] == "sidebar" ) @@ -176,6 +191,34 @@ else if ( $_POST['action'] == "path-exists" ) } // +// del backup +// +else if ( $_POST['action'] == "del-bkp" ) +{ + $file = escapeshellarg($_POST['value']); + $ret = 1; + exec("sudo /home/www/ncp-backup-launcher.sh del $file", $out, $ret); + + // return JSON + echo '{ "token": "' . getCSRFToken() . '",'; // Get new token + echo ' "ret": "' . $ret . '" }'; +} + +// +// del snapshot +// +else if ( $_POST['action'] == "del-snap" ) +{ + $file = escapeshellarg($_POST['value']); + $ret = 1; + exec("sudo /home/www/ncp-backup-launcher.sh delsnp $file", $out, $ret); + + // return JSON + echo '{ "token": "' . getCSRFToken() . '",'; // Get new token + echo ' "ret": "' . $ret . '" }'; +} + +// // poweroff // else if ( $_POST['action'] == "poweroff" ) |