aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public/Group/Events
diff options
context:
space:
mode:
Diffstat (limited to 'lib/public/Group/Events')
-rw-r--r--lib/public/Group/Events/BeforeGroupChangedEvent.php77
-rw-r--r--lib/public/Group/Events/BeforeGroupCreatedEvent.php35
-rw-r--r--lib/public/Group/Events/BeforeGroupDeletedEvent.php36
-rw-r--r--lib/public/Group/Events/BeforeUserAddedEvent.php49
-rw-r--r--lib/public/Group/Events/BeforeUserRemovedEvent.php56
-rw-r--r--lib/public/Group/Events/GroupChangedEvent.php77
-rw-r--r--lib/public/Group/Events/GroupCreatedEvent.php36
-rw-r--r--lib/public/Group/Events/GroupDeletedEvent.php36
-rw-r--r--lib/public/Group/Events/SubAdminAddedEvent.php47
-rw-r--r--lib/public/Group/Events/SubAdminRemovedEvent.php47
-rw-r--r--lib/public/Group/Events/UserAddedEvent.php49
-rw-r--r--lib/public/Group/Events/UserRemovedEvent.php49
12 files changed, 594 insertions, 0 deletions
diff --git a/lib/public/Group/Events/BeforeGroupChangedEvent.php b/lib/public/Group/Events/BeforeGroupChangedEvent.php
new file mode 100644
index 00000000000..7fb46b8ce6d
--- /dev/null
+++ b/lib/public/Group/Events/BeforeGroupChangedEvent.php
@@ -0,0 +1,77 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+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;
+ }
+}
diff --git a/lib/public/Group/Events/BeforeGroupCreatedEvent.php b/lib/public/Group/Events/BeforeGroupCreatedEvent.php
new file mode 100644
index 00000000000..2f197d6a088
--- /dev/null
+++ b/lib/public/Group/Events/BeforeGroupCreatedEvent.php
@@ -0,0 +1,35 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+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;
+ }
+}
diff --git a/lib/public/Group/Events/BeforeGroupDeletedEvent.php b/lib/public/Group/Events/BeforeGroupDeletedEvent.php
new file mode 100644
index 00000000000..3c8f83440c7
--- /dev/null
+++ b/lib/public/Group/Events/BeforeGroupDeletedEvent.php
@@ -0,0 +1,36 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+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;
+ }
+}
diff --git a/lib/public/Group/Events/BeforeUserAddedEvent.php b/lib/public/Group/Events/BeforeUserAddedEvent.php
new file mode 100644
index 00000000000..09198112539
--- /dev/null
+++ b/lib/public/Group/Events/BeforeUserAddedEvent.php
@@ -0,0 +1,49 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+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;
+ }
+}
diff --git a/lib/public/Group/Events/BeforeUserRemovedEvent.php b/lib/public/Group/Events/BeforeUserRemovedEvent.php
new file mode 100644
index 00000000000..50d34e0c7cf
--- /dev/null
+++ b/lib/public/Group/Events/BeforeUserRemovedEvent.php
@@ -0,0 +1,56 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+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;
+ }
+}
diff --git a/lib/public/Group/Events/GroupChangedEvent.php b/lib/public/Group/Events/GroupChangedEvent.php
new file mode 100644
index 00000000000..c9fd12b8c3a
--- /dev/null
+++ b/lib/public/Group/Events/GroupChangedEvent.php
@@ -0,0 +1,77 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+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;
+ }
+}
diff --git a/lib/public/Group/Events/GroupCreatedEvent.php b/lib/public/Group/Events/GroupCreatedEvent.php
new file mode 100644
index 00000000000..106f57c7154
--- /dev/null
+++ b/lib/public/Group/Events/GroupCreatedEvent.php
@@ -0,0 +1,36 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+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;
+ }
+}
diff --git a/lib/public/Group/Events/GroupDeletedEvent.php b/lib/public/Group/Events/GroupDeletedEvent.php
new file mode 100644
index 00000000000..b651f5cdfa9
--- /dev/null
+++ b/lib/public/Group/Events/GroupDeletedEvent.php
@@ -0,0 +1,36 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+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;
+ }
+}
diff --git a/lib/public/Group/Events/SubAdminAddedEvent.php b/lib/public/Group/Events/SubAdminAddedEvent.php
new file mode 100644
index 00000000000..cb1caebdb77
--- /dev/null
+++ b/lib/public/Group/Events/SubAdminAddedEvent.php
@@ -0,0 +1,47 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+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;
+ }
+}
diff --git a/lib/public/Group/Events/SubAdminRemovedEvent.php b/lib/public/Group/Events/SubAdminRemovedEvent.php
new file mode 100644
index 00000000000..1d76d05cc58
--- /dev/null
+++ b/lib/public/Group/Events/SubAdminRemovedEvent.php
@@ -0,0 +1,47 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+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;
+ }
+}
diff --git a/lib/public/Group/Events/UserAddedEvent.php b/lib/public/Group/Events/UserAddedEvent.php
new file mode 100644
index 00000000000..0c15d2b5c05
--- /dev/null
+++ b/lib/public/Group/Events/UserAddedEvent.php
@@ -0,0 +1,49 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+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;
+ }
+}
diff --git a/lib/public/Group/Events/UserRemovedEvent.php b/lib/public/Group/Events/UserRemovedEvent.php
new file mode 100644
index 00000000000..c1d6bb3cda2
--- /dev/null
+++ b/lib/public/Group/Events/UserRemovedEvent.php
@@ -0,0 +1,49 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+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;
+ }
+}