aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public/User
diff options
context:
space:
mode:
Diffstat (limited to 'lib/public/User')
-rw-r--r--lib/public/User/Backend/ABackend.php24
-rw-r--r--lib/public/User/Backend/ICheckPasswordBackend.php24
-rw-r--r--lib/public/User/Backend/ICountMappedUsersBackend.php22
-rw-r--r--lib/public/User/Backend/ICountUsersBackend.php25
-rw-r--r--lib/public/User/Backend/ICreateUserBackend.php22
-rw-r--r--lib/public/User/Backend/ICustomLogout.php21
-rw-r--r--lib/public/User/Backend/IGetDisplayNameBackend.php22
-rw-r--r--lib/public/User/Backend/IGetHomeBackend.php22
-rw-r--r--lib/public/User/Backend/IGetRealUIDBackend.php25
-rw-r--r--lib/public/User/Backend/ILimitAwareCountUsersBackend.php23
-rw-r--r--lib/public/User/Backend/IPasswordConfirmationBackend.php22
-rw-r--r--lib/public/User/Backend/IPasswordHashBackend.php30
-rw-r--r--lib/public/User/Backend/IProvideAvatarBackend.php22
-rw-r--r--lib/public/User/Backend/IProvideEnabledStateBackend.php40
-rw-r--r--lib/public/User/Backend/ISearchKnownUsersBackend.php22
-rw-r--r--lib/public/User/Backend/ISetDisplayNameBackend.php25
-rw-r--r--lib/public/User/Backend/ISetPasswordBackend.php22
-rw-r--r--lib/public/User/Events/BeforePasswordUpdatedEvent.php27
-rw-r--r--lib/public/User/Events/BeforeUserCreatedEvent.php25
-rw-r--r--lib/public/User/Events/BeforeUserDeletedEvent.php22
-rw-r--r--lib/public/User/Events/BeforeUserIdUnassignedEvent.php34
-rw-r--r--lib/public/User/Events/BeforeUserLoggedInEvent.php50
-rw-r--r--lib/public/User/Events/BeforeUserLoggedInWithCookieEvent.php23
-rw-r--r--lib/public/User/Events/BeforeUserLoggedOutEvent.php25
-rw-r--r--lib/public/User/Events/OutOfOfficeChangedEvent.php36
-rw-r--r--lib/public/User/Events/OutOfOfficeClearedEvent.php36
-rw-r--r--lib/public/User/Events/OutOfOfficeEndedEvent.php34
-rw-r--r--lib/public/User/Events/OutOfOfficeScheduledEvent.php36
-rw-r--r--lib/public/User/Events/OutOfOfficeStartedEvent.php34
-rw-r--r--lib/public/User/Events/PasswordUpdatedEvent.php34
-rw-r--r--lib/public/User/Events/PostLoginEvent.php24
-rw-r--r--lib/public/User/Events/UserChangedEvent.php37
-rw-r--r--lib/public/User/Events/UserCreatedEvent.php25
-rw-r--r--lib/public/User/Events/UserDeletedEvent.php29
-rw-r--r--lib/public/User/Events/UserFirstTimeLoggedInEvent.php33
-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/UserLiveStatusEvent.php26
-rw-r--r--lib/public/User/Events/UserLoggedInEvent.php30
-rw-r--r--lib/public/User/Events/UserLoggedInWithCookieEvent.php25
-rw-r--r--lib/public/User/Events/UserLoggedOutEvent.php25
-rw-r--r--lib/public/User/GetQuotaEvent.php22
-rw-r--r--lib/public/User/IAvailabilityCoordinator.php51
-rw-r--r--lib/public/User/IOutOfOfficeData.php94
44 files changed, 694 insertions, 624 deletions
diff --git a/lib/public/User/Backend/ABackend.php b/lib/public/User/Backend/ABackend.php
index dff705e0806..2fca83e3be8 100644
--- a/lib/public/User/Backend/ABackend.php
+++ b/lib/public/User/Backend/ABackend.php
@@ -3,26 +3,8 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2018 Roeland Jago Douma <roeland@famdouma.nl>
- *
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- * @author Roeland Jago Douma <roeland@famdouma.nl>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCP\User\Backend;
@@ -34,9 +16,9 @@ use OCP\UserInterface;
* @since 14.0.0
*/
abstract class ABackend implements IUserBackend, UserInterface {
-
/**
* @deprecated 14.0.0
+ * @since 14.0.0
*
* @param int $actions The action to check for
* @return bool
diff --git a/lib/public/User/Backend/ICheckPasswordBackend.php b/lib/public/User/Backend/ICheckPasswordBackend.php
index b3eaf7cedb0..db5d7d08cb5 100644
--- a/lib/public/User/Backend/ICheckPasswordBackend.php
+++ b/lib/public/User/Backend/ICheckPasswordBackend.php
@@ -3,26 +3,8 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2018 Roeland Jago Douma <roeland@famdouma.nl>
- *
- * @author Morris Jobke <hey@morrisjobke.de>
- * @author Roeland Jago Douma <roeland@famdouma.nl>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCP\User\Backend;
@@ -35,7 +17,7 @@ interface ICheckPasswordBackend {
*
* @param string $loginName The loginname
* @param string $password The password
- * @return string|bool The uid on success false on failure
+ * @return string|false The uid on success false on failure
*/
public function checkPassword(string $loginName, string $password);
}
diff --git a/lib/public/User/Backend/ICountMappedUsersBackend.php b/lib/public/User/Backend/ICountMappedUsersBackend.php
new file mode 100644
index 00000000000..39f84f74f4a
--- /dev/null
+++ b/lib/public/User/Backend/ICountMappedUsersBackend.php
@@ -0,0 +1,22 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+namespace OCP\User\Backend;
+
+/**
+ * @since 24.0.7
+ */
+interface ICountMappedUsersBackend {
+ /**
+ * @since 24.0.7
+ *
+ * @return int The number of users already mapped to a Nextcloud account
+ */
+ public function countMappedUsers(): int;
+}
diff --git a/lib/public/User/Backend/ICountUsersBackend.php b/lib/public/User/Backend/ICountUsersBackend.php
index 52f947a654d..194cf465cbe 100644
--- a/lib/public/User/Backend/ICountUsersBackend.php
+++ b/lib/public/User/Backend/ICountUsersBackend.php
@@ -3,37 +3,20 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2018 Roeland Jago Douma <roeland@famdouma.nl>
- *
- * @author Roeland Jago Douma <roeland@famdouma.nl>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCP\User\Backend;
/**
* @since 14.0.0
+ * @deprecated 31.0.0 use and implement ILimitAwareCountUsersBackend instead.
*/
interface ICountUsersBackend {
-
/**
* @since 14.0.0
*
- * @return int|bool The number of users on success false on failure
+ * @return int|false The number of users on success false on failure
*/
public function countUsers();
}
diff --git a/lib/public/User/Backend/ICreateUserBackend.php b/lib/public/User/Backend/ICreateUserBackend.php
index a33cec58010..f273c6d7f8b 100644
--- a/lib/public/User/Backend/ICreateUserBackend.php
+++ b/lib/public/User/Backend/ICreateUserBackend.php
@@ -3,25 +3,8 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2018 Roeland Jago Douma <roeland@famdouma.nl>
- *
- * @author Roeland Jago Douma <roeland@famdouma.nl>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCP\User\Backend;
@@ -29,7 +12,6 @@ namespace OCP\User\Backend;
* @since 14.0.0
*/
interface ICreateUserBackend {
-
/**
* @since 14.0.0
*
diff --git a/lib/public/User/Backend/ICustomLogout.php b/lib/public/User/Backend/ICustomLogout.php
index ec104d5ef42..6d0f03387ce 100644
--- a/lib/public/User/Backend/ICustomLogout.php
+++ b/lib/public/User/Backend/ICustomLogout.php
@@ -3,25 +3,8 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2020, Roeland Jago Douma <roeland@famdouma.nl>
- *
- * @author Roeland Jago Douma <roeland@famdouma.nl>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCP\User\Backend;
diff --git a/lib/public/User/Backend/IGetDisplayNameBackend.php b/lib/public/User/Backend/IGetDisplayNameBackend.php
index 1c3ed287f37..a9c92b8b146 100644
--- a/lib/public/User/Backend/IGetDisplayNameBackend.php
+++ b/lib/public/User/Backend/IGetDisplayNameBackend.php
@@ -3,25 +3,8 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2018 Roeland Jago Douma <roeland@famdouma.nl>
- *
- * @author Roeland Jago Douma <roeland@famdouma.nl>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCP\User\Backend;
@@ -29,7 +12,6 @@ namespace OCP\User\Backend;
* @since 14.0.0
*/
interface IGetDisplayNameBackend {
-
/**
* @since 14.0.0
*
diff --git a/lib/public/User/Backend/IGetHomeBackend.php b/lib/public/User/Backend/IGetHomeBackend.php
index 45ef5b6b215..f280f4c9370 100644
--- a/lib/public/User/Backend/IGetHomeBackend.php
+++ b/lib/public/User/Backend/IGetHomeBackend.php
@@ -3,25 +3,8 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2018 Roeland Jago Douma <roeland@famdouma.nl>
- *
- * @author Roeland Jago Douma <roeland@famdouma.nl>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCP\User\Backend;
@@ -29,7 +12,6 @@ namespace OCP\User\Backend;
* @since 14.0.0
*/
interface IGetHomeBackend {
-
/**
* @since 14.0.0
*
diff --git a/lib/public/User/Backend/IGetRealUIDBackend.php b/lib/public/User/Backend/IGetRealUIDBackend.php
index 5d618b294d9..8041043f7d5 100644
--- a/lib/public/User/Backend/IGetRealUIDBackend.php
+++ b/lib/public/User/Backend/IGetRealUIDBackend.php
@@ -3,26 +3,8 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2019, Roeland Jago Douma <roeland@famdouma.nl>
- *
- * @author Joas Schilling <coding@schilljs.com>
- * @author Roeland Jago Douma <roeland@famdouma.nl>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCP\User\Backend;
@@ -30,13 +12,12 @@ namespace OCP\User\Backend;
* @since 17.0.0
*/
interface IGetRealUIDBackend {
-
/**
* Some backends accept different UIDs than what is the internal UID to be used.
* For example the database backend accepts different cased UIDs in all the functions
* but the internal UID that is to be used should be correctly cased.
*
- * This little function makes sure that the used UID will be correct hen using the user object
+ * This little function makes sure that the used UID will be correct when using the user object
*
* @since 17.0.0
* @param string $uid
diff --git a/lib/public/User/Backend/ILimitAwareCountUsersBackend.php b/lib/public/User/Backend/ILimitAwareCountUsersBackend.php
new file mode 100644
index 00000000000..a59c0bd8e04
--- /dev/null
+++ b/lib/public/User/Backend/ILimitAwareCountUsersBackend.php
@@ -0,0 +1,23 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+namespace OCP\User\Backend;
+
+/**
+ * @since 31.0.0
+ */
+interface ILimitAwareCountUsersBackend extends ICountUsersBackend {
+ /**
+ * @since 31.0.0
+ *
+ * @param int $limit Limit to stop counting users if there are more than $limit. 0 to disable limiting.
+ * @return int|false The number of users (may be limited to $limit) on success false on failure
+ */
+ public function countUsers(int $limit = 0): int|false;
+}
diff --git a/lib/public/User/Backend/IPasswordConfirmationBackend.php b/lib/public/User/Backend/IPasswordConfirmationBackend.php
index 3c6d14c3f1d..856f65ada00 100644
--- a/lib/public/User/Backend/IPasswordConfirmationBackend.php
+++ b/lib/public/User/Backend/IPasswordConfirmationBackend.php
@@ -3,25 +3,8 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2018, Roeland Jago Douma <roeland@famdouma.nl>
- *
- * @author Roeland Jago Douma <roeland@famdouma.nl>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCP\User\Backend;
@@ -29,7 +12,6 @@ namespace OCP\User\Backend;
* @since 15.0.0
*/
interface IPasswordConfirmationBackend {
-
/**
* @since 15.0.0
*/
diff --git a/lib/public/User/Backend/IPasswordHashBackend.php b/lib/public/User/Backend/IPasswordHashBackend.php
new file mode 100644
index 00000000000..2525b4e45ea
--- /dev/null
+++ b/lib/public/User/Backend/IPasswordHashBackend.php
@@ -0,0 +1,30 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+namespace OCP\User\Backend;
+
+use InvalidArgumentException;
+
+/**
+ * @since 30.0.0
+ */
+interface IPasswordHashBackend {
+ /**
+ * @return ?string the password hash hashed by `\OCP\Security\IHasher::hash()`
+ * @since 30.0.0
+ */
+ public function getPasswordHash(string $userId): ?string;
+
+ /**
+ * @param string $passwordHash the password hash hashed by `\OCP\Security\IHasher::hash()`
+ * @throws InvalidArgumentException when `$passwordHash` is not a valid hash
+ * @since 30.0.0
+ */
+ public function setPasswordHash(string $userId, string $passwordHash): bool;
+}
diff --git a/lib/public/User/Backend/IProvideAvatarBackend.php b/lib/public/User/Backend/IProvideAvatarBackend.php
index fe4bb841f72..6a694a4de95 100644
--- a/lib/public/User/Backend/IProvideAvatarBackend.php
+++ b/lib/public/User/Backend/IProvideAvatarBackend.php
@@ -3,25 +3,8 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2018 Roeland Jago Douma <roeland@famdouma.nl>
- *
- * @author Roeland Jago Douma <roeland@famdouma.nl>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCP\User\Backend;
@@ -29,7 +12,6 @@ namespace OCP\User\Backend;
* @since 14.0.0
*/
interface IProvideAvatarBackend {
-
/**
* @since 14.0.0
*
diff --git a/lib/public/User/Backend/IProvideEnabledStateBackend.php b/lib/public/User/Backend/IProvideEnabledStateBackend.php
new file mode 100644
index 00000000000..5dcee366e53
--- /dev/null
+++ b/lib/public/User/Backend/IProvideEnabledStateBackend.php
@@ -0,0 +1,40 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+namespace OCP\User\Backend;
+
+/**
+ * @since 28.0.0
+ */
+interface IProvideEnabledStateBackend {
+ /**
+ * @since 28.0.0
+ *
+ * @param callable():bool $queryDatabaseValue A callable to query the enabled state from database
+ */
+ public function isUserEnabled(string $uid, callable $queryDatabaseValue): bool;
+
+ /**
+ * @since 28.0.0
+ *
+ * @param callable():bool $queryDatabaseValue A callable to query the enabled state from database
+ * @param callable(bool):void $setDatabaseValue A callable to set the enabled state in the database.
+ */
+ public function setUserEnabled(string $uid, bool $enabled, callable $queryDatabaseValue, callable $setDatabaseValue): bool;
+
+ /**
+ * Get the list of disabled users, to merge with the ones disabled in database
+ *
+ * @since 28.0.0
+ * @since 30.0.0 $search parameter added
+ *
+ * @return string[]
+ */
+ public function getDisabledUserList(?int $limit = null, int $offset = 0, string $search = ''): array;
+}
diff --git a/lib/public/User/Backend/ISearchKnownUsersBackend.php b/lib/public/User/Backend/ISearchKnownUsersBackend.php
index 60a147dc62c..4b3eef6005f 100644
--- a/lib/public/User/Backend/ISearchKnownUsersBackend.php
+++ b/lib/public/User/Backend/ISearchKnownUsersBackend.php
@@ -3,25 +3,8 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2021 Joas Schilling <coding@schilljs.com>
- *
- * @author Joas Schilling <coding@schilljs.com>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCP\User\Backend;
@@ -29,7 +12,6 @@ namespace OCP\User\Backend;
* @since 21.0.1
*/
interface ISearchKnownUsersBackend {
-
/**
* @param string $searcher
* @param string $pattern
diff --git a/lib/public/User/Backend/ISetDisplayNameBackend.php b/lib/public/User/Backend/ISetDisplayNameBackend.php
index 922d356bfd7..617f1735021 100644
--- a/lib/public/User/Backend/ISetDisplayNameBackend.php
+++ b/lib/public/User/Backend/ISetDisplayNameBackend.php
@@ -3,25 +3,8 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2018 Roeland Jago Douma <roeland@famdouma.nl>
- *
- * @author Roeland Jago Douma <roeland@famdouma.nl>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCP\User\Backend;
@@ -29,13 +12,15 @@ namespace OCP\User\Backend;
* @since 14.0.0
*/
interface ISetDisplayNameBackend {
-
/**
* @since 14.0.0
*
* @param string $uid The username
* @param string $displayName The new display name
* @return bool
+ *
+ * @since 25.0.0 Throw InvalidArgumentException
+ * @throws \InvalidArgumentException
*/
public function setDisplayName(string $uid, string $displayName): bool;
}
diff --git a/lib/public/User/Backend/ISetPasswordBackend.php b/lib/public/User/Backend/ISetPasswordBackend.php
index 2ba992286ec..571349df58f 100644
--- a/lib/public/User/Backend/ISetPasswordBackend.php
+++ b/lib/public/User/Backend/ISetPasswordBackend.php
@@ -3,25 +3,8 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2018 Roeland Jago Douma <roeland@famdouma.nl>
- *
- * @author Roeland Jago Douma <roeland@famdouma.nl>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCP\User\Backend;
@@ -29,7 +12,6 @@ namespace OCP\User\Backend;
* @since 14.0.0
*/
interface ISetPasswordBackend {
-
/**
* @since 14.0.0
*
diff --git a/lib/public/User/Events/BeforePasswordUpdatedEvent.php b/lib/public/User/Events/BeforePasswordUpdatedEvent.php
index a35659eccf4..489878442b8 100644
--- a/lib/public/User/Events/BeforePasswordUpdatedEvent.php
+++ b/lib/public/User/Events/BeforePasswordUpdatedEvent.php
@@ -3,26 +3,8 @@
declare(strict_types=1);
/**
- * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at>
- *
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- * @author Morris Jobke <hey@morrisjobke.de>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCP\User\Events;
@@ -35,7 +17,6 @@ use OCP\IUser;
* @since 18.0.0
*/
class BeforePasswordUpdatedEvent extends Event {
-
/** @var IUser */
private $user;
@@ -52,8 +33,8 @@ class BeforePasswordUpdatedEvent extends Event {
* @since 18.0.0
*/
public function __construct(IUser $user,
- string $password,
- string $recoveryPassword = null) {
+ string $password,
+ ?string $recoveryPassword = null) {
parent::__construct();
$this->user = $user;
$this->password = $password;
diff --git a/lib/public/User/Events/BeforeUserCreatedEvent.php b/lib/public/User/Events/BeforeUserCreatedEvent.php
index 11575428839..62ee32003ce 100644
--- a/lib/public/User/Events/BeforeUserCreatedEvent.php
+++ b/lib/public/User/Events/BeforeUserCreatedEvent.php
@@ -3,26 +3,8 @@
declare(strict_types=1);
/**
- * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at>
- *
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- * @author Morris Jobke <hey@morrisjobke.de>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCP\User\Events;
@@ -34,7 +16,6 @@ use OCP\EventDispatcher\Event;
* @since 18.0.0
*/
class BeforeUserCreatedEvent extends Event {
-
/** @var string */
private $uid;
@@ -45,7 +26,7 @@ class BeforeUserCreatedEvent extends Event {
* @since 18.0.0
*/
public function __construct(string $uid,
- string $password) {
+ string $password) {
parent::__construct();
$this->uid = $uid;
$this->password = $password;
diff --git a/lib/public/User/Events/BeforeUserDeletedEvent.php b/lib/public/User/Events/BeforeUserDeletedEvent.php
index 511128b5d93..27bc26a125f 100644
--- a/lib/public/User/Events/BeforeUserDeletedEvent.php
+++ b/lib/public/User/Events/BeforeUserDeletedEvent.php
@@ -3,25 +3,8 @@
declare(strict_types=1);
/**
- * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at>
- *
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCP\User\Events;
@@ -32,7 +15,6 @@ use OCP\IUser;
* @since 18.0.0
*/
class BeforeUserDeletedEvent extends Event {
-
/** @var IUser */
private $user;
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/BeforeUserLoggedInEvent.php b/lib/public/User/Events/BeforeUserLoggedInEvent.php
index e39cd0f116d..2c59d57edd7 100644
--- a/lib/public/User/Events/BeforeUserLoggedInEvent.php
+++ b/lib/public/User/Events/BeforeUserLoggedInEvent.php
@@ -3,49 +3,32 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2019, Roeland Jago Douma <roeland@famdouma.nl>
- *
- * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
+
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;
}
/**
@@ -59,8 +42,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;
+ }
}
diff --git a/lib/public/User/Events/BeforeUserLoggedInWithCookieEvent.php b/lib/public/User/Events/BeforeUserLoggedInWithCookieEvent.php
index d86892c52ff..4e76e0aa36f 100644
--- a/lib/public/User/Events/BeforeUserLoggedInWithCookieEvent.php
+++ b/lib/public/User/Events/BeforeUserLoggedInWithCookieEvent.php
@@ -3,26 +3,8 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2019, Roeland Jago Douma <roeland@famdouma.nl>
- *
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- * @author Morris Jobke <hey@morrisjobke.de>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCP\User\Events;
@@ -34,7 +16,6 @@ use OCP\EventDispatcher\Event;
* @since 18.0.0
*/
class BeforeUserLoggedInWithCookieEvent extends Event {
-
/** @var string */
private $username;
diff --git a/lib/public/User/Events/BeforeUserLoggedOutEvent.php b/lib/public/User/Events/BeforeUserLoggedOutEvent.php
index 88a365b0eb8..9b6eb81ab10 100644
--- a/lib/public/User/Events/BeforeUserLoggedOutEvent.php
+++ b/lib/public/User/Events/BeforeUserLoggedOutEvent.php
@@ -3,26 +3,8 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2019, Roeland Jago Douma <roeland@famdouma.nl>
- *
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- * @author Morris Jobke <hey@morrisjobke.de>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCP\User\Events;
@@ -35,14 +17,13 @@ use OCP\IUser;
* @since 18.0.0
*/
class BeforeUserLoggedOutEvent extends Event {
-
/** @var IUser|null */
private $user;
/**
* @since 18.0.0
*/
- public function __construct(IUser $user = null) {
+ public function __construct(?IUser $user = null) {
parent::__construct();
$this->user = $user;
}
diff --git a/lib/public/User/Events/OutOfOfficeChangedEvent.php b/lib/public/User/Events/OutOfOfficeChangedEvent.php
new file mode 100644
index 00000000000..10865ef7ed5
--- /dev/null
+++ b/lib/public/User/Events/OutOfOfficeChangedEvent.php
@@ -0,0 +1,36 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+namespace OCP\User\Events;
+
+use OCP\EventDispatcher\Event;
+use OCP\User\IOutOfOfficeData;
+
+/**
+ * Emitted when a user's out-of-office period has changed
+ *
+ * @since 28.0.0
+ */
+class OutOfOfficeChangedEvent extends Event {
+ /**
+ * @since 28.0.0
+ */
+ public function __construct(
+ private IOutOfOfficeData $data,
+ ) {
+ parent::__construct();
+ }
+
+ /**
+ * @since 28.0.0
+ */
+ public function getData(): IOutOfOfficeData {
+ return $this->data;
+ }
+}
diff --git a/lib/public/User/Events/OutOfOfficeClearedEvent.php b/lib/public/User/Events/OutOfOfficeClearedEvent.php
new file mode 100644
index 00000000000..4153ce98ab5
--- /dev/null
+++ b/lib/public/User/Events/OutOfOfficeClearedEvent.php
@@ -0,0 +1,36 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+namespace OCP\User\Events;
+
+use OCP\EventDispatcher\Event;
+use OCP\User\IOutOfOfficeData;
+
+/**
+ * Emitted when a user's out-of-office period is cleared
+ *
+ * @since 28.0.0
+ */
+class OutOfOfficeClearedEvent extends Event {
+ /**
+ * @since 28.0.0
+ */
+ public function __construct(
+ private IOutOfOfficeData $data,
+ ) {
+ parent::__construct();
+ }
+
+ /**
+ * @since 28.0.0
+ */
+ public function getData(): IOutOfOfficeData {
+ return $this->data;
+ }
+}
diff --git a/lib/public/User/Events/OutOfOfficeEndedEvent.php b/lib/public/User/Events/OutOfOfficeEndedEvent.php
new file mode 100644
index 00000000000..0817994f069
--- /dev/null
+++ b/lib/public/User/Events/OutOfOfficeEndedEvent.php
@@ -0,0 +1,34 @@
+<?php
+
+declare(strict_types=1);
+/**
+ * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+namespace OCP\User\Events;
+
+use OCP\EventDispatcher\Event;
+use OCP\User\IOutOfOfficeData;
+
+/**
+ * Emitted when a user's out-of-office period ended
+ *
+ * @since 28.0.0
+ */
+class OutOfOfficeEndedEvent extends Event {
+ /**
+ * @since 28.0.0
+ */
+ public function __construct(
+ private IOutOfOfficeData $data,
+ ) {
+ parent::__construct();
+ }
+
+ /**
+ * @since 28.0.0
+ */
+ public function getData(): IOutOfOfficeData {
+ return $this->data;
+ }
+}
diff --git a/lib/public/User/Events/OutOfOfficeScheduledEvent.php b/lib/public/User/Events/OutOfOfficeScheduledEvent.php
new file mode 100644
index 00000000000..f830d2af209
--- /dev/null
+++ b/lib/public/User/Events/OutOfOfficeScheduledEvent.php
@@ -0,0 +1,36 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+namespace OCP\User\Events;
+
+use OCP\EventDispatcher\Event;
+use OCP\User\IOutOfOfficeData;
+
+/**
+ * Emitted when a user's out-of-office period is scheduled
+ *
+ * @since 28.0.0
+ */
+class OutOfOfficeScheduledEvent extends Event {
+ /**
+ * @since 28.0.0
+ */
+ public function __construct(
+ private IOutOfOfficeData $data,
+ ) {
+ parent::__construct();
+ }
+
+ /**
+ * @since 28.0.0
+ */
+ public function getData(): IOutOfOfficeData {
+ return $this->data;
+ }
+}
diff --git a/lib/public/User/Events/OutOfOfficeStartedEvent.php b/lib/public/User/Events/OutOfOfficeStartedEvent.php
new file mode 100644
index 00000000000..1b5c69b3cfb
--- /dev/null
+++ b/lib/public/User/Events/OutOfOfficeStartedEvent.php
@@ -0,0 +1,34 @@
+<?php
+
+declare(strict_types=1);
+/**
+ * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+namespace OCP\User\Events;
+
+use OCP\EventDispatcher\Event;
+use OCP\User\IOutOfOfficeData;
+
+/**
+ * Emitted when a user's out-of-office period started
+ *
+ * @since 28.0.0
+ */
+class OutOfOfficeStartedEvent extends Event {
+ /**
+ * @since 28.0.0
+ */
+ public function __construct(
+ private IOutOfOfficeData $data,
+ ) {
+ parent::__construct();
+ }
+
+ /**
+ * @since 28.0.0
+ */
+ public function getData(): IOutOfOfficeData {
+ return $this->data;
+ }
+}
diff --git a/lib/public/User/Events/PasswordUpdatedEvent.php b/lib/public/User/Events/PasswordUpdatedEvent.php
index 335557835c7..d3fd8f078fe 100644
--- a/lib/public/User/Events/PasswordUpdatedEvent.php
+++ b/lib/public/User/Events/PasswordUpdatedEvent.php
@@ -3,26 +3,8 @@
declare(strict_types=1);
/**
- * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at>
- *
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- * @author Morris Jobke <hey@morrisjobke.de>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCP\User\Events;
@@ -35,7 +17,6 @@ use OCP\IUser;
* @since 18.0.0
*/
class PasswordUpdatedEvent extends Event {
-
/** @var IUser */
private $user;
@@ -52,8 +33,8 @@ class PasswordUpdatedEvent extends Event {
* @since 18.0.0
*/
public function __construct(IUser $user,
- string $password,
- string $recoveryPassword = null) {
+ string $password,
+ ?string $recoveryPassword = null) {
parent::__construct();
$this->user = $user;
$this->password = $password;
@@ -69,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/PostLoginEvent.php b/lib/public/User/Events/PostLoginEvent.php
index e481b552e3b..0a552ef755b 100644
--- a/lib/public/User/Events/PostLoginEvent.php
+++ b/lib/public/User/Events/PostLoginEvent.php
@@ -3,27 +3,8 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2019, Roeland Jago Douma <roeland@famdouma.nl>
- *
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- * @author Lionel Elie Mamane <lionel@mamane.lu>
- * @author Roeland Jago Douma <roeland@famdouma.nl>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCP\User\Events;
@@ -34,7 +15,6 @@ use OCP\IUser;
* @since 18.0.0
*/
class PostLoginEvent extends Event {
-
/** @var IUser */
private $user;
diff --git a/lib/public/User/Events/UserChangedEvent.php b/lib/public/User/Events/UserChangedEvent.php
index 3a40f8c3f11..f71fb17fff0 100644
--- a/lib/public/User/Events/UserChangedEvent.php
+++ b/lib/public/User/Events/UserChangedEvent.php
@@ -3,25 +3,8 @@
declare(strict_types=1);
/**
- * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at>
- *
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCP\User\Events;
@@ -32,16 +15,10 @@ use OCP\IUser;
* @since 18.0.0
*/
class UserChangedEvent extends Event {
-
- /** @var IUser */
- private $user;
-
- /** @var string */
- private $feature;
-
+ private IUser $user;
+ private string $feature;
/** @var mixed */
private $value;
-
/** @var mixed */
private $oldValue;
@@ -49,9 +26,9 @@ class UserChangedEvent extends Event {
* @since 18.0.0
*/
public function __construct(IUser $user,
- string $feature,
- $value,
- $oldValue = null) {
+ string $feature,
+ $value,
+ $oldValue = null) {
parent::__construct();
$this->user = $user;
$this->feature = $feature;
diff --git a/lib/public/User/Events/UserCreatedEvent.php b/lib/public/User/Events/UserCreatedEvent.php
index 958d93d56ff..46b990206c0 100644
--- a/lib/public/User/Events/UserCreatedEvent.php
+++ b/lib/public/User/Events/UserCreatedEvent.php
@@ -3,26 +3,8 @@
declare(strict_types=1);
/**
- * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at>
- *
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- * @author Morris Jobke <hey@morrisjobke.de>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCP\User\Events;
@@ -35,7 +17,6 @@ use OCP\IUser;
* @since 18.0.0
*/
class UserCreatedEvent extends Event {
-
/** @var IUser */
private $user;
@@ -46,7 +27,7 @@ class UserCreatedEvent extends Event {
* @since 18.0.0
*/
public function __construct(IUser $user,
- string $password) {
+ string $password) {
parent::__construct();
$this->user = $user;
$this->password = $password;
diff --git a/lib/public/User/Events/UserDeletedEvent.php b/lib/public/User/Events/UserDeletedEvent.php
index 8db7d0f2c74..9b74ff96063 100644
--- a/lib/public/User/Events/UserDeletedEvent.php
+++ b/lib/public/User/Events/UserDeletedEvent.php
@@ -3,25 +3,8 @@
declare(strict_types=1);
/**
- * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at>
- *
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCP\User\Events;
@@ -32,7 +15,6 @@ use OCP\IUser;
* @since 18.0.0
*/
class UserDeletedEvent extends Event {
-
/** @var IUser */
private $user;
@@ -52,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/UserFirstTimeLoggedInEvent.php b/lib/public/User/Events/UserFirstTimeLoggedInEvent.php
new file mode 100644
index 00000000000..08f7aacb1c2
--- /dev/null
+++ b/lib/public/User/Events/UserFirstTimeLoggedInEvent.php
@@ -0,0 +1,33 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+namespace OCP\User\Events;
+
+use OCP\EventDispatcher\Event;
+use OCP\IUser;
+
+/**
+ * @since 28.0.0
+ */
+class UserFirstTimeLoggedInEvent extends Event {
+ /**
+ * @since 28.0.0
+ */
+ public function __construct(
+ private IUser $user,
+ ) {
+ parent::__construct();
+ }
+
+ /**
+ * @since 28.0.0
+ */
+ public function getUser(): IUser {
+ return $this->user;
+ }
+}
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/UserLiveStatusEvent.php b/lib/public/User/Events/UserLiveStatusEvent.php
index 4bba71f95b9..b1f4c9c1d75 100644
--- a/lib/public/User/Events/UserLiveStatusEvent.php
+++ b/lib/public/User/Events/UserLiveStatusEvent.php
@@ -3,25 +3,8 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2020, Georg Ehrke
- *
- * @author Georg Ehrke <oc.list@georgehrke.com>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCP\User\Events;
@@ -33,7 +16,6 @@ use OCP\UserStatus\IUserStatus;
* @since 20.0.0
*/
class UserLiveStatusEvent extends Event {
-
/**
* @var string
* @since 20.0.0
@@ -61,8 +43,8 @@ class UserLiveStatusEvent extends Event {
* @since 20.0.0
*/
public function __construct(IUser $user,
- string $status,
- int $timestamp) {
+ string $status,
+ int $timestamp) {
parent::__construct();
$this->user = $user;
$this->status = $status;
diff --git a/lib/public/User/Events/UserLoggedInEvent.php b/lib/public/User/Events/UserLoggedInEvent.php
index b1a46b9570d..53f61073a59 100644
--- a/lib/public/User/Events/UserLoggedInEvent.php
+++ b/lib/public/User/Events/UserLoggedInEvent.php
@@ -3,26 +3,8 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2019, Roeland Jago Douma <roeland@famdouma.nl>
- *
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- * @author Joas Schilling <coding@schilljs.com>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCP\User\Events;
@@ -33,7 +15,6 @@ use OCP\IUser;
* @since 18.0.0
*/
class UserLoggedInEvent extends Event {
-
/** @var IUser */
private $user;
@@ -65,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 {
diff --git a/lib/public/User/Events/UserLoggedInWithCookieEvent.php b/lib/public/User/Events/UserLoggedInWithCookieEvent.php
index 245c1f434f0..6f9def0df7e 100644
--- a/lib/public/User/Events/UserLoggedInWithCookieEvent.php
+++ b/lib/public/User/Events/UserLoggedInWithCookieEvent.php
@@ -3,26 +3,8 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2019, Roeland Jago Douma <roeland@famdouma.nl>
- *
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- * @author Morris Jobke <hey@morrisjobke.de>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCP\User\Events;
@@ -30,12 +12,11 @@ use OCP\EventDispatcher\Event;
use OCP\IUser;
/**
- * Emitted when a user has been succesfully logged in via remember-me cookies.
+ * Emitted when a user has been successfully logged in via remember-me cookies.
*
* @since 18.0.0
*/
class UserLoggedInWithCookieEvent extends Event {
-
/** @var IUser */
private $user;
diff --git a/lib/public/User/Events/UserLoggedOutEvent.php b/lib/public/User/Events/UserLoggedOutEvent.php
index 3e1472cc6ee..dbdd6d78703 100644
--- a/lib/public/User/Events/UserLoggedOutEvent.php
+++ b/lib/public/User/Events/UserLoggedOutEvent.php
@@ -3,26 +3,8 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2019, Roeland Jago Douma <roeland@famdouma.nl>
- *
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- * @author Morris Jobke <hey@morrisjobke.de>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCP\User\Events;
@@ -35,14 +17,13 @@ use OCP\IUser;
* @since 18.0.0
*/
class UserLoggedOutEvent extends Event {
-
/** @var IUser|null */
private $user;
/**
* @since 18.0.0
*/
- public function __construct(IUser $user = null) {
+ public function __construct(?IUser $user = null) {
parent::__construct();
$this->user = $user;
}
diff --git a/lib/public/User/GetQuotaEvent.php b/lib/public/User/GetQuotaEvent.php
index 369f5762091..c3b6c018fd8 100644
--- a/lib/public/User/GetQuotaEvent.php
+++ b/lib/public/User/GetQuotaEvent.php
@@ -3,26 +3,8 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2020 Robin Appelman <robin@icewind.nl>
- *
- * @author Morris Jobke <hey@morrisjobke.de>
- * @author Robin Appelman <robin@icewind.nl>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCP\User;
diff --git a/lib/public/User/IAvailabilityCoordinator.php b/lib/public/User/IAvailabilityCoordinator.php
new file mode 100644
index 00000000000..69bf7886797
--- /dev/null
+++ b/lib/public/User/IAvailabilityCoordinator.php
@@ -0,0 +1,51 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+namespace OCP\User;
+
+use OCP\IUser;
+
+/**
+ * Coordinator for availability and out-of-office messages
+ *
+ * @since 28.0.0
+ */
+interface IAvailabilityCoordinator {
+ /**
+ * Check if the feature is enabled on this instance
+ *
+ * @return bool
+ *
+ * @since 28.0.0
+ */
+ public function isEnabled(): bool;
+
+ /**
+ * Get the user's out-of-office message, if any
+ *
+ * @since 28.0.0
+ */
+ public function getCurrentOutOfOfficeData(IUser $user): ?IOutOfOfficeData;
+
+ /**
+ * Reset the absence cache to null
+ *
+ * @since 28.0.0
+ */
+ public function clearCache(string $userId): void;
+
+ /**
+ * Is the absence in effect at this moment
+ *
+ * @param IOutOfOfficeData $data
+ * @return bool
+ * @since 28.0.0
+ */
+ public function isInEffect(IOutOfOfficeData $data): bool;
+}
diff --git a/lib/public/User/IOutOfOfficeData.php b/lib/public/User/IOutOfOfficeData.php
new file mode 100644
index 00000000000..e3a4e2773bb
--- /dev/null
+++ b/lib/public/User/IOutOfOfficeData.php
@@ -0,0 +1,94 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+namespace OCP\User;
+
+use JsonSerializable;
+use OCP\IUser;
+
+/**
+ * DTO to hold out-of-office information of a user
+ *
+ * @psalm-type OutOfOfficeData = array{
+ * id: string,
+ * userId: string,
+ * startDate: int,
+ * endDate: int,
+ * shortMessage: string,
+ * message: string,
+ * replacementUserId: ?string,
+ * replacementUserDisplayName: ?string
+ * }
+ *
+ * @since 28.0.0
+ */
+interface IOutOfOfficeData extends JsonSerializable {
+ /**
+ * Get the unique token assigned to the current out-of-office event
+ *
+ * @since 28.0.0
+ */
+ public function getId(): string;
+
+ /**
+ * @since 28.0.0
+ */
+ public function getUser(): IUser;
+
+ /**
+ * Get the accurate out-of-office start date
+ *
+ * This event is not guaranteed to be emitted exactly at start date
+ *
+ * @since 28.0.0
+ */
+ public function getStartDate(): int;
+
+ /**
+ * Get the (preliminary) out-of-office end date
+ *
+ * @since 28.0.0
+ */
+ public function getEndDate(): int;
+
+ /**
+ * Get the short summary text displayed in the user status and similar
+ *
+ * @since 28.0.0
+ */
+ public function getShortMessage(): string;
+
+ /**
+ * Get the long out-of-office message for auto responders and similar
+ *
+ * @since 28.0.0
+ */
+ public function getMessage(): string;
+
+ /**
+ * Get the replacement user id for auto responders and similar
+ *
+ * @since 30.0.0
+ */
+ public function getReplacementUserId(): ?string;
+
+ /**
+ * Get the replacement user displayName for auto responders and similar
+ *
+ * @since 30.0.0
+ */
+ public function getReplacementUserDisplayName(): ?string;
+
+ /**
+ * @return OutOfOfficeData
+ *
+ * @since 28.0.0
+ */
+ public function jsonSerialize(): array;
+}