UserLoggedInWithCookieEvent.php 841 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. use OCP\IUser;
  10. /**
  11. * Emitted when a user has been successfully logged in via remember-me cookies.
  12. *
  13. * @since 18.0.0
  14. */
  15. class UserLoggedInWithCookieEvent extends Event {
  16. /** @var IUser */
  17. private $user;
  18. /** @var string|null */
  19. private $password;
  20. /**
  21. * @since 18.0.0
  22. */
  23. public function __construct(IUser $user, ?string $password) {
  24. parent::__construct();
  25. $this->user = $user;
  26. $this->password = $password;
  27. }
  28. /**
  29. * @since 18.0.0
  30. */
  31. public function getUser(): IUser {
  32. return $this->user;
  33. }
  34. /**
  35. * @since 18.0.0
  36. */
  37. public function getPassword(): ?string {
  38. return $this->password;
  39. }
  40. }