CoreFiles by mySites.guru
MethodsController.php55 lines, 1,157 bytes, from Joomla_4.2.0-beta1-Beta-Full_Package.zip
Raw History Compare with 4.1.0-beta3
md5
e97aa0ab0029e6320fe28d34232564b7
sha1
9ec9e38fe266bc821f78ad2b969fba0e337e284e
sha256
5320c25b6878db53f6b08b5585c17a29fd41bc65b56cbace39917e82868a845b
<?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\MethodsController as AdminMethodsController;

/**
 * Multi-factor Authentication methods selection and management controller
 *
 * @since 4.2.0
 */
class MethodsController extends AdminMethodsController
{
	/**
	 * 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.