|
|
|
@ -57,21 +57,11 @@ class OC_Util { |
|
|
|
|
// set up quota for home storages, even for other users |
|
|
|
|
// which can happen when using sharing |
|
|
|
|
|
|
|
|
|
if (strlen($mountPoint) > 1) { |
|
|
|
|
// the user name will be extracted from the mountpoint |
|
|
|
|
// with the format '/username/' (no suffix) |
|
|
|
|
$user = null; |
|
|
|
|
// find second separator |
|
|
|
|
$nextSepPos = strpos($mountPoint, '/', 1); |
|
|
|
|
// next separator is the last one, format matches |
|
|
|
|
if ($nextSepPos === strlen($mountPoint) - 1) { |
|
|
|
|
$user = substr($mountPoint, 1, $nextSepPos - 1); |
|
|
|
|
} |
|
|
|
|
if ($user) { |
|
|
|
|
$quota = OC_Util::getUserQuota($user); |
|
|
|
|
if ($quota !== \OC\Files\SPACE_UNLIMITED) { |
|
|
|
|
return new \OC\Files\Storage\Wrapper\Quota(array('storage' => $storage, 'quota' => $quota)); |
|
|
|
|
} |
|
|
|
|
if ($storage instanceof \OC\Files\Storage\Home) { |
|
|
|
|
$user = $storage->getUser()->getUID(); |
|
|
|
|
$quota = OC_Util::getUserQuota($user); |
|
|
|
|
if ($quota !== \OC\Files\SPACE_UNLIMITED) { |
|
|
|
|
return new \OC\Files\Storage\Wrapper\Quota(array('storage' => $storage, 'quota' => $quota)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|