summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-04-09 23:39:02 +0200
committerGitHub <noreply@github.com>2018-04-09 23:39:02 +0200
commitacbcc607ea74cfb1b46ab33ee00fd850e080edeb (patch)
treeaf4ed5d81a416f4395595860999ea449caaa3eee /apps
parent0fa796fb8512490bf1bf126c9ebfa53300a945c7 (diff)
parent8b9bd37e4ed566adf6e20262280599108bb57c14 (diff)
downloadnextcloud-server-acbcc607ea74cfb1b46ab33ee00fd850e080edeb.tar.gz
nextcloud-server-acbcc607ea74cfb1b46ab33ee00fd850e080edeb.zip
Merge pull request #9111 from nextcloud/use-proper-bool-user-disabled-state
Return proper boolean and do not save enabled state in db
Diffstat (limited to 'apps')
-rw-r--r--apps/provisioning_api/lib/Controller/AUserData.php2
-rw-r--r--apps/provisioning_api/tests/Controller/UsersControllerTest.php4
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 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',