PostLoginEvent.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * @copyright Copyright (c) 2019, Roeland Jago Douma <roeland@famdouma.nl>
  5. *
  6. * @author Christoph Wurst <christoph@winzerhof-wurst.at>
  7. * @author Lionel Elie Mamane <lionel@mamane.lu>
  8. * @author Roeland Jago Douma <roeland@famdouma.nl>
  9. *
  10. * @license GNU AGPL version 3 or any later version
  11. *
  12. * This program is free software: you can redistribute it and/or modify
  13. * it under the terms of the GNU Affero General Public License as
  14. * published by the Free Software Foundation, either version 3 of the
  15. * License, or (at your option) any later version.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU Affero General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU Affero General Public License
  23. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  24. *
  25. */
  26. namespace OCP\User\Events;
  27. use OCP\EventDispatcher\Event;
  28. use OCP\IUser;
  29. /**
  30. * @since 18.0.0
  31. */
  32. class PostLoginEvent extends Event {
  33. /** @var IUser */
  34. private $user;
  35. /**
  36. * @since 20.0.0
  37. * @var string
  38. */
  39. private $loginName;
  40. /** @var string */
  41. private $password;
  42. /** @var bool */
  43. private $isTokenLogin;
  44. /**
  45. * @since 18.0.0
  46. */
  47. public function __construct(IUser $user, string $loginName, string $password, bool $isTokenLogin) {
  48. parent::__construct();
  49. $this->user = $user;
  50. $this->loginName = $loginName;
  51. $this->password = $password;
  52. $this->isTokenLogin = $isTokenLogin;
  53. }
  54. /**
  55. * @since 18.0.0
  56. */
  57. public function getUser(): IUser {
  58. return $this->user;
  59. }
  60. /**
  61. * @since 20.0.0
  62. */
  63. public function getLoginName(): string {
  64. return $this->loginName;
  65. }
  66. /**
  67. * @since 18.0.0
  68. */
  69. public function getPassword(): string {
  70. return $this->password;
  71. }
  72. /**
  73. * @since 18.0.0
  74. */
  75. public function isTokenLogin(): bool {
  76. return $this->isTokenLogin;
  77. }
  78. }