server/apps/files/ajax/getstoragestats.php
Vincent Petry 31181e4348 Fixed storage stats to be based on current directory
Previously, the storage statistics were always for the root dir.
This means that the upload button would always show the limit for the
root dir, even when uploading to a shared dir or external storage.

This fix adds a "dir" argument to getstoragestats.php.
2013-11-06 10:55:19 +01:00

15 lines
278 B
PHP

<?php
// only need filesystem apps
$RUNTIME_APPTYPES = array('filesystem');
$dir = '/';
if (isset($_GET['dir'])) {
$dir = $_GET['dir'];
}
OCP\JSON::checkLoggedIn();
// send back json
OCP\JSON::success(array('data' => \OCA\Files\Helper::buildFileStorageStatistics($dir)));