2013-01-11 15:47:28 +00:00
|
|
|
<?php
|
2015-03-26 10:44:34 +00:00
|
|
|
/**
|
|
|
|
* @author Jörn Friedrich Dreyer <jfd@butonic.de>
|
|
|
|
* @author Lukas Reschke <lukas@owncloud.com>
|
|
|
|
* @author Robin Appelman <icewind@owncloud.com>
|
|
|
|
* @author Thomas Müller <thomas.mueller@tmit.eu>
|
|
|
|
* @author Vincent Petry <pvince81@owncloud.com>
|
|
|
|
*
|
2016-01-12 14:02:16 +00:00
|
|
|
* @copyright Copyright (c) 2016, ownCloud, Inc.
|
2015-03-26 10:44:34 +00:00
|
|
|
* @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 09:55:19 +00:00
|
|
|
$dir = '/';
|
|
|
|
|
|
|
|
if (isset($_GET['dir'])) {
|
2015-02-13 12:33:20 +00:00
|
|
|
$dir = (string)$_GET['dir'];
|
2013-11-06 09:55:19 +00:00
|
|
|
}
|
|
|
|
|
2013-01-11 15:47:28 +00:00
|
|
|
OCP\JSON::checkLoggedIn();
|
2014-07-16 17:40:22 +00:00
|
|
|
\OC::$server->getSession()->close();
|
2013-01-11 15:47:28 +00:00
|
|
|
|
|
|
|
// send back json
|
2015-01-06 14:56:06 +00: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']]);
|
|
|
|
}
|