From d7b44a632dc21cf12d8e0af37b432ac01d4fa369 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Tue, 13 Mar 2018 00:13:04 +0100 Subject: [PATCH] Fixes #19810 - return the quota setting as defined for the user. --- apps/provisioning_api/lib/Users.php | 3 +++ apps/provisioning_api/tests/UsersTest.php | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) 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',