Merge remote-tracking branch 'origin/support/3.0' into develop

# Conflicts:
#	composer.lock
#	datamodels/2.x/itop-oauth-client/datamodel.itop-oauth-client.xml
#	lib/composer/autoload_files.php
#	lib/composer/autoload_real.php
#	lib/composer/autoload_static.php
#	lib/composer/installed.json
#	lib/composer/installed.php
This commit is contained in:
Eric Espie
2022-07-11 17:24:06 +02:00
48 changed files with 1065 additions and 697 deletions

View File

@@ -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;
}
}

View File

@@ -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 = [])
{

View File

@@ -43,8 +43,7 @@ class OAuthClientProviderFactory
throw new CoreException(Dict::Format('itop-oauth-client:MissingOAuthClient', $sUsername));
}
while ($oOAuthClient = $oSet->Fetch()) {
$sScope = $oOAuthClient->Get('scope');
if ($sScope == 'EMail') {
if ($oOAuthClient->Get('used_for_smtp') == 'yes') {
return $oOAuthClient;
}
}

View File

@@ -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 = [])
{