Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added UserFirstTimeLoggedInEvent #75

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/AutoGroupsManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
namespace OCA\AutoGroups;

use OCP\User\Events\UserCreatedEvent;
use OCP\User\Events\PostLoginEvent;
use OCP\User\Events\UserLoggedInEvent;
use OCP\User\Events\UserFirstTimeLoggedInEvent;
use OCP\Group\Events\UserAddedEvent;
use OCP\Group\Events\UserRemovedEvent;
use OCP\Group\Events\BeforeGroupDeletedEvent;
Expand Down Expand Up @@ -74,6 +75,7 @@ public function __construct(IGroupManager $groupManager, IEventDispatcher $event
// If creation hook is enabled, add user to / remove user from auto groups on creation
if (filter_var($creationHook, FILTER_VALIDATE_BOOLEAN)) {
$eventDispatcher->addListener(UserCreatedEvent::class, $groupAssignmentCallback);
$eventDispatcher->addListener(UserFirstTimeLoggedInEvent::class, $groupAssignmentCallback);
}

// If modification hook is enabled, add user to / remove user from auto groups on every modification of user groups
Expand All @@ -84,7 +86,7 @@ public function __construct(IGroupManager $groupManager, IEventDispatcher $event

// If login hook is enabled, add user to / remove user from auto groups on every successful login
if (filter_var($loginHook, FILTER_VALIDATE_BOOLEAN)) {
$eventDispatcher->addListener(PostLoginEvent::class, $groupAssignmentCallback);
$eventDispatcher->addListener(UserLoggedInEvent::class, $groupAssignmentCallback);
}

// Handle group deletion events
Expand Down
Loading