N°5102 - Allow to send emails using GSuite SMTP and OAuth - Add a flag to select OAuth client for SMTP usage

This commit is contained in:
Eric Espie
2022-07-07 16:34:19 +02:00
parent c25a4a7346
commit 24d19cd8d6
5 changed files with 98 additions and 18 deletions

View File

@@ -19,10 +19,9 @@ class ApplicationUIExtension extends AbstractApplicationUIExtension
// Possible return values are:
// HILIGHT_CLASS_CRITICAL, HILIGHT_CLASS_WARNING, HILIGHT_CLASS_OK, HILIGHT_CLASS_NONE
$oConfig = utils::GetConfig();
$aScopes = $oObject->Get('scope')->GetValues();
if ($oObject->Get('status') == 'inactive') {
return HILIGHT_CLASS_WARNING;
} elseif (in_array('SMTP', $aScopes) && $oConfig->Get('email_transport_smtp.username') == $oObject->Get('name')) {
} elseif ($oObject->Get('used_for_smtp') == 'yes' && $oConfig->Get('email_transport_smtp.username') == $oObject->Get('name')) {
return HILIGHT_CLASS_OK;
}
}