Get('scope');
+ if ($this->Get('status') == 'inactive') {
+ $oPage->p(''.Dict::S('itop-oauth-client:Message:MissingToken').'');
+ } elseif (($sScope == 'SMTP' || $sScope == 'EMail') && $oConfig->Get('email_transport_smtp.username') == $this->Get('name')) {
+ $sLabel = Dict::S('itop-oauth-client:UsedForSMTP');
+ $sTestLabel = Dict::S('itop-oauth-client:TestSMTP');
+ $sTestURL = utils::GetAbsoluteUrlAppRoot().'setup/email.test.php';
+ $oPage->p("$sLabel $sTestLabel");
+ }
+ }
+ }
+ ]]>
+
+
+ Get('provider').'.com';
+ }
+ ]]>
+
+ Get('status') == 'active') {
+ return new \League\OAuth2\Client\Token\AccessToken([
+ 'access_token' => $this->Get('token'),
+ 'expires_in' => date_format(new DateTime($this->Get('token_expiration')), 'U') - time(),
+ 'refresh_token' => $this->Get('refresh_token'),
+ 'token_type' => 'Bearer',
+ ]);
+ }
+ return null;
+ }
+ ]]>
+ Set('token', $oAccessToken->getToken());
+ $this->Set('token_expiration', date(AttributeDateTime::GetSQLFormat(), $oAccessToken->getExpires()));
+ if (!empty($oAccessToken->getRefreshToken())) {
+ $this->Set('refresh_token', $oAccessToken->getRefreshToken());
+ }
+ $this->Set('status', 'active');
+ $this->DBUpdate();
+ }
+ ]]>
+ '.Dict::S('UI:OAuth:Wizard:ResultConf:Panel:Description').'
'); - $oConfResultPanel->AddHtml('');
- return $oConfResultPanel;
- }
-
- public static function GetResultDisplayScript($sClientId, $sClientSecret, $sVendor, AccessToken $oAccessToken)
- {
- $sAccessToken = $oAccessToken->getToken();
- $sRefreshToken = $oAccessToken->getRefreshToken();
- $sConf = <<