1
0

PostLoginEvent.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. }