summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2018-09-03 19:13:22 +0200
committerRobin Appelman <robin@icewind.nl>2018-09-20 17:03:36 +0200
commita623e09868ce62c4f1773f7672e011e32bdf26d8 (patch)
treee001f1fe4318cf438eb5cd4590f377938d14a38d
parentb4e452ad6025ab677bda49608803de1d84a59d11 (diff)
downloadnextcloud-server-a623e09868ce62c4f1773f7672e011e32bdf26d8.tar.gz
nextcloud-server-a623e09868ce62c4f1773f7672e011e32bdf26d8.zip
remove old trashbin endpoint
Signed-off-by: Robin Appelman <robin@icewind.nl>
-rw-r--r--apps/files_trashbin/ajax/list.php48
-rw-r--r--apps/files_trashbin/appinfo/routes.php2
-rw-r--r--build/integration/features/bootstrap/Trashbin.php14
3 files changed, 9 insertions, 55 deletions
diff --git a/apps/files_trashbin/ajax/list.php b/apps/files_trashbin/ajax/list.php
deleted file mode 100644
index e72c063f428..00000000000
--- a/apps/files_trashbin/ajax/list.php
+++ /dev/null
@@ -1,48 +0,0 @@
-<?php
-/**
- * @copyright Copyright (c) 2016, ownCloud, Inc.
- *
- * @author Björn Schießle <bjoern@schiessle.org>
- * @author Lukas Reschke <lukas@statuscode.ch>
- * @author Vincent Petry <pvince81@owncloud.com>
- *
- * @license AGPL-3.0
- *
- * This code is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License, version 3,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License, version 3,
- * along with this program. If not, see <http://www.gnu.org/licenses/>
- *
- */
-\OC_JSON::checkLoggedIn();
-\OC::$server->getSession()->close();
-
-// Load the files
-$dir = isset($_GET['dir']) ? (string)$_GET['dir'] : '';
-$sortAttribute = isset($_GET['sort']) ? (string)$_GET['sort'] : 'name';
-$sortDirection = isset($_GET['sortdirection']) ? ($_GET['sortdirection'] === 'desc') : false;
-$data = array();
-
-// make filelist
-try {
- $files = \OCA\Files_Trashbin\Helper::getTrashFiles($dir, \OCP\User::getUser(), $sortAttribute, $sortDirection);
-} catch (Exception $e) {
- http_response_code(404);
- exit();
-}
-
-$encodedDir = \OCP\Util::encodePath($dir);
-
-$data['permissions'] = 0;
-$data['directory'] = $dir;
-$data['files'] = \OCA\Files_Trashbin\Helper::formatFileInfos($files);
-
-\OC_JSON::success(array('data' => $data));
-
diff --git a/apps/files_trashbin/appinfo/routes.php b/apps/files_trashbin/appinfo/routes.php
index 21b4bc2d8c9..2f03c5130ce 100644
--- a/apps/files_trashbin/appinfo/routes.php
+++ b/apps/files_trashbin/appinfo/routes.php
@@ -39,8 +39,6 @@ $this->create('files_trashbin_ajax_delete', 'ajax/delete.php')
->actionInclude('files_trashbin/ajax/delete.php');
$this->create('files_trashbin_ajax_isEmpty', 'ajax/isEmpty.php')
->actionInclude('files_trashbin/ajax/isEmpty.php');
-$this->create('files_trashbin_ajax_list', 'ajax/list.php')
- ->actionInclude('files_trashbin/ajax/list.php');
$this->create('files_trashbin_ajax_undelete', 'ajax/undelete.php')
->actionInclude('files_trashbin/ajax/undelete.php');
diff --git a/build/integration/features/bootstrap/Trashbin.php b/build/integration/features/bootstrap/Trashbin.php
index 49d547a5edc..81725e940d5 100644
--- a/build/integration/features/bootstrap/Trashbin.php
+++ b/build/integration/features/bootstrap/Trashbin.php
@@ -51,13 +51,17 @@ trait Trashbin {
*/
public function listTrashbinFolder($user, $path){
$this->asAn($user);
- $params = '?dir=' . rawurlencode('/' . trim($path, '/'));
- $this->sendingToWithDirectUrl('GET', '/index.php/apps/files_trashbin/ajax/list.php' . $params, null);
+ $this->sendingToWithDirectUrl('PROPFIND', "/remote.php/dav/trashbin/$user/$path", null);
$this->theHTTPStatusCodeShouldBe('200');
- $response = json_decode($this->response->getBody(), true);
-
- return $response['data']['files'];
+ $body = $this->response->getBody();
+ if($body && substr($body, 0, 1) === '<') {
+ $reader = new Sabre\Xml\Reader();
+ $reader->xml($body);
+ return $reader->parse();
+ } else {
+ return [];
+ }
}
/**