- md5
- 711069a324ed51115d91cc056facaa10
- sha1
- e763b3395062fd6ff7c643d202d69725abd38210
- sha256
- e43196fcbaa51f040a031dabb506c1bc40b22eaba3102938bd6fc3a1e3f3b7d8
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
<?php
/**
* @package Joomla.Administrator
* @subpackage com_config
*
* @copyright (C) 2026 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\Component\Config\Administrator\Field;
// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects
use Joomla\CMS\Form\FormField;
use Joomla\CMS\Uri\Uri;
/**
* Renders OAuth2 token actions for Global Configuration mail settings.
*
* @since 6.2.0
*/
class Oauth2TokenField extends FormField
{
/**
* The form field type.
*
* @var string
* @since 6.2.0
*/
protected $type = 'Oauth2Token';
/**
* The layout to render.
*
* @var string
* @since 6.2.0
*/
protected $layout = 'joomla.form.field.oauth2token';
/**
* Build the OAuth2 token action UI.
*
* @return string
*
* @since 6.2.0
*/
protected function getInput()
{
$formData = $this->form->getData();
$clientId = (string) $formData->get('smtp_oauth2_client_id');
$refreshToken = (string) $this->getAttribute('refreshToken');
$tokenIssuedAt = (string) $formData->get('smtp_oauth2_token_issued_at');
$data = $this->getLayoutData();
$data['clientId'] = $clientId;
$data['refreshToken'] = strtolower($refreshToken) === 'true';
$data['tokenIssuedAt'] = $tokenIssuedAt;
$data['callbackUrl'] = Uri::base() . 'index.php?option=com_config&task=mail.oauth2callback&format=raw';
$data['issueUrl'] = 'index.php?option=com_config&task=mail.oauth2auth';
$data['checkUrl'] = 'index.php?option=com_config&task=mail.oauth2checktoken';
return $this->getRenderer($this->layout)->render($data);
}
}
No other release has this exact content. See every version of this file.