aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public/User/Events
diff options
context:
space:
mode:
Diffstat (limited to 'lib/public/User/Events')
-rw-r--r--lib/public/User/Events/BeforeUserIdUnassignedEvent.php34
-rw-r--r--lib/public/User/Events/OutOfOfficeChangedEvent.php4
-rw-r--r--lib/public/User/Events/OutOfOfficeClearedEvent.php4
-rw-r--r--lib/public/User/Events/OutOfOfficeEndedEvent.php4
-rw-r--r--lib/public/User/Events/OutOfOfficeScheduledEvent.php4
-rw-r--r--lib/public/User/Events/OutOfOfficeStartedEvent.php4
-rw-r--r--lib/public/User/Events/PasswordUpdatedEvent.php7
-rw-r--r--lib/public/User/Events/UserDeletedEvent.php7
-rw-r--r--lib/public/User/Events/UserIdAssignedEvent.php34
-rw-r--r--lib/public/User/Events/UserIdUnassignedEvent.php34
-rw-r--r--lib/public/User/Events/UserLoggedInEvent.php7
11 files changed, 138 insertions, 5 deletions
diff --git a/lib/public/User/Events/BeforeUserIdUnassignedEvent.php b/lib/public/User/Events/BeforeUserIdUnassignedEvent.php
new file mode 100644
index 00000000000..2dee62521aa
--- /dev/null
+++ b/lib/public/User/Events/BeforeUserIdUnassignedEvent.php
@@ -0,0 +1,34 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+namespace OCP\User\Events;
+
+use OCP\EventDispatcher\Event;
+
+/**
+ * Emitted before removing the mapping between an external user and an internal userid
+ * @since 31.0.0
+ */
+class BeforeUserIdUnassignedEvent extends Event {
+ /**
+ * @since 31.0.0
+ */
+ public function __construct(
+ private readonly string $userId,
+ ) {
+ parent::__construct();
+ }
+
+ /**
+ * @since 31.0.0
+ */
+ public function getUserId(): string {
+ return $this->userId;
+ }
+}
diff --git a/lib/public/User/Events/OutOfOfficeChangedEvent.php b/lib/public/User/Events/OutOfOfficeChangedEvent.php
index b1cdb3abdd7..10865ef7ed5 100644
--- a/lib/public/User/Events/OutOfOfficeChangedEvent.php
+++ b/lib/public/User/Events/OutOfOfficeChangedEvent.php
@@ -21,7 +21,9 @@ class OutOfOfficeChangedEvent extends Event {
/**
* @since 28.0.0
*/
- public function __construct(private IOutOfOfficeData $data) {
+ public function __construct(
+ private IOutOfOfficeData $data,
+ ) {
parent::__construct();
}
diff --git a/lib/public/User/Events/OutOfOfficeClearedEvent.php b/lib/public/User/Events/OutOfOfficeClearedEvent.php
index 3eb8a9016e7..4153ce98ab5 100644
--- a/lib/public/User/Events/OutOfOfficeClearedEvent.php
+++ b/lib/public/User/Events/OutOfOfficeClearedEvent.php
@@ -21,7 +21,9 @@ class OutOfOfficeClearedEvent extends Event {
/**
* @since 28.0.0
*/
- public function __construct(private IOutOfOfficeData $data) {
+ public function __construct(
+ private IOutOfOfficeData $data,
+ ) {
parent::__construct();
}
diff --git a/lib/public/User/Events/OutOfOfficeEndedEvent.php b/lib/public/User/Events/OutOfOfficeEndedEvent.php
index e5cbc174d09..0817994f069 100644
--- a/lib/public/User/Events/OutOfOfficeEndedEvent.php
+++ b/lib/public/User/Events/OutOfOfficeEndedEvent.php
@@ -19,7 +19,9 @@ class OutOfOfficeEndedEvent extends Event {
/**
* @since 28.0.0
*/
- public function __construct(private IOutOfOfficeData $data) {
+ public function __construct(
+ private IOutOfOfficeData $data,
+ ) {
parent::__construct();
}
diff --git a/lib/public/User/Events/OutOfOfficeScheduledEvent.php b/lib/public/User/Events/OutOfOfficeScheduledEvent.php
index 0cf071baf59..f830d2af209 100644
--- a/lib/public/User/Events/OutOfOfficeScheduledEvent.php
+++ b/lib/public/User/Events/OutOfOfficeScheduledEvent.php
@@ -21,7 +21,9 @@ class OutOfOfficeScheduledEvent extends Event {
/**
* @since 28.0.0
*/
- public function __construct(private IOutOfOfficeData $data) {
+ public function __construct(
+ private IOutOfOfficeData $data,
+ ) {
parent::__construct();
}
diff --git a/lib/public/User/Events/OutOfOfficeStartedEvent.php b/lib/public/User/Events/OutOfOfficeStartedEvent.php
index 9550f5072e0..1b5c69b3cfb 100644
--- a/lib/public/User/Events/OutOfOfficeStartedEvent.php
+++ b/lib/public/User/Events/OutOfOfficeStartedEvent.php
@@ -19,7 +19,9 @@ class OutOfOfficeStartedEvent extends Event {
/**
* @since 28.0.0
*/
- public function __construct(private IOutOfOfficeData $data) {
+ public function __construct(
+ private IOutOfOfficeData $data,
+ ) {
parent::__construct();
}
diff --git a/lib/public/User/Events/PasswordUpdatedEvent.php b/lib/public/User/Events/PasswordUpdatedEvent.php
index 948b69e54b7..d3fd8f078fe 100644
--- a/lib/public/User/Events/PasswordUpdatedEvent.php
+++ b/lib/public/User/Events/PasswordUpdatedEvent.php
@@ -50,6 +50,13 @@ class PasswordUpdatedEvent extends Event {
}
/**
+ * @since 31.0.0
+ */
+ public function getUid(): string {
+ return $this->user->getUID();
+ }
+
+ /**
* @return string
* @since 18.0.0
*/
diff --git a/lib/public/User/Events/UserDeletedEvent.php b/lib/public/User/Events/UserDeletedEvent.php
index c5b8e11c888..9b74ff96063 100644
--- a/lib/public/User/Events/UserDeletedEvent.php
+++ b/lib/public/User/Events/UserDeletedEvent.php
@@ -34,4 +34,11 @@ class UserDeletedEvent extends Event {
public function getUser(): IUser {
return $this->user;
}
+
+ /**
+ * @since 31.0.0
+ */
+ public function getUid(): string {
+ return $this->user->getUID();
+ }
}
diff --git a/lib/public/User/Events/UserIdAssignedEvent.php b/lib/public/User/Events/UserIdAssignedEvent.php
new file mode 100644
index 00000000000..829bd50c0d0
--- /dev/null
+++ b/lib/public/User/Events/UserIdAssignedEvent.php
@@ -0,0 +1,34 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+namespace OCP\User\Events;
+
+use OCP\EventDispatcher\Event;
+
+/**
+ * Emitted by backends (like user_ldap) when a user created externally is mapped for the first time and assigned a userid
+ * @since 31.0.0
+ */
+class UserIdAssignedEvent extends Event {
+ /**
+ * @since 31.0.0
+ */
+ public function __construct(
+ private readonly string $userId,
+ ) {
+ parent::__construct();
+ }
+
+ /**
+ * @since 31.0.0
+ */
+ public function getUserId(): string {
+ return $this->userId;
+ }
+}
diff --git a/lib/public/User/Events/UserIdUnassignedEvent.php b/lib/public/User/Events/UserIdUnassignedEvent.php
new file mode 100644
index 00000000000..128648a0753
--- /dev/null
+++ b/lib/public/User/Events/UserIdUnassignedEvent.php
@@ -0,0 +1,34 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+namespace OCP\User\Events;
+
+use OCP\EventDispatcher\Event;
+
+/**
+ * Emitted after removing the mapping between an external user and an internal userid
+ * @since 31.0.0
+ */
+class UserIdUnassignedEvent extends Event {
+ /**
+ * @since 31.0.0
+ */
+ public function __construct(
+ private readonly string $userId,
+ ) {
+ parent::__construct();
+ }
+
+ /**
+ * @since 31.0.0
+ */
+ public function getUserId(): string {
+ return $this->userId;
+ }
+}
diff --git a/lib/public/User/Events/UserLoggedInEvent.php b/lib/public/User/Events/UserLoggedInEvent.php
index 61a7b1f79cd..53f61073a59 100644
--- a/lib/public/User/Events/UserLoggedInEvent.php
+++ b/lib/public/User/Events/UserLoggedInEvent.php
@@ -46,6 +46,13 @@ class UserLoggedInEvent extends Event {
}
/**
+ * @since 31.0.0
+ */
+ public function getUid(): string {
+ return $this->user->getUID();
+ }
+
+ /**
* @since 21.0.0
*/
public function getLoginName(): string {