From: Thomas Müller Date: Mon, 26 Aug 2013 22:59:58 +0000 (+0200) Subject: storage information is path specific X-Git-Tag: v6.0.0alpha2~270^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8cf9336bcbe527c3d3eb7b348f3a0feff799c1da;p=nextcloud-server.git storage information is path specific --- diff --git a/apps/files/index.php b/apps/files/index.php index 94c792303da..e4d8e353858 100644 --- a/apps/files/index.php +++ b/apps/files/index.php @@ -119,7 +119,7 @@ if ($needUpgrade) { $tmpl->printPage(); } else { // information about storage capacities - $storageInfo=OC_Helper::getStorageInfo(); + $storageInfo=OC_Helper::getStorageInfo($dir); $maxUploadFilesize=OCP\Util::maxUploadFilesize($dir); $publicUploadEnabled = \OC_Appconfig::getValue('core', 'shareapi_allow_public_upload', 'yes'); if (OC_App::isEnabled('files_encryption')) { diff --git a/apps/files/lib/helper.php b/apps/files/lib/helper.php index f2b1f142e9b..7135ef9f656 100644 --- a/apps/files/lib/helper.php +++ b/apps/files/lib/helper.php @@ -11,7 +11,7 @@ class Helper $maxHumanFilesize = $l->t('Upload') . ' max. ' . $maxHumanFilesize; // information about storage capacities - $storageInfo = \OC_Helper::getStorageInfo(); + $storageInfo = \OC_Helper::getStorageInfo($dir); return array('uploadMaxFilesize' => $maxUploadFilesize, 'maxHumanFilesize' => $maxHumanFilesize, diff --git a/lib/helper.php b/lib/helper.php index 128786087b8..dd2476eda5c 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -841,9 +841,12 @@ class OC_Helper { } /** - * Calculate the disc space + * Calculate the disc space for the given path + * + * @param string $path + * @return array */ - public static function getStorageInfo($path = '/') { + public static function getStorageInfo($path) { $rootInfo = \OC\Files\Filesystem::getFileInfo($path); $used = $rootInfo['size']; if ($used < 0) { diff --git a/settings/personal.php b/settings/personal.php index e69898f6f8f..112eaa3c748 100644 --- a/settings/personal.php +++ b/settings/personal.php @@ -17,7 +17,7 @@ OC_Util::addScript( '3rdparty', 'chosen/chosen.jquery.min' ); OC_Util::addStyle( '3rdparty', 'chosen' ); OC_App::setActiveNavigationEntry( 'personal' ); -$storageInfo=OC_Helper::getStorageInfo(); +$storageInfo=OC_Helper::getStorageInfo('/'); $email=OC_Preferences::getValue(OC_User::getUser(), 'settings', 'email', '');