]> source.dussan.org Git - nextcloud-server.git/commitdiff
cleanup 27474/head
authorArthur Schiwon <blizzz@arthur-schiwon.de>
Tue, 29 Jun 2021 22:38:28 +0000 (00:38 +0200)
committerArthur Schiwon <blizzz@arthur-schiwon.de>
Tue, 29 Jun 2021 23:03:44 +0000 (01:03 +0200)
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
apps/provisioning_api/lib/Controller/UsersController.php
apps/provisioning_api/tests/Controller/UsersControllerTest.php
lib/private/Accounts/AccountManager.php

index b81801aba285af48c6d54d12b2f0f9db447eefae..d94e8fed8a8a9b8576cd2104761e7f89375e7977 100644 (file)
@@ -54,7 +54,6 @@ use OCA\Settings\Mailer\NewUserMailHelper;
 use OCP\Accounts\IAccountManager;
 use OCP\Accounts\IAccountProperty;
 use OCP\Accounts\PropertyDoesNotExistException;
-use OCP\App\IAppManager;
 use OCP\AppFramework\Http;
 use OCP\AppFramework\Http\DataResponse;
 use OCP\AppFramework\OCS\OCSException;
@@ -77,8 +76,6 @@ use Psr\Log\LoggerInterface;
 
 class UsersController extends AUserData {
 
-       /** @var IAppManager */
-       private $appManager;
        /** @var IURLGenerator */
        protected $urlGenerator;
        /** @var LoggerInterface */
@@ -100,7 +97,6 @@ class UsersController extends AUserData {
                                                                IRequest $request,
                                                                IUserManager $userManager,
                                                                IConfig $config,
-                                                               IAppManager $appManager,
                                                                IGroupManager $groupManager,
                                                                IUserSession $userSession,
                                                                IAccountManager $accountManager,
@@ -121,7 +117,6 @@ class UsersController extends AUserData {
                                                        $accountManager,
                                                        $l10nFactory);
 
-               $this->appManager = $appManager;
                $this->urlGenerator = $urlGenerator;
                $this->logger = $logger;
                $this->l10nFactory = $l10nFactory;
@@ -656,7 +651,6 @@ class UsersController extends AUserData {
                                $mailCollection = $userAccount->getPropertyCollection(IAccountManager::COLLECTION_EMAIL);
                                $mailCollection->removePropertyByValue($key);
                                if ($value !== '') {
-                                       // "replace on"
                                        $mailCollection->addPropertyWithDefaults($value);
                                }
                                $this->accountManager->updateAccount($userAccount);
index 6dc0969d103474cf51ae307b3cb06df6e22cacc9..238bac343073581c6ea278436cc351bd56562270 100644 (file)
@@ -50,7 +50,6 @@ use OCA\Settings\Mailer\NewUserMailHelper;
 use OCP\Accounts\IAccount;
 use OCP\Accounts\IAccountManager;
 use OCP\Accounts\IAccountProperty;
-use OCP\App\IAppManager;
 use OCP\AppFramework\Http\DataResponse;
 use OCP\EventDispatcher\IEventDispatcher;
 use OCP\IConfig;
@@ -77,8 +76,6 @@ class UsersControllerTest extends TestCase {
        protected $userManager;
        /** @var IConfig|MockObject */
        protected $config;
-       /** @var IAppManager|MockObject */
-       protected $appManager;
        /** @var Manager|MockObject */
        protected $groupManager;
        /** @var IUserSession|MockObject */
@@ -111,7 +108,6 @@ class UsersControllerTest extends TestCase {
 
                $this->userManager = $this->createMock(IUserManager::class);
                $this->config = $this->createMock(IConfig::class);
-               $this->appManager = $this->createMock(IAppManager::class);
                $this->groupManager = $this->createMock(Manager::class);
                $this->userSession = $this->createMock(IUserSession::class);
                $this->logger = $this->createMock(LoggerInterface::class);
@@ -131,7 +127,6 @@ class UsersControllerTest extends TestCase {
                                $this->request,
                                $this->userManager,
                                $this->config,
-                               $this->appManager,
                                $this->groupManager,
                                $this->userSession,
                                $this->accountManager,
@@ -395,7 +390,6 @@ class UsersControllerTest extends TestCase {
                                $this->request,
                                $this->userManager,
                                $this->config,
-                               $this->appManager,
                                $this->groupManager,
                                $this->userSession,
                                $this->accountManager,
@@ -3440,7 +3434,6 @@ class UsersControllerTest extends TestCase {
                                $this->request,
                                $this->userManager,
                                $this->config,
-                               $this->appManager,
                                $this->groupManager,
                                $this->userSession,
                                $this->accountManager,
@@ -3513,7 +3506,6 @@ class UsersControllerTest extends TestCase {
                                $this->request,
                                $this->userManager,
                                $this->config,
-                               $this->appManager,
                                $this->groupManager,
                                $this->userSession,
                                $this->accountManager,
index b042309dd3ae8be2a00d17b5a86f83186cd1e7c8..9fc5accfa08a4937aafa215d46f1a182f7c37e38 100644 (file)
@@ -228,7 +228,6 @@ class AccountManager implements IAccountManager {
                $updated = true;
 
                if ($oldUserData !== $data) {
-
                        $this->updateExistingUser($user, $data);
                } else {
                        // nothing needs to be done if new and old data set are the same
@@ -297,7 +296,6 @@ class AccountManager implements IAccountManager {
 
                $userDataArray = $this->importFromJson($accountData[0]['data'], $uid);
                if ($userDataArray === null || $userDataArray === []) {
-
                        return $this->buildDefaultUserRecord($user);
                }
 
@@ -339,7 +337,7 @@ class AccountManager implements IAccountManager {
 
        /**
         * check if we need to ask the server for email verification, if yes we create a cronjob
-
+        *
         */
        protected function checkEmailVerification(IAccount $updatedAccount, array $oldData): void {
                try {
@@ -369,14 +367,13 @@ class AccountManager implements IAccountManager {
 
        /**
         * make sure that all expected data are set
-
+        *
         */
        protected function addMissingDefaultValues(array $userData): array {
                foreach ($userData as $i => $value) {
                        if (!isset($value['verified'])) {
                                $userData[$i]['verified'] = self::NOT_VERIFIED;
                        }
-
                }
 
                return $userData;
@@ -612,7 +609,6 @@ class AccountManager implements IAccountManager {
        }
 
        public function updateAccount(IAccount $account): void {
-
                $this->testValueLengths(iterator_to_array($account->getAllProperties()), true);
                try {
                        $property = $account->getProperty(self::PROPERTY_PHONE);
@@ -657,4 +653,4 @@ class AccountManager implements IAccountManager {
 
                $this->updateUser($account->getUser(), $data, true);
        }
-}
\ No newline at end of file
+}