nextcloud /
server
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
| 1 | <?php |
||
| 2 | /** |
||
| 3 | * @copyright Copyright (c) 2016, ownCloud, Inc. |
||
| 4 | * |
||
| 5 | * @author Björn Schießle <[email protected]> |
||
| 6 | * @author Lukas Reschke <[email protected]> |
||
| 7 | * @author Vincent Petry <[email protected]> |
||
| 8 | * |
||
| 9 | * @license AGPL-3.0 |
||
| 10 | * |
||
| 11 | * This code is free software: you can redistribute it and/or modify |
||
| 12 | * it under the terms of the GNU Affero General Public License, version 3, |
||
| 13 | * as published by the Free Software Foundation. |
||
| 14 | * |
||
| 15 | * This program is distributed in the hope that it will be useful, |
||
| 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
| 18 | * GNU Affero General Public License for more details. |
||
| 19 | * |
||
| 20 | * You should have received a copy of the GNU Affero General Public License, version 3, |
||
| 21 | * along with this program. If not, see <http://www.gnu.org/licenses/> |
||
| 22 | * |
||
| 23 | */ |
||
| 24 | OCP\JSON::checkLoggedIn(); |
||
|
0 ignored issues
–
show
|
|||
| 25 | \OC::$server->getSession()->close(); |
||
| 26 | |||
| 27 | // Load the files |
||
| 28 | $dir = isset($_GET['dir']) ? (string)$_GET['dir'] : ''; |
||
| 29 | $sortAttribute = isset($_GET['sort']) ? (string)$_GET['sort'] : 'name'; |
||
| 30 | $sortDirection = isset($_GET['sortdirection']) ? ($_GET['sortdirection'] === 'desc') : false; |
||
| 31 | $data = array(); |
||
| 32 | |||
| 33 | // make filelist |
||
| 34 | try { |
||
| 35 | $files = \OCA\Files_Trashbin\Helper::getTrashFiles($dir, \OCP\User::getUser(), $sortAttribute, $sortDirection); |
||
|
0 ignored issues
–
show
The method
OCP\User::getUser() has been deprecated with message: 8.0.0 Use \OC::$server->getUserSession()->getUser()->getUID()
This method has been deprecated. The supplier of the class has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead. Loading history...
|
|||
| 36 | } catch (Exception $e) { |
||
| 37 | header("HTTP/1.0 404 Not Found"); |
||
| 38 | exit(); |
||
| 39 | } |
||
| 40 | |||
| 41 | $encodedDir = \OCP\Util::encodePath($dir); |
||
| 42 | |||
| 43 | $data['permissions'] = 0; |
||
| 44 | $data['directory'] = $dir; |
||
| 45 | $data['files'] = \OCA\Files_Trashbin\Helper::formatFileInfos($files); |
||
| 46 | |||
| 47 | OCP\JSON::success(array('data' => $data)); |
||
|
0 ignored issues
–
show
The method
OCP\JSON::success() has been deprecated with message: 8.1.0 Use a AppFramework JSONResponse instead
This method has been deprecated. The supplier of the class has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead. Loading history...
|
|||
| 48 | |||
| 49 |
This method has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.