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 Morris Jobke <hey@morrisjobke.de> 10 * 11 * @license GNU AGPL version 3 or any later version 12 * 13 * This program is free software: you can redistribute it and/or modify 14 * it under the terms of the GNU Affero General Public License as 15 * published by the Free Software Foundation, either version 3 of the 16 * License, or (at your option) any later version. 17 * 18 * This program is distributed in the hope that it will be useful, 19 * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 * GNU Affero General Public License for more details. 22 * 23 * You should have received a copy of the GNU Affero General Public License 24 * along with this program. If not, see <http://www.gnu.org/licenses/>. 25 * 26 */ 27namespace OCP\User\Events; 28 29use OCP\EventDispatcher\Event; 30 31/** 32 * Emitted before a user is logged in via remember-me cookies. 33 * 34 * @since 18.0.0 35 */ 36class BeforeUserLoggedInWithCookieEvent extends Event { 37 38 /** @var string */ 39 private $username; 40 41 /** 42 * @since 18.0.0 43 */ 44 public function __construct(string $username) { 45 parent::__construct(); 46 $this->username = $username; 47 } 48 49 /** 50 * @since 18.0.0 51 */ 52 public function getUsername(): string { 53 return $this->username; 54 } 55} 56