diff --git a/apps/provisioning_api/lib/Users.php b/apps/provisioning_api/lib/Users.php index 8a10d2890354..5393f5f156c3 100644 --- a/apps/provisioning_api/lib/Users.php +++ b/apps/provisioning_api/lib/Users.php @@ -32,6 +32,7 @@ use OC\OCS\Result; use OC_Helper; use OCP\API; +use OCP\Files\FileInfo; use OCP\Files\NotFoundException; use OCP\IGroup; use OCP\IGroupManager; @@ -211,6 +212,7 @@ public function getUser($parameters) { // Find the data $data['quota'] = $this->fillStorageInfo($userId); + $data['quota']['definition'] = $targetUserObject->getQuota(); $data['email'] = $targetUserObject->getEMailAddress(); $data['displayname'] = $targetUserObject->getDisplayName(); $data['home'] = $targetUserObject->getHome(); @@ -662,6 +664,7 @@ protected function fillStorageInfo($userId) { } catch (NotFoundException $ex) { $data = []; } + return $data; } } diff --git a/apps/provisioning_api/tests/UsersTest.php b/apps/provisioning_api/tests/UsersTest.php index a1308d45c3cd..ac13265142e7 100644 --- a/apps/provisioning_api/tests/UsersTest.php +++ b/apps/provisioning_api/tests/UsersTest.php @@ -731,7 +731,7 @@ public function testGetUserAsAdmin() { $expected = new Result( [ 'enabled' => 'true', - 'quota' => ['DummyValue'], + 'quota' => ['DummyValue', 'definition' => null], 'email' => 'demo@owncloud.org', 'displayname' => 'Demo User', 'home' => '/var/ocdata/UserToGet', @@ -798,7 +798,7 @@ public function testGetUserAsSubAdminAndUserIsAccessible() { $expected = new Result( [ 'enabled' => 'true', - 'quota' => ['DummyValue'], + 'quota' => ['DummyValue', 'definition' => null], 'email' => 'demo@owncloud.org', 'home' => '/var/ocdata/UserToGet', 'displayname' => 'Demo User', @@ -897,7 +897,7 @@ public function testGetUserAsSubAdminSelfLookup() { ->will($this->returnValue('subadmin@owncloud.org')); $expected = new Result([ - 'quota' => ['DummyValue'], + 'quota' => ['DummyValue', 'definition' => null], 'email' => 'subadmin@owncloud.org', 'displayname' => 'Subadmin User', 'home' => '/var/ocdata/UserToGet',