2013-01-11 19:47:28 +04:00
|
|
|
<?php
|
2015-03-26 13:44:34 +03:00
|
|
|
/**
|
2016-07-21 17:49:16 +03:00
|
|
|
* @copyright Copyright (c) 2016, ownCloud, Inc.
|
|
|
|
*
|
2015-03-26 13:44:34 +03:00
|
|
|
* @author Jörn Friedrich Dreyer <jfd@butonic.de>
|
2016-05-26 20:56:05 +03:00
|
|
|
* @author Lukas Reschke <lukas@statuscode.ch>
|
2016-07-21 19:13:36 +03:00
|
|
|
* @author Robin Appelman <robin@icewind.nl>
|
2015-03-26 13:44:34 +03:00
|
|
|
* @author Thomas Müller <thomas.mueller@tmit.eu>
|
|
|
|
* @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/>
|
|
|
|
*
|
|
|
|
*/
|
2013-11-06 13:55:19 +04:00
|
|
|
$dir = '/';
|
|
|
|
|
|
|
|
if (isset($_GET['dir'])) {
|
2015-02-13 15:33:20 +03:00
|
|
|
$dir = (string)$_GET['dir'];
|
2013-11-06 13:55:19 +04:00
|
|
|
}
|
|
|
|
|
2013-01-11 19:47:28 +04:00
|
|
|
OCP\JSON::checkLoggedIn();
|
2014-07-16 21:40:22 +04:00
|
|
|
\OC::$server->getSession()->close();
|
2013-01-11 19:47:28 +04:00
|
|
|
|
|
|
|
// send back json
|
2015-01-06 17:56:06 +03:00
|
|
|
try {
|
|
|
|
OCP\JSON::success(array('data' => \OCA\Files\Helper::buildFileStorageStatistics($dir)));
|
|
|
|
} catch (\OCP\Files\NotFoundException $e) {
|
|
|
|
OCP\JSON::error(['data' => ['message' => 'Folder not found']]);
|
|
|
|
}
|