diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-04-12 19:12:17 +0200 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-04-16 15:17:02 +0200 |
commit | 3e5ea9b0a92c8c1210b2349491d7460835cba738 (patch) | |
tree | d7ce17805181e4c99d7df63d0a4477b2f6b50034 /apps | |
parent | 056660bf7ce0e587be7276e640e424280ff66804 (diff) | |
download | nextcloud-server-3e5ea9b0a92c8c1210b2349491d7460835cba738.tar.gz nextcloud-server-3e5ea9b0a92c8c1210b2349491d7460835cba738.zip |
Return proper boolean user enabled state api
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/provisioning_api/lib/Controller/AUserData.php | 2 | ||||
-rw-r--r-- | apps/provisioning_api/tests/Controller/UsersControllerTest.php | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/apps/provisioning_api/lib/Controller/AUserData.php b/apps/provisioning_api/lib/Controller/AUserData.php index 82ca98ced8c..6c4967a6c3b 100644 --- a/apps/provisioning_api/lib/Controller/AUserData.php +++ b/apps/provisioning_api/lib/Controller/AUserData.php @@ -92,7 +92,7 @@ abstract class AUserData extends OCSController { // Should be at least Admin Or SubAdmin! if( $this->groupManager->isAdmin($currentLoggedInUser->getUID()) || $this->groupManager->getSubAdmin()->isUserAccessible($currentLoggedInUser, $targetUserObject)) { - $data['enabled'] = $this->config->getUserValue($targetUserObject->getUID(), 'core', 'enabled', 'true'); + $data['enabled'] = $this->config->getUserValue($targetUserObject->getUID(), 'core', 'enabled', 'true') === 'true'; } else { // Check they are looking up themselves if($currentLoggedInUser->getUID() !== $targetUserObject->getUID()) { diff --git a/apps/provisioning_api/tests/Controller/UsersControllerTest.php b/apps/provisioning_api/tests/Controller/UsersControllerTest.php index 6959f16f5cb..7625218e7e5 100644 --- a/apps/provisioning_api/tests/Controller/UsersControllerTest.php +++ b/apps/provisioning_api/tests/Controller/UsersControllerTest.php @@ -766,7 +766,7 @@ class UsersControllerTest extends TestCase { $expected = [ 'id' => 'UID', - 'enabled' => 'true', + 'enabled' => true, 'storageLocation' => '/var/www/newtcloud/data/UID', 'lastLogin' => 1521191471000, 'backend' => 'Database', @@ -881,7 +881,7 @@ class UsersControllerTest extends TestCase { $expected = [ 'id' => 'UID', - 'enabled' => 'true', + 'enabled' => true, 'storageLocation' => '/var/www/newtcloud/data/UID', 'lastLogin' => 1521191471000, 'backend' => 'Database', |