Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/mail.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2022-07-01 16:10:21 +0300
committerChristoph Wurst <christoph@winzerhof-wurst.at>2022-07-01 17:09:14 +0300
commit78704879b437a93cc3028418cfd65cbee886ee81 (patch)
tree4b1016d6d4122d5a78ef48b56721973d37c6ede8 /lib/Command
parentff28c48255c1247228c777b52a786667f5b4c0b3 (diff)
Add support for XOAUTH2
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/Command')
-rw-r--r--lib/Command/CreateAccount.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Command/CreateAccount.php b/lib/Command/CreateAccount.php
index a1b95a283..fd8a428a3 100644
--- a/lib/Command/CreateAccount.php
+++ b/lib/Command/CreateAccount.php
@@ -36,6 +36,7 @@ class CreateAccount extends Command {
public const ARGUMENT_USER_ID = 'user-id';
public const ARGUMENT_NAME = 'name';
public const ARGUMENT_EMAIL = 'email';
+ public const ARGUMENT_AUTH_METHOD = 'auth-method';
public const ARGUMENT_IMAP_HOST = 'imap-host';
public const ARGUMENT_IMAP_PORT = 'imap-port';
public const ARGUMENT_IMAP_SSL_MODE = 'imap-ssl-mode';
@@ -87,12 +88,15 @@ class CreateAccount extends Command {
$this->addArgument(self::ARGUMENT_SMTP_SSL_MODE, InputArgument::REQUIRED);
$this->addArgument(self::ARGUMENT_SMTP_USER, InputArgument::REQUIRED);
$this->addArgument(self::ARGUMENT_SMTP_PASSWORD, InputArgument::REQUIRED);
+
+ $this->addArgument(self::ARGUMENT_AUTH_METHOD, InputArgument::OPTIONAL, 'password or xoauth2', 'password');
}
protected function execute(InputInterface $input, OutputInterface $output): int {
$userId = $input->getArgument(self::ARGUMENT_USER_ID);
$name = $input->getArgument(self::ARGUMENT_NAME);
$email = $input->getArgument(self::ARGUMENT_EMAIL);
+ $authMethod = $input->getArgument(self::ARGUMENT_AUTH_METHOD);
$imapHost = $input->getArgument(self::ARGUMENT_IMAP_HOST);
$imapPort = $input->getArgument(self::ARGUMENT_IMAP_PORT);
@@ -115,6 +119,7 @@ class CreateAccount extends Command {
$account->setUserId($userId);
$account->setName($name);
$account->setEmail($email);
+ $account->setAuthMethod($authMethod);
$account->setInboundHost($imapHost);
$account->setInboundPort((int) $imapPort);