File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -166,6 +166,7 @@ public static function setupFS($user = '') {
166166
167167 // install storage availability wrapper, before most other wrappers
168168 \OC \Files \Filesystem::addStorageWrapper ('oc_availability ' , function ($ mountPoint , $ storage ) {
169+ /** @var \OCP\Files\Storage $storage */
169170 if (!$ storage ->instanceOfStorage ('\OC\Files\Storage\Shared ' ) && !$ storage ->isLocal ()) {
170171 return new \OC \Files \Storage \Wrapper \Availability (['storage ' => $ storage ]);
171172 }
@@ -283,16 +284,19 @@ public static function isDefaultExpireDateEnforced() {
283284 /**
284285 * Get the quota of a user
285286 *
286- * @param string $user
287+ * @param string $userId
287288 * @return int Quota bytes
288289 */
289- public static function getUserQuota ($ user ) {
290- $ userQuota = \OC ::$ server ->getUserManager ()->get ($ user )-> getQuota ( );
291- if ( $ userQuota === ' none ' ) {
290+ public static function getUserQuota ($ userId ) {
291+ $ user = \OC ::$ server ->getUserManager ()->get ($ userId );
292+ if ( is_null ( $ user ) ) {
292293 return \OCP \Files \FileInfo::SPACE_UNLIMITED ;
293- }else {
294- return OC_Helper::computerFileSize ($ userQuota );
295294 }
295+ $ userQuota = $ user ->getQuota ();
296+ if ($ userQuota === 'none ' ) {
297+ return \OCP \Files \FileInfo::SPACE_UNLIMITED ;
298+ }
299+ return OC_Helper::computerFileSize ($ userQuota );
296300 }
297301
298302 /**
You can’t perform that action at this time.
0 commit comments