1
0

PostLoginEvent.php 1.1 KB

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