aboutsummaryrefslogtreecommitdiffstats
path: root/core/Command/TwoFactorAuth/Disable.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/Command/TwoFactorAuth/Disable.php')
-rw-r--r--core/Command/TwoFactorAuth/Disable.php41
1 files changed, 14 insertions, 27 deletions
diff --git a/core/Command/TwoFactorAuth/Disable.php b/core/Command/TwoFactorAuth/Disable.php
index 54e4b138a0a..c60c1245735 100644
--- a/core/Command/TwoFactorAuth/Disable.php
+++ b/core/Command/TwoFactorAuth/Disable.php
@@ -1,24 +1,9 @@
<?php
+
/**
- * @copyright Copyright (c) 2016, ownCloud, Inc.
- *
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- * @author Joas Schilling <coding@schilljs.com>
- *
- * @license AGPL-3.0
- *
- * This code is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License, version 3,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License, version 3,
- * along with this program. If not, see <http://www.gnu.org/licenses/>
- *
+ * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
+ * SPDX-License-Identifier: AGPL-3.0-only
*/
namespace OC\Core\Command\TwoFactorAuth;
@@ -29,12 +14,14 @@ use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class Disable extends Base {
- private ProviderManager $manager;
-
- public function __construct(ProviderManager $manager, IUserManager $userManager) {
- parent::__construct('twofactorauth:disable');
- $this->manager = $manager;
- $this->userManager = $userManager;
+ public function __construct(
+ private ProviderManager $manager,
+ IUserManager $userManager,
+ ) {
+ parent::__construct(
+ 'twofactorauth:disable',
+ $userManager,
+ );
}
protected function configure() {
@@ -51,14 +38,14 @@ class Disable extends Base {
$providerId = $input->getArgument('provider_id');
$user = $this->userManager->get($uid);
if (is_null($user)) {
- $output->writeln("<error>Invalid UID</error>");
+ $output->writeln('<error>Invalid UID</error>');
return 1;
}
if ($this->manager->tryDisableProviderFor($providerId, $user)) {
$output->writeln("Two-factor provider <options=bold>$providerId</> disabled for user <options=bold>$uid</>.");
return 0;
} else {
- $output->writeln("<error>The provider does not support this operation.</error>");
+ $output->writeln('<error>The provider does not support this operation.</error>');
return 2;
}
}