CoreFiles by mySites.guru
MethodController.php55 lines, 1,127 bytes, from Joomla_4.2.0-beta1-Beta-Full_Package.zip
Raw History Compare with 4.1.0-beta3
md5
a14b6258d4e95547e165726096af87c0
sha1
fa2d3e4328ede1d9bda556564f1592c4f1af7f34
sha256
ee29a1d65607059acff8d4c42b3dc1ed36d730ae84e619d5f746618cfbb19e35
<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  com_users
 *
 * @copyright   (C) 2022 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

namespace Joomla\Component\Users\Site\Controller;

use Joomla\CMS\Router\Route;
use Joomla\Component\Users\Administrator\Controller\MethodController as AdminMethodController;

/**
 * Multi-factor Authentication method controller
 *
 * @since 4.2.0
 */
class MethodController extends AdminMethodController
{
	/**
	 * Execute a task by triggering a Method in the derived class.
	 *
	 * @param   string  $task    The task to perform.
	 *
	 * @return  mixed   The value returned by the called Method.
	 *
	 * @throws  \Exception
	 * @since   4.2.0
	 */
	public function execute($task)
	{
		try
		{
			return parent::execute($task);
		}
		catch (\Exception $e)
		{
			if ($e->getCode() !== 403)
			{
				throw $e;
			}

			if ($this->app->getIdentity()->guest)
			{
				$this->setRedirect(Route::_('index.php?option=com_users&view=login', false));

				return null;
			}
		}

		return null;
	}
}

The same content is in 2 releases, Joomla 4.2.0-beta1 to 4.2.0-beta2. See them all, or every version of this file.