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