CoreFiles by mySites.guru
NotifyActionLog.php57 lines, 1,696 bytes, from Joomla_4.2.0-beta1-Beta-Full_Package.zip
Raw History Compare with 4.1.0-beta3
md5
1fb255ecb9793837bee52486f4961d11
sha1
e6d7229a1909bcc673fe6ae7209bce766a6390c4
sha256
32487d85c60b3da66e60867086c52d0f8e12cb8a00aaef8fb7b3004a3c65d60f
<?php
/**
 * Joomla! Content Management System
 *
 * @copyright  (C) 2022 Open Source Matters, Inc. <https://www.joomla.org>
 * @license    GNU General Public License version 2 or later; see LICENSE
 */

namespace Joomla\CMS\Event\MultiFactor;

\defined('JPATH_PLATFORM') or die;

use Joomla\CMS\Event\AbstractImmutableEvent;

/**
 * Concrete event class for the custom events used to notify the User Action Log plugin about Two
 * Factor Authentication actions.
 *
 * @since 4.2.0
 */
class NotifyActionLog extends AbstractImmutableEvent
{
	private const ACCEPTABLE_EVENTS = [
		'onComUsersCaptiveValidateSuccess',
		'onComUsersViewMethodsAfterDisplay',
		'onComUsersCaptiveShowCaptive',
		'onComUsersCaptiveShowSelect',
		'onComUsersCaptiveValidateFailed',
		'onComUsersCaptiveValidateInvalidMethod',
		'onComUsersCaptiveValidateSuccess',
		'onComUsersControllerMethodAfterRegenerateBackupCodes',
		'onComUsersControllerMethodBeforeAdd',
		'onComUsersControllerMethodBeforeDelete',
		'onComUsersControllerMethodBeforeEdit',
		'onComUsersControllerMethodBeforeSave',
		'onComUsersControllerMethodsBeforeDisable',
		'onComUsersControllerMethodsBeforeDoNotShowThisAgain',
	];

	/**
	 * Public constructor
	 *
	 * @param   string  $name       Event name. Must belong in self::ACCEPTABLE_EVENTS
	 * @param   array   $arguments  Event arguments (different for each event).
	 *
	 * @since   4.2.0
	 */
	public function __construct(string $name, array $arguments = [])
	{
		if (!in_array($name, self::ACCEPTABLE_EVENTS))
		{
			throw new \InvalidArgumentException(sprintf('The %s event class does not support the %s event name.', __CLASS__, $name));
		}

		parent::__construct($name, $arguments);
	}
}

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.