|
8 | 8 | namespace OCA\User_SAML\Command; |
9 | 9 |
|
10 | 10 | use OC\Core\Command\Base; |
11 | | -use OCA\User_SAML\Service\GroupMigration; |
12 | 11 | use OCA\User_SAML\UserBackend; |
13 | 12 | use OCP\IUserManager; |
14 | 13 | use Psr\Log\LoggerInterface; |
15 | 14 | use Symfony\Component\Console\Input\InputArgument; |
16 | 15 | use Symfony\Component\Console\Input\InputInterface; |
17 | 16 | use Symfony\Component\Console\Input\InputOption; |
18 | 17 | use Symfony\Component\Console\Output\OutputInterface; |
19 | | -use Throwable; |
20 | 18 |
|
21 | 19 | class UserAdd extends Base { |
22 | 20 | public function __construct( |
@@ -62,26 +60,26 @@ protected function execute(InputInterface $input, OutputInterface $output): int |
62 | 60 | } |
63 | 61 |
|
64 | 62 | try { |
65 | | - $this->backend->createUserIfNotExists($uid); |
| 63 | + $this->backend->createUserIfNotExists($uid); |
66 | 64 | } catch (\Exception $e) { |
67 | 65 | $output->writeln('<error>SAML create user ' . $e->getMessage() . '</error>'); |
68 | 66 | return 1; |
69 | 67 | } |
70 | 68 |
|
71 | 69 | try { |
72 | | - $this->backend->setDisplayName($uid, $input->getOption('display-name')); |
| 70 | + $this->backend->setDisplayName($uid, $input->getOption('display-name')); |
73 | 71 | $email = $input->getOption('email'); |
74 | 72 | if (!empty($email)) { |
75 | | - $user = $this->userManager->get($uid); |
76 | | - $user->setSystemEMailAddress($email); |
| 73 | + $user = $this->userManager->get($uid); |
| 74 | + $user->setSystemEMailAddress($email); |
77 | 75 | } |
78 | 76 | } catch (\Exception $e) { |
79 | 77 | $output->writeln('<error>SAML create user Email and DisplayName ' . $e->getMessage() . '</error>'); |
80 | 78 | return 1; |
81 | 79 | } |
82 | 80 |
|
83 | 81 | if (!$output->isQuiet()) { |
84 | | - $output->writeln('<info>SAML user "' . $uid .'" added.</info>'); |
| 82 | + $output->writeln('<info>SAML user "' . $uid . '" added.</info>'); |
85 | 83 | } |
86 | 84 |
|
87 | 85 | return 0; |
|
0 commit comments