From eae55761de914f47136e06bafd99898061080a08 Mon Sep 17 00:00:00 2001 From: "John Molakvoæ (skjnldsv)" Date: Fri, 6 Apr 2018 20:19:52 +0200 Subject: Properly return boolean on enable state MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- apps/provisioning_api/lib/Controller/AUserData.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apps') 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()) { -- cgit v1.2.3 From 8b9bd37e4ed566adf6e20262280599108bb57c14 Mon Sep 17 00:00:00 2001 From: "John Molakvoæ (skjnldsv)" Date: Mon, 9 Apr 2018 11:31:41 +0200 Subject: Fixed tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- apps/provisioning_api/tests/Controller/UsersControllerTest.php | 4 ++-- tests/lib/User/UserTest.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'apps') diff --git a/apps/provisioning_api/tests/Controller/UsersControllerTest.php b/apps/provisioning_api/tests/Controller/UsersControllerTest.php index 3d6ab8f3ebf..148879d6d91 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', diff --git a/tests/lib/User/UserTest.php b/tests/lib/User/UserTest.php index acb171d92e3..2a99e725ec7 100644 --- a/tests/lib/User/UserTest.php +++ b/tests/lib/User/UserTest.php @@ -816,7 +816,7 @@ class UserTest extends TestCase { ->method('triggerChange') ->with( 'enabled', - 'false' + false ); $user->setEnabled(false); -- cgit v1.2.3