Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/nextcloudpi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'ncp-web/ncp-launcher.php')
-rw-r--r--ncp-web/ncp-launcher.php43
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" )