[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/src/Event/MultiFactor/ -> NotifyActionLog.php (source)

   1  <?php
   2  
   3  /**
   4   * Joomla! Content Management System
   5   *
   6   * @copyright  (C) 2022 Open Source Matters, Inc. <https://www.joomla.org>
   7   * @license    GNU General Public License version 2 or later; see LICENSE
   8   */
   9  
  10  namespace Joomla\CMS\Event\MultiFactor;
  11  
  12  use Joomla\CMS\Event\AbstractImmutableEvent;
  13  
  14  // phpcs:disable PSR1.Files.SideEffects
  15  \defined('JPATH_PLATFORM') or die;
  16  // phpcs:enable PSR1.Files.SideEffects
  17  
  18  /**
  19   * Concrete event class for the custom events used to notify the User Action Log plugin about Two
  20   * Factor Authentication actions.
  21   *
  22   * @since 4.2.0
  23   */
  24  class NotifyActionLog extends AbstractImmutableEvent
  25  {
  26      private const ACCEPTABLE_EVENTS = [
  27          'onComUsersCaptiveValidateSuccess',
  28          'onComUsersViewMethodsAfterDisplay',
  29          'onComUsersCaptiveShowCaptive',
  30          'onComUsersCaptiveShowSelect',
  31          'onComUsersCaptiveValidateFailed',
  32          'onComUsersCaptiveValidateInvalidMethod',
  33          'onComUsersCaptiveValidateSuccess',
  34          'onComUsersControllerMethodAfterRegenerateBackupCodes',
  35          'onComUsersControllerMethodBeforeAdd',
  36          'onComUsersControllerMethodBeforeDelete',
  37          'onComUsersControllerMethodBeforeEdit',
  38          'onComUsersControllerMethodBeforeSave',
  39          'onComUsersControllerMethodsBeforeDisable',
  40          'onComUsersControllerMethodsBeforeDoNotShowThisAgain',
  41      ];
  42  
  43      /**
  44       * Public constructor
  45       *
  46       * @param   string  $name       Event name. Must belong in self::ACCEPTABLE_EVENTS
  47       * @param   array   $arguments  Event arguments (different for each event).
  48       *
  49       * @since   4.2.0
  50       */
  51      public function __construct(string $name, array $arguments = [])
  52      {
  53          if (!in_array($name, self::ACCEPTABLE_EVENTS)) {
  54              throw new \InvalidArgumentException(sprintf('The %s event class does not support the %s event name.', __CLASS__, $name));
  55          }
  56  
  57          parent::__construct($name, $arguments);
  58      }
  59  }


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer