Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable10] Fixes #19810 - return the quota setting as defined for the user. #30850

Merged
merged 1 commit into from
Mar 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions apps/provisioning_api/lib/Users.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -662,6 +664,7 @@ protected function fillStorageInfo($userId) {
} catch (NotFoundException $ex) {
$data = [];
}

return $data;
}
}
6 changes: 3 additions & 3 deletions apps/provisioning_api/tests/UsersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ public function testGetUserAsAdmin() {
$expected = new Result(
[
'enabled' => 'true',
'quota' => ['DummyValue'],
'quota' => ['DummyValue', 'definition' => null],
'email' => '[email protected]',
'displayname' => 'Demo User',
'home' => '/var/ocdata/UserToGet',
Expand Down Expand Up @@ -798,7 +798,7 @@ public function testGetUserAsSubAdminAndUserIsAccessible() {
$expected = new Result(
[
'enabled' => 'true',
'quota' => ['DummyValue'],
'quota' => ['DummyValue', 'definition' => null],
'email' => '[email protected]',
'home' => '/var/ocdata/UserToGet',
'displayname' => 'Demo User',
Expand Down Expand Up @@ -897,7 +897,7 @@ public function testGetUserAsSubAdminSelfLookup() {
->will($this->returnValue('[email protected]'));

$expected = new Result([
'quota' => ['DummyValue'],
'quota' => ['DummyValue', 'definition' => null],
'email' => '[email protected]',
'displayname' => 'Subadmin User',
'home' => '/var/ocdata/UserToGet',
Expand Down