diff options
Diffstat (limited to 'lib/public/User/Events/BeforeUserLoggedInEvent.php')
-rw-r--r-- | lib/public/User/Events/BeforeUserLoggedInEvent.php | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/lib/public/User/Events/BeforeUserLoggedInEvent.php b/lib/public/User/Events/BeforeUserLoggedInEvent.php index a0818bff88f..ca74f926a17 100644 --- a/lib/public/User/Events/BeforeUserLoggedInEvent.php +++ b/lib/public/User/Events/BeforeUserLoggedInEvent.php @@ -24,27 +24,29 @@ declare(strict_types=1); * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ + namespace OCP\User\Events; +use OCP\Authentication\IApacheBackend; use OCP\EventDispatcher\Event; /** * @since 18.0.0 */ class BeforeUserLoggedInEvent extends Event { - /** @var string */ - private $username; - - /** @var string */ - private $password; + private string $username; + private ?string $password; + private ?IApacheBackend $backend; /** * @since 18.0.0 + * @since 26.0.0 password can be null */ - public function __construct(string $username, string $password) { + public function __construct(string $username, ?string $password, ?IApacheBackend $backend = null) { parent::__construct(); $this->username = $username; $this->password = $password; + $this->backend = $backend; } /** @@ -58,8 +60,19 @@ class BeforeUserLoggedInEvent extends Event { /** * @since 18.0.0 + * @since 26.0.0 value can be null */ - public function getPassword(): string { + public function getPassword(): ?string { return $this->password; } + + /** + * return backend if available (or null) + * + * @return IApacheBackend|null + * @since 26.0.0 + */ + public function getBackend(): ?IApacheBackend { + return $this->backend; + } } |