Merge pull request #4585 from owncloud/fixing-4385-master

Fixing 4385 master
This commit is contained in:
Morris Jobke 2013-08-27 01:40:50 -07:00
commit c09cfe4fb9
5 changed files with 13 additions and 10 deletions

View file

@ -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')) {

View file

@ -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,

View file

@ -233,10 +233,10 @@ class OC_Connector_Sabre_Directory extends OC_Connector_Sabre_Node implements Sa
* @return array
*/
public function getQuotaInfo() {
$rootInfo=\OC\Files\Filesystem::getFileInfo('');
$storageInfo = OC_Helper::getStorageInfo($this->path);
return array(
$rootInfo['size'],
\OC\Files\Filesystem::free_space()
$storageInfo['used'],
$storageInfo['total']
);
}

View file

@ -841,15 +841,18 @@ class OC_Helper {
}
/**
* Calculate the disc space
* Calculate the disc space for the given path
*
* @param string $path
* @return array
*/
public static function getStorageInfo() {
$rootInfo = \OC\Files\Filesystem::getFileInfo('/');
public static function getStorageInfo($path) {
$rootInfo = \OC\Files\Filesystem::getFileInfo($path);
$used = $rootInfo['size'];
if ($used < 0) {
$used = 0;
}
$free = \OC\Files\Filesystem::free_space();
$free = \OC\Files\Filesystem::free_space($path);
if ($free >= 0) {
$total = $free + $used;
} else {

View file

@ -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', '');