summaryrefslogtreecommitdiffstats
path: root/apps/files/ajax
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2013-11-06 10:55:19 +0100
committerVincent Petry <pvince81@owncloud.com>2013-11-06 10:55:19 +0100
commit31181e4348b9af2625cf4d6ad38cf4cd81db3c1f (patch)
treefc295013189c1c371b35c5080d85787b83f5b70a /apps/files/ajax
parent5d9ab6e7ac161a2431d9baca59281c03015b4ff5 (diff)
downloadnextcloud-server-31181e4348b9af2625cf4d6ad38cf4cd81db3c1f.tar.gz
nextcloud-server-31181e4348b9af2625cf4d6ad38cf4cd81db3c1f.zip
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.
Diffstat (limited to 'apps/files/ajax')
-rw-r--r--apps/files/ajax/getstoragestats.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/files/ajax/getstoragestats.php b/apps/files/ajax/getstoragestats.php
index 32a77bff6c3..dd7c7dc5571 100644
--- a/apps/files/ajax/getstoragestats.php
+++ b/apps/files/ajax/getstoragestats.php
@@ -3,7 +3,13 @@
// 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('/')));
+OCP\JSON::success(array('data' => \OCA\Files\Helper::buildFileStorageStatistics($dir)));