BeforeUserLoggedInWithCookieEvent.php 646 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCP\User\Events;
  8. use OCP\EventDispatcher\Event;
  9. /**
  10. * Emitted before a user is logged in via remember-me cookies.
  11. *
  12. * @since 18.0.0
  13. */
  14. class BeforeUserLoggedInWithCookieEvent extends Event {
  15. /** @var string */
  16. private $username;
  17. /**
  18. * @since 18.0.0
  19. */
  20. public function __construct(string $username) {
  21. parent::__construct();
  22. $this->username = $username;
  23. }
  24. /**
  25. * @since 18.0.0
  26. */
  27. public function getUsername(): string {
  28. return $this->username;
  29. }
  30. }