Skip to content

Commit

Permalink
Merge pull request #25777 from owncloud/stable9-eaecf0cfa9094eb5224e5…
Browse files Browse the repository at this point in the history
…68b7bdde1bd49cfad73

[stable9] Merge pull request #25652 from owncloud/fix-getQuota-on-null
  • Loading branch information
Vincent Petry authored Aug 17, 2016
2 parents 9cda05f + ef8da70 commit 40fc3d1
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions lib/private/util.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,16 +282,19 @@ public static function isDefaultExpireDateEnforced() {
/**
* Get the quota of a user
*
* @param string $user
* @param string $userId
* @return int Quota bytes
*/
public static function getUserQuota($user) {
$userQuota = \OC::$server->getUserManager()->get($user)->getQuota();
public static function getUserQuota($userId) {
$user = \OC::$server->getUserManager()->get($userId);
if (is_null($user)) {
return \OCP\Files\FileInfo::SPACE_UNLIMITED;
}
$userQuota = $user->getQuota();
if($userQuota === 'none') {
return \OCP\Files\FileInfo::SPACE_UNLIMITED;
}else{
return OC_Helper::computerFileSize($userQuota);
}
return OC_Helper::computerFileSize($userQuota);
}

/**
Expand Down

0 comments on commit 40fc3d1

Please sign in to comment.