mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-22 10:08:45 +02:00
N°5102 - Allow to send emails using GSuite SMTP and OAuth - Rework
This commit is contained in:
@@ -17,6 +17,8 @@ Dict::Add('EN US', 'English', 'English', [
|
||||
'itop-remote-authent-oauth:UsedForSMTP' => 'This connection is used for SMTP',
|
||||
'itop-remote-authent-oauth:TestSMTP' => 'Email test',
|
||||
'itop-remote-authent-oauth:MissingRemoteAuthentOAuth' => 'Missing Remote Authentication (OAuth) for user name %1$s',
|
||||
'itop-remote-authent-oauth:Message:TokenCreated' => 'Connection token created',
|
||||
'itop-remote-authent-oauth:Message:TokenRecreated' => 'Connection token regenerated',
|
||||
|
||||
'Class:RemoteAuthentOAuthGoogle' => 'Remote Google Authentication (OAuth)',
|
||||
'Class:RemoteAuthentOAuthAzure' => 'Remote Microsoft Azure Authentication (OAuth)',
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
//
|
||||
// File generated by ... on the 2022-06-21T11:44:58+0000
|
||||
// File generated by ... on the 2022-06-21T13:02:44+0000
|
||||
// Please do not edit manually
|
||||
//
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ class AjaxRemoteAuthentOauthController extends Controller
|
||||
$sClass,
|
||||
$sId,
|
||||
"$sClass:$sId:TokenCreated",
|
||||
$bIsCreation ? Dict::S("RemoteAuthentOAuth:Message:TokenCreated") : Dict::S('RemoteAuthentOAuth:Message:TokenRecreated'),
|
||||
$bIsCreation ? Dict::S('itop-remote-authent-oauth:Message:TokenCreated') : Dict::S('itop-remote-authent-oauth:Message:TokenRecreated'),
|
||||
'ok',
|
||||
1,
|
||||
true
|
||||
|
||||
@@ -138,11 +138,12 @@ function CheckEmailSetting($oP)
|
||||
$sDisplayUserName = empty($sUserName) ? '<em>no user</em> ' : $sUserName;
|
||||
try {
|
||||
$oRemoteAuthentOAuth = OAuthClientProviderFactory::GetRemoteAuthentOAuthForSMTP();
|
||||
$sLink = MetaModel::GetHyperLink(get_class($oRemoteAuthentOAuth), $oRemoteAuthentOAuth->GetKey());
|
||||
$oP->info("The connection used is: $sLink");
|
||||
$sProvider = $oRemoteAuthentOAuth->Get('provider');
|
||||
$sDisplayProvider = empty($sProvider) ? '<em>no Provider</em> ' : $sProvider;
|
||||
$sClientID = $oRemoteAuthentOAuth->Get('client_id');
|
||||
$sDisplayClientID = empty($sClientID) ? '<em>no password</em> ' : $sClientID;
|
||||
$oP->info("SMTP configuration (from config-itop.php): host: $sHost, port: $sPort, provider: $sDisplayProvider, user: $sDisplayUserName, client id: $sDisplayClientID, encryption: $sDisplayEncryption.");
|
||||
$oP->info("SMTP configuration (from config-itop.php): host: $sHost, port: $sPort, provider: $sDisplayProvider, user: $sDisplayUserName, encryption: $sDisplayEncryption.");
|
||||
if (($sHost == 'localhost') && ($sPort == '25') && ($sUserName == '') && ($sClientID == '') && ($sProvider == '')) {
|
||||
$oP->warning("The default settings may not be suitable for your environment. You may want to adjust these values by editing iTop's configuration file (".utils::GetConfigFilePathRelative().').');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user