UserLoggedInEvent.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. * @since 18.0.0
  12. */
  13. class UserLoggedInEvent extends Event {
  14. /** @var IUser */
  15. private $user;
  16. /** @var string|null */
  17. private $password;
  18. /** @var bool */
  19. private $isTokenLogin;
  20. /** @var string */
  21. private $loginName;
  22. /**
  23. * @since 18.0.0
  24. */
  25. public function __construct(IUser $user, string $loginName, ?string $password, bool $isTokenLogin) {
  26. parent::__construct();
  27. $this->user = $user;
  28. $this->password = $password;
  29. $this->isTokenLogin = $isTokenLogin;
  30. $this->loginName = $loginName;
  31. }
  32. /**
  33. * @since 18.0.0
  34. */
  35. public function getUser(): IUser {
  36. return $this->user;
  37. }
  38. /**
  39. * @since 21.0.0
  40. */
  41. public function getLoginName(): string {
  42. return $this->loginName;
  43. }
  44. /**
  45. * @since 18.0.0
  46. */
  47. public function getPassword(): ?string {
  48. return $this->password;
  49. }
  50. /**
  51. * @since 18.0.0
  52. */
  53. public function isTokenLogin(): bool {
  54. return $this->isTokenLogin;
  55. }
  56. }