From f40141072a9bf6667fd090a70f1be71b31a3ff8f Mon Sep 17 00:00:00 2001 From: Eric Espie Date: Wed, 6 Jul 2022 14:10:01 +0200 Subject: [PATCH] =?UTF-8?q?N=C2=B05102=20-=20Allow=20to=20send=20emails=20?= =?UTF-8?q?using=20GSuite=20SMTP=20and=20OAuth=20-=20Fix=20errors=20on=20v?= =?UTF-8?q?endor=20name?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OAuth/OAuthClientProviderAbstract.php | 19 ++++++++++--------- .../Client/OAuth/OAuthClientProviderAzure.php | 12 ++---------- .../OAuth/OAuthClientProviderGoogle.php | 12 ++---------- 3 files changed, 14 insertions(+), 29 deletions(-) diff --git a/sources/Core/Authentication/Client/OAuth/OAuthClientProviderAbstract.php b/sources/Core/Authentication/Client/OAuth/OAuthClientProviderAbstract.php index c227ce81a..d4d92c935 100644 --- a/sources/Core/Authentication/Client/OAuth/OAuthClientProviderAbstract.php +++ b/sources/Core/Authentication/Client/OAuth/OAuthClientProviderAbstract.php @@ -8,15 +8,8 @@ use OAuthClient; abstract class OAuthClientProviderAbstract implements IOAuthClientProvider { -// /** @var string */ -// static protected $sVendorName = ''; -// /** @var array */ -// static protected $sVendorColors = ['', '', '', '']; -// /** @var string */ -// static protected $sVendorIcon = ''; -// static protected $sRequiredSMTPScope = ''; -// static protected $sRequiredIMAPScope = ''; -// static protected $sRequiredPOPScope = ''; + /** @var string */ + static protected $sVendorName = ''; /** @var \League\OAuth2\Client\Provider\GenericProvider */ protected $oVendorProvider; @@ -69,4 +62,12 @@ abstract class OAuthClientProviderAbstract implements IOAuthClientProvider return $this->oOauthClient->GetScope(); } + /** + * @return string + */ + public static function GetVendorName() + { + return self::$sVendorName; + } + } \ No newline at end of file diff --git a/sources/Core/Authentication/Client/OAuth/OAuthClientProviderAzure.php b/sources/Core/Authentication/Client/OAuth/OAuthClientProviderAzure.php index e3c594101..667d5875a 100644 --- a/sources/Core/Authentication/Client/OAuth/OAuthClientProviderAzure.php +++ b/sources/Core/Authentication/Client/OAuth/OAuthClientProviderAzure.php @@ -6,16 +6,8 @@ use TheNetworg\OAuth2\Client\Provider\Azure; class OAuthClientProviderAzure extends OAuthClientProviderAbstract { -// /** @var string */ -// static protected $sVendorName = 'Azure'; -// /** @var array */ -// static protected $sVendorColors = ['#0766b7', '#0d396b', '#2893df', '#3ccbf4']; -// /** @var string */ -// static protected $sVendorIcon = '../images/icons/icons8-azure.svg'; -// static protected $sRequiredSMTPScope = 'https://outlook.office.com/SMTP.Send offline_access'; -// static protected $sRequiredIMAPScope = 'https://outlook.office.com/IMAP.AccessAsUser.All offline_access'; -// static protected $sRequiredPOPScope = 'https://outlook.office.com/POP.AccessAsUser.All offline access'; - + /** @var string */ + static protected $sVendorName = 'Azure'; public function __construct($oOAuthClient, array $collaborators = []) { diff --git a/sources/Core/Authentication/Client/OAuth/OAuthClientProviderGoogle.php b/sources/Core/Authentication/Client/OAuth/OAuthClientProviderGoogle.php index 35ddafca8..838a8783e 100644 --- a/sources/Core/Authentication/Client/OAuth/OAuthClientProviderGoogle.php +++ b/sources/Core/Authentication/Client/OAuth/OAuthClientProviderGoogle.php @@ -6,16 +6,8 @@ use League\OAuth2\Client\Provider\Google; class OAuthClientProviderGoogle extends OAuthClientProviderAbstract { -// /** @var string */ -// static protected $sVendorName = 'Google'; -// /** @var array */ -// static protected $sVendorColors = ['#DB4437', '#F4B400', '#0F9D58', '#4285F4']; -// /** @var string */ -// static protected $sVendorIcon = '../images/icons/icons8-google.svg'; -// -// static protected $sRequiredSMTPScope = 'https://mail.google.com/'; -// static protected $sRequiredIMAPScope = 'https://mail.google.com/'; -// static protected $sRequiredPOPScope = 'https://mail.google.com/'; + /** @var string */ + static protected $sVendorName = 'Google'; public function __construct($oOAuthClient, array $collaborators = []) {