migrate therinaldos.com data
Build & Deploy to DigitalOcean Space / build (push) Failing after 2m38s

This commit is contained in:
2024-05-05 15:50:45 -04:00
commit ef1ff240d4
23182 changed files with 3801898 additions and 0 deletions
@@ -0,0 +1,94 @@
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2018 Roeland Jago Douma <roeland@famdouma.nl>
*
* @author Roeland Jago Douma <roeland@famdouma.nl>
* @author Carl Schwan <carl@carlschwan.eu>
*
* @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/>.
*
*/
namespace OCP\Group\Backend;
use OCP\GroupInterface;
/**
* @since 14.0.0
*/
abstract class ABackend implements GroupInterface, IBatchMethodsBackend {
/**
* @deprecated 14.0.0
* @since 14.0.0
*
* @param int $actions The action to check for
* @return bool
*/
public function implementsActions($actions): bool {
$implements = 0;
if ($this instanceof IAddToGroupBackend) {
$implements |= GroupInterface::ADD_TO_GROUP;
}
if ($this instanceof ICountUsersBackend) {
$implements |= GroupInterface::COUNT_USERS;
}
if ($this instanceof ICreateGroupBackend) {
$implements |= GroupInterface::CREATE_GROUP;
}
if ($this instanceof IDeleteGroupBackend) {
$implements |= GroupInterface::DELETE_GROUP;
}
if ($this instanceof IGroupDetailsBackend) {
$implements |= GroupInterface::GROUP_DETAILS;
}
if ($this instanceof IIsAdminBackend) {
$implements |= GroupInterface::IS_ADMIN;
}
if ($this instanceof IRemoveFromGroupBackend) {
$implements |= GroupInterface::REMOVE_FROM_GOUP;
}
return (bool)($actions & $implements);
}
/**
* @since 28.0.0
*/
public function groupsExists(array $gids): array {
return array_values(array_filter(
$gids,
fn (string $gid): bool => $this->groupExists($gid),
));
}
/**
* @since 28.0.0
*/
public function getGroupsDetails(array $gids): array {
if (!($this instanceof IGroupDetailsBackend || $this->implementsActions(GroupInterface::GROUP_DETAILS))) {
throw new \Exception("Should not have been called");
}
/** @var IGroupDetailsBackend $this */
$groupData = [];
foreach ($gids as $gid) {
$groupData[$gid] = $this->getGroupDetails($gid);
}
return $groupData;
}
}
@@ -0,0 +1,36 @@
<?php
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/>.
*
*/
namespace OCP\Group\Backend;
/**
* @since 14.0.0
*/
interface IAddToGroupBackend {
/**
* @since 14.0.0
*/
public function addToGroup(string $uid, string $gid): bool;
}
@@ -0,0 +1,61 @@
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2018 Roeland Jago Douma <roeland@famdouma.nl>
*
* @author Roeland Jago Douma <roeland@famdouma.nl>
* @author Carl Schwan <carl@carlschwan.eu>
* @author Côme Chilliet <come.chilliet@nextcloud.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/>.
*
*/
namespace OCP\Group\Backend;
/**
* @brief Optional interface for group backends
* @since 28.0.0
*/
interface IBatchMethodsBackend {
/**
* @brief Batch method to check if a list of groups exists
*
* The default implementation in ABackend will just call groupExists in
* a loop. But a GroupBackend implementation should provides a more optimized
* override this method to provide a more optimized way to execute this operation.
*
* @param list<string> $gids
* @return list<string> the list of group that exists
* @since 28.0.0
*/
public function groupsExists(array $gids): array;
/**
* @brief Batch method to get the group details of a list of groups
*
* The default implementation in ABackend will just call getGroupDetails in
* a loop. But a GroupBackend implementation should override this method
* to provide a more optimized way to execute this operation.
*
* @throw \RuntimeException if called on a backend that doesn't implements IGroupDetailsBackend
*
* @return array<string, array{displayName?: string}>
* @since 28.0.0
*/
public function getGroupsDetails(array $gids): array;
}
@@ -0,0 +1,36 @@
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2018 John Molakvoæ <skjnldsv@protonmail.com>
*
* @author John Molakvoæ <skjnldsv@protonmail.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/>.
*
*/
namespace OCP\Group\Backend;
/**
* @since 14.0.0
*/
interface ICountDisabledInGroup {
/**
* @since 14.0.0
*/
public function countDisabledInGroup(string $gid): int;
}
@@ -0,0 +1,36 @@
<?php
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/>.
*
*/
namespace OCP\Group\Backend;
/**
* @since 14.0.0
*/
interface ICountUsersBackend {
/**
* @since 14.0.0
*/
public function countUsersInGroup(string $gid, string $search = ''): int;
}
@@ -0,0 +1,36 @@
<?php
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/>.
*
*/
namespace OCP\Group\Backend;
/**
* @since 14.0.0
*/
interface ICreateGroupBackend {
/**
* @since 14.0.0
*/
public function createGroup(string $gid): bool;
}
@@ -0,0 +1,36 @@
<?php
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/>.
*
*/
namespace OCP\Group\Backend;
/**
* @since 14.0.0
*/
interface IDeleteGroupBackend {
/**
* @since 14.0.0
*/
public function deleteGroup(string $gid): bool;
}
@@ -0,0 +1,39 @@
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2019 Arthur Schiwon <blizzz@arthur-schiwon.de>
*
* @author Arthur Schiwon <blizzz@arthur-schiwon.de>
* @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/>.
*
*/
namespace OCP\Group\Backend;
/**
* @since 17.0.0
*/
interface IGetDisplayNameBackend {
/**
* @param string $gid
* @return string
* @since 17.0.0
*/
public function getDisplayName(string $gid): string;
}
@@ -0,0 +1,44 @@
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2018 Roeland Jago Douma <roeland@famdouma.nl>
*
* @author Roeland Jago Douma <roeland@famdouma.nl>
* @author Carl Schwan <carl@carlschwan.eu>
*
* @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/>.
*
*/
namespace OCP\Group\Backend;
/**
* @brief Optional interface for group backends
* @since 14.0.0
*/
interface IGroupDetailsBackend {
/**
* @brief Get additional details for a group, for example the display name.
*
* The array returned can be empty when no additional information is available
* for the group.
*
* @return array{displayName?: string}
* @since 14.0.0
*/
public function getGroupDetails(string $gid): array;
}
@@ -0,0 +1,42 @@
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2019 Robin Appelman <robin@icewind.nl>
*
* @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/>.
*
*/
namespace OCP\Group\Backend;
/**
* @since 16.0.0
*
* Allow the backend to mark groups to be excluded from being shown in search dialogs
*/
interface IHideFromCollaborationBackend {
/**
* Check if a group should be hidden from search dialogs
*
* @param string $groupId
* @return bool
* @since 16.0.0
*/
public function hideGroup(string $groupId): bool;
}
@@ -0,0 +1,36 @@
<?php
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/>.
*
*/
namespace OCP\Group\Backend;
/**
* @since 14.0.0
*/
interface IIsAdminBackend {
/**
* @since 14.0.0
*/
public function isAdmin(string $uid): bool;
}
@@ -0,0 +1,35 @@
<?php
/**
* @copyright Copyright (c) 2021, hosting.de, Johannes Leuker <developers@hosting.de>.
*
* @author Johannes Leuker <j.leuker@hosting.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/>.
*
*/
namespace OCP\Group\Backend;
/**
* @since 22.0.0
*/
interface INamedBackend {
/**
* Backend name to be shown in group management
* @return string the name of the backend to be shown
* @since 22.0.0
*/
public function getBackendName(): string;
}
@@ -0,0 +1,36 @@
<?php
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/>.
*
*/
namespace OCP\Group\Backend;
/**
* @since 14.0.0
*/
interface IRemoveFromGroupBackend {
/**
* @since 14.0.0
*/
public function removeFromGroup(string $uid, string $gid);
}
@@ -0,0 +1,51 @@
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2022 Carl Schwan <carl@carlschwan.eu>
*
* @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/>.
*
*/
namespace OCP\Group\Backend;
use OCP\IUser;
/**
* @since 27.0.0
*/
interface ISearchableGroupBackend {
/**
* @brief Get a list of users matching the given search parameters.
*
* Implementations of this method should return lazy evaluated user objects and
* preload if possible the display name.
*
* <code>
* $users = $groupBackend->searchInGroup('admin', 'John', 10, 0);
* </code>
*
* @param string $gid The group id of the user we want to search
* @param string $search The part of the display name or user id of the users we
* want to search. This can be empty to get all the users.
* @param int $limit The limit of results
* @param int $offset The offset of the results
* @return array<string,IUser> Users indexed by uid
* @since 27.0.0
*/
public function searchInGroup(string $gid, string $search = '', int $limit = -1, int $offset = 0): array;
}
@@ -0,0 +1,39 @@
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2019 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/>.
*
*/
namespace OCP\Group\Backend;
/**
* @since 18.0.0
*/
interface ISetDisplayNameBackend {
/**
* @param string $gid
* @param string $displayName
* @return bool
* @since 18.0.0
*/
public function setDisplayName(string $gid, string $displayName): bool;
}
@@ -0,0 +1,94 @@
<?php
declare(strict_types=1);
/**
* @copyright 2023 Julien Veyssier <julien-nc@posteo.net>
*
* @author Julien Veyssier <julien-nc@posteo.net>
*
* @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/>.
*
*/
namespace OCP\Group\Events;
use OCP\EventDispatcher\Event;
use OCP\IGroup;
/**
* @since 26.0.0
*/
class BeforeGroupChangedEvent extends Event {
private IGroup $group;
private string $feature;
/** @var mixed */
private $value;
/** @var mixed */
private $oldValue;
/**
* @since 26.0.0
*/
public function __construct(IGroup $group,
string $feature,
$value,
$oldValue = null) {
parent::__construct();
$this->group = $group;
$this->feature = $feature;
$this->value = $value;
$this->oldValue = $oldValue;
}
/**
*
* @since 26.0.0
*
* @return IGroup
*/
public function getGroup(): IGroup {
return $this->group;
}
/**
*
* @since 26.0.0
*
* @return string
*/
public function getFeature(): string {
return $this->feature;
}
/**
* @since 26.0.0
*
* @return mixed
*/
public function getValue() {
return $this->value;
}
/**
*
* @since 26.0.0
*
* @return mixed
*/
public function getOldValue() {
return $this->oldValue;
}
}
@@ -0,0 +1,52 @@
<?php
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/>.
*
*/
namespace OCP\Group\Events;
use OCP\EventDispatcher\Event;
/**
* @since 18.0.0
*/
class BeforeGroupCreatedEvent extends Event {
/** @var string */
private $name;
/**
* @since 18.0.0
*/
public function __construct(string $name) {
parent::__construct();
$this->name = $name;
}
/**
* @return string
* @since 18.0.0
*/
public function getName(): string {
return $this->name;
}
}
@@ -0,0 +1,53 @@
<?php
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/>.
*
*/
namespace OCP\Group\Events;
use OCP\EventDispatcher\Event;
use OCP\IGroup;
/**
* @since 18.0.0
*/
class BeforeGroupDeletedEvent extends Event {
/** @var IGroup */
private $group;
/**
* @since 18.0.0
*/
public function __construct(IGroup $group) {
parent::__construct();
$this->group = $group;
}
/**
* @return IGroup
* @since 18.0.0
*/
public function getGroup(): IGroup {
return $this->group;
}
}
@@ -0,0 +1,66 @@
<?php
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/>.
*
*/
namespace OCP\Group\Events;
use OCP\EventDispatcher\Event;
use OCP\IGroup;
use OCP\IUser;
/**
* @since 18.0.0
*/
class BeforeUserAddedEvent extends Event {
/** @var IGroup */
private $group;
/*** @var IUser */
private $user;
/**
* @since 18.0.0
*/
public function __construct(IGroup $group, IUser $user) {
parent::__construct();
$this->group = $group;
$this->user = $user;
}
/**
* @return IGroup
* @since 18.0.0
*/
public function getGroup(): IGroup {
return $this->group;
}
/**
* @return IUser
* @since 18.0.0
*/
public function getUser(): IUser {
return $this->user;
}
}
@@ -0,0 +1,74 @@
<?php
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/>.
*
*/
namespace OCP\Group\Events;
use OCP\EventDispatcher\Event;
use OCP\IGroup;
use OCP\IUser;
/**
* @since 18.0.0
* @deprecated 20.0.0 - it can't be guaranteed that this event is triggered in
* all case (e.g. for LDAP users this isn't possible) - if there is a valid use
* case please reach out in the issue tracker at
* https://github.com/nextcloud/server/issues
*/
class BeforeUserRemovedEvent extends Event {
/** @var IGroup */
private $group;
/*** @var IUser */
private $user;
/**
* @since 18.0.0
* @deprecated 20.0.0
*/
public function __construct(IGroup $group, IUser $user) {
parent::__construct();
$this->group = $group;
$this->user = $user;
}
/**
* @return IGroup
* @since 18.0.0
* @deprecated 20.0.0
*/
public function getGroup(): IGroup {
return $this->group;
}
/**
* @return IUser
* @since 18.0.0
* @deprecated 20.0.0
*/
public function getUser(): IUser {
return $this->user;
}
}
@@ -0,0 +1,94 @@
<?php
declare(strict_types=1);
/**
* @copyright 2022 Anna Larch <anna.larch@gmx.net>
*
* @author Anna Larch <anna.larch@gmx.net>
*
* @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/>.
*
*/
namespace OCP\Group\Events;
use OCP\EventDispatcher\Event;
use OCP\IGroup;
/**
* @since 26.0.0
*/
class GroupChangedEvent extends Event {
private IGroup $group;
private string $feature;
/** @var mixed */
private $value;
/** @var mixed */
private $oldValue;
/**
* @since 26.0.0
*/
public function __construct(IGroup $group,
string $feature,
$value,
$oldValue = null) {
parent::__construct();
$this->group = $group;
$this->feature = $feature;
$this->value = $value;
$this->oldValue = $oldValue;
}
/**
*
* @since 26.0.0
*
* @return IGroup
*/
public function getGroup(): IGroup {
return $this->group;
}
/**
*
* @since 26.0.0
*
* @return string
*/
public function getFeature(): string {
return $this->feature;
}
/**
* @since 26.0.0
*
* @return mixed
*/
public function getValue() {
return $this->value;
}
/**
*
* @since 26.0.0
*
* @return mixed
*/
public function getOldValue() {
return $this->oldValue;
}
}
@@ -0,0 +1,53 @@
<?php
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/>.
*
*/
namespace OCP\Group\Events;
use OCP\EventDispatcher\Event;
use OCP\IGroup;
/**
* @since 18.0.0
*/
class GroupCreatedEvent extends Event {
/** @var IGroup */
private $group;
/**
* @since 18.0.0
*/
public function __construct(IGroup $group) {
parent::__construct();
$this->group = $group;
}
/**
* @return IGroup
* @since 18.0.0
*/
public function getGroup(): IGroup {
return $this->group;
}
}
@@ -0,0 +1,53 @@
<?php
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/>.
*
*/
namespace OCP\Group\Events;
use OCP\EventDispatcher\Event;
use OCP\IGroup;
/**
* @since 18.0.0
*/
class GroupDeletedEvent extends Event {
/** @var IGroup */
private $group;
/**
* @since 18.0.0
*/
public function __construct(IGroup $group) {
parent::__construct();
$this->group = $group;
}
/**
* @return IGroup
* @since 18.0.0
*/
public function getGroup(): IGroup {
return $this->group;
}
}
@@ -0,0 +1,64 @@
<?php
declare(strict_types=1);
/**
* @copyright 2019 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/>.
*
*/
namespace OCP\Group\Events;
use OCP\EventDispatcher\Event;
use OCP\IGroup;
use OCP\IUser;
/**
* @since 21.0.0
*/
class SubAdminAddedEvent extends Event {
/** @var IGroup */
private $group;
/*** @var IUser */
private $user;
/**
* @since 21.0.0
*/
public function __construct(IGroup $group, IUser $user) {
parent::__construct();
$this->group = $group;
$this->user = $user;
}
/**
* @since 21.0.0
*/
public function getGroup(): IGroup {
return $this->group;
}
/**
* @since 21.0.0
*/
public function getUser(): IUser {
return $this->user;
}
}
@@ -0,0 +1,64 @@
<?php
declare(strict_types=1);
/**
* @copyright 2019 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/>.
*
*/
namespace OCP\Group\Events;
use OCP\EventDispatcher\Event;
use OCP\IGroup;
use OCP\IUser;
/**
* @since 21.0.0
*/
class SubAdminRemovedEvent extends Event {
/** @var IGroup */
private $group;
/*** @var IUser */
private $user;
/**
* @since 21.0.0
*/
public function __construct(IGroup $group, IUser $user) {
parent::__construct();
$this->group = $group;
$this->user = $user;
}
/**
* @since 21.0.0
*/
public function getGroup(): IGroup {
return $this->group;
}
/**
* @since 21.0.0
*/
public function getUser(): IUser {
return $this->user;
}
}
@@ -0,0 +1,66 @@
<?php
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/>.
*
*/
namespace OCP\Group\Events;
use OCP\EventDispatcher\Event;
use OCP\IGroup;
use OCP\IUser;
/**
* @since 18.0.0
*/
class UserAddedEvent extends Event {
/** @var IGroup */
private $group;
/*** @var IUser */
private $user;
/**
* @since 18.0.0
*/
public function __construct(IGroup $group, IUser $user) {
parent::__construct();
$this->group = $group;
$this->user = $user;
}
/**
* @return IGroup
* @since 18.0.0
*/
public function getGroup(): IGroup {
return $this->group;
}
/**
* @return IUser
* @since 18.0.0
*/
public function getUser(): IUser {
return $this->user;
}
}
@@ -0,0 +1,66 @@
<?php
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/>.
*
*/
namespace OCP\Group\Events;
use OCP\EventDispatcher\Event;
use OCP\IGroup;
use OCP\IUser;
/**
* @since 18.0.0
*/
class UserRemovedEvent extends Event {
/** @var IGroup */
private $group;
/*** @var IUser */
private $user;
/**
* @since 18.0.0
*/
public function __construct(IGroup $group, IUser $user) {
parent::__construct();
$this->group = $group;
$this->user = $user;
}
/**
* @return IGroup
* @since 18.0.0
*/
public function getGroup(): IGroup {
return $this->group;
}
/**
* @return IUser
* @since 18.0.0
*/
public function getUser(): IUser {
return $this->user;
}
}
@@ -0,0 +1,99 @@
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2019, 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/>.
*
*/
namespace OCP\Group;
use OCP\IGroup;
use OCP\IUser;
/**
* @since 16.0.0
*/
interface ISubAdmin {
/**
* add a SubAdmin
* @param IUser $user user to be SubAdmin
* @param IGroup $group group $user becomes subadmin of
*
* @since 16.0.0
*/
public function createSubAdmin(IUser $user, IGroup $group): void;
/**
* delete a SubAdmin
* @param IUser $user the user that is the SubAdmin
* @param IGroup $group the group
*
* @since 16.0.0
*/
public function deleteSubAdmin(IUser $user, IGroup $group): void;
/**
* get groups of a SubAdmin
* @param IUser $user the SubAdmin
* @return IGroup[]
*
* @since 16.0.0
*/
public function getSubAdminsGroups(IUser $user): array;
/**
* get SubAdmins of a group
* @param IGroup $group the group
* @return IUser[]
*
* @since 16.0.0
*/
public function getGroupsSubAdmins(IGroup $group): array;
/**
* checks if a user is a SubAdmin of a group
* @param IUser $user
* @param IGroup $group
* @return bool
*
* @since 16.0.0
*/
public function isSubAdminOfGroup(IUser $user, IGroup $group): bool;
/**
* checks if a user is a SubAdmin
* @param IUser $user
* @return bool
*
* @since 16.0.0
*/
public function isSubAdmin(IUser $user): bool;
/**
* checks if a user is a accessible by a subadmin
* @param IUser $subadmin
* @param IUser $user
* @return bool
*
* @since 16.0.0
*/
public function isUserAccessible(IUser $subadmin, IUser $user): bool;
}