summaryrefslogtreecommitdiffstats
path: root/apps/files/ajax/delete.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-10-27 12:18:01 +0200
committerRobin Appelman <icewind@owncloud.com>2012-10-27 12:18:01 +0200
commitdea0d20a9ad0270896e57a7459d6276798658d7c (patch)
treee7d20d756d1e802eccb524d84d37d3d015ad5bc9 /apps/files/ajax/delete.php
parent5bfff6c56e8d4d911c7a5265bb5462c7122ca495 (diff)
downloadnextcloud-server-dea0d20a9ad0270896e57a7459d6276798658d7c.tar.gz
nextcloud-server-dea0d20a9ad0270896e57a7459d6276798658d7c.zip
fix delete and sort files
Diffstat (limited to 'apps/files/ajax/delete.php')
-rw-r--r--apps/files/ajax/delete.php19
1 files changed, 8 insertions, 11 deletions
diff --git a/apps/files/ajax/delete.php b/apps/files/ajax/delete.php
index ae6158a05aa..fdd0c0c491d 100644
--- a/apps/files/ajax/delete.php
+++ b/apps/files/ajax/delete.php
@@ -12,18 +12,15 @@ $files = isset($_POST["file"]) ? stripslashes($_POST["file"]) : stripslashes($_P
$files = explode(';', $files);
$filesWithError = '';
-if (OC_User::isLoggedIn()) {
- $success = true;
-
- //Now delete
- foreach ($files as $file) {
- if ($dir != '' || $file != 'Shared' && !\OC\Files\Filesystem::unlink($dir . '/' . $file)) {
- $filesWithError .= $file . "\n";
- $success = false;
- }
+
+$success = true;
+
+//Now delete
+foreach ($files as $file) {
+ if (($dir === '' && $file === 'Shared') || !\OC\Files\Filesystem::unlink($dir . '/' . $file)) {
+ $filesWithError .= $file . "\n";
+ $success = false;
}
-} else {
- $success = false;
}
if ($success) {