summaryrefslogtreecommitdiffstats
path: root/apps/files/ajax/delete.php
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-02-19 14:33:24 +0100
committerVincent Petry <pvince81@owncloud.com>2014-02-19 14:33:24 +0100
commit952584e9c782d196eb2bcd6df1e3ecdf21adcb55 (patch)
tree7900602434f86a503b800f63ceb0a6a7b4499964 /apps/files/ajax/delete.php
parentf9d4780d27ca21d86d8dacf73eda52a73a479d61 (diff)
parent94b3296a71c5950f70919836bc12f0066016b705 (diff)
downloadnextcloud-server-952584e9c782d196eb2bcd6df1e3ecdf21adcb55.tar.gz
nextcloud-server-952584e9c782d196eb2bcd6df1e3ecdf21adcb55.zip
Merge pull request #7195 from owncloud/files-selectall
Do not send file list for select all on Download/delete
Diffstat (limited to 'apps/files/ajax/delete.php')
-rw-r--r--apps/files/ajax/delete.php15
1 files changed, 14 insertions, 1 deletions
diff --git a/apps/files/ajax/delete.php b/apps/files/ajax/delete.php
index c69f5a8860c..69f859daa97 100644
--- a/apps/files/ajax/delete.php
+++ b/apps/files/ajax/delete.php
@@ -9,8 +9,21 @@ OCP\JSON::callCheck();
// Get data
$dir = stripslashes($_POST["dir"]);
$files = isset($_POST["file"]) ? $_POST["file"] : $_POST["files"];
+$allFiles = isset($_POST["allfiles"]) ? $_POST["allfiles"] : $_POST["allfiles"];
+if ($allFiles === 'true') {
+ $allFiles = true;
+}
-$files = json_decode($files);
+// delete all files in dir ?
+if ($allFiles) {
+ $files = array();
+ $fileList = \OC\Files\Filesystem::getDirectoryContent($dir);
+ foreach ($fileList as $fileInfo) {
+ $files[] = $fileInfo['name'];
+ }
+} else {
+ $files = json_decode($files);
+}
$filesWithError = '';
$success = true;