]> source.dussan.org Git - nextcloud-server.git/commitdiff
uses "yes" and "no" for config switch over stringified numbers 15964/head
authorArthur Schiwon <blizzz@arthur-schiwon.de>
Fri, 21 Jun 2019 08:18:44 +0000 (10:18 +0200)
committerArthur Schiwon <blizzz@arthur-schiwon.de>
Fri, 21 Jun 2019 08:22:12 +0000 (10:22 +0200)
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
apps/provisioning_api/lib/Controller/UsersController.php
apps/provisioning_api/tests/Controller/UsersControllerTest.php
settings/Controller/UsersController.php

index 28ab99a0ee0393a45db90c9618ab1b88e82f283c..252db66c35e80d076f612b63dde331e4129a0f32 100644 (file)
@@ -237,7 +237,7 @@ class UsersController extends AUserData {
                $isAdmin = $this->groupManager->isAdmin($user->getUID());
                $subAdminManager = $this->groupManager->getSubAdmin();
 
-               if(empty($userid) && $this->config->getAppValue('settings', 'newUser.generateUserID', '0') === '1') {
+               if(empty($userid) && $this->config->getAppValue('core', 'newUser.generateUserID', 'no') === 'yes') {
                        $userid = $this->createNewUserId();
                }
 
@@ -293,7 +293,7 @@ class UsersController extends AUserData {
                        $generatePasswordResetToken = true;
                }
 
-               if ($email === '' && $this->config->getAppValue('settings', 'newUser.requireEmail', '0') === '1') {
+               if ($email === '' && $this->config->getAppValue('core', 'newUser.requireEmail', 'no') === 'yes') {
                        throw new OCSException('Required email address was not provided', 110);
                }
 
index eaee0380f7877722eace61e8e2cc2f4cbd2cab5a..63f9d4c376aac73927190a33967f339e7202d24a 100644 (file)
@@ -428,7 +428,7 @@ class UsersControllerTest extends TestCase {
                        ->method('getAppValue')
                        ->willReturnCallback(function($appid, $key, $default) {
                                if($key === 'newUser.generateUserID') {
-                                       return true;
+                                       return 'yes';
                                }
                                return null;
                        });
@@ -483,7 +483,7 @@ class UsersControllerTest extends TestCase {
                        ->method('getAppValue')
                        ->willReturnCallback(function($appid, $key, $default) {
                                if($key === 'newUser.generateUserID') {
-                                       return '1';
+                                       return 'yes';
                                }
                                return null;
                        });
@@ -526,7 +526,7 @@ class UsersControllerTest extends TestCase {
                        ->method('getAppValue')
                        ->willReturnCallback(function($appid, $key, $default) {
                                if($key === 'newUser.requireEmail') {
-                                       return '1';
+                                       return 'yes';
                                }
                                return null;
                        });
index 63d729b282cb9b757c47a984de2abda11624ee31..93cc040de62e25501c98409100d87cb8b1ed7b4e 100644 (file)
@@ -246,8 +246,8 @@ class UsersController extends Controller {
                // Settings
                $serverData['defaultQuota'] = $defaultQuota;
                $serverData['canChangePassword'] = $canChangePassword;
-               $serverData['newUserGenerateUserID'] = $this->config->getAppValue('settings', 'newUser.generateUserID', '0') === '1';
-               $serverData['newUserRequireEmail'] = $this->config->getAppValue('settings', 'newUser.requireEmail', '0') === '1';
+               $serverData['newUserGenerateUserID'] = $this->config->getAppValue('core', 'newUser.generateUserID', 'no') === 'yes';
+               $serverData['newUserRequireEmail'] = $this->config->getAppValue('core', 'newUser.requireEmail', 'no') === 'yes';
 
                return new TemplateResponse('settings', 'settings-vue', ['serverData' => $serverData]);
        }