Skip to content

Commit

Permalink
Added UserDeletedEvent
Browse files Browse the repository at this point in the history
Signed-off-by: Malik <3097625+dermalikmann@users.noreply.github.com>
  • Loading branch information
dermalikmann committed May 13, 2024
1 parent 73a224f commit 04f182b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/UserBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
use OCP\User\Backend\IGetHomeBackend;
use OCP\User\Events\UserChangedEvent;
use OCP\User\Events\UserFirstTimeLoggedInEvent;
use OCP\User\Events\UserCreatedEvent;
use OCP\User\Events\UserDeletedEvent;
use OCP\UserInterface;
use Psr\Log\LoggerInterface;

Expand Down Expand Up @@ -184,6 +186,10 @@ public function deleteUser($uid) {
$affected = $qb->delete('user_saml_users')
->where($qb->expr()->eq('uid', $qb->createNamedParameter($uid)))
->executeStatement();

$user = $this->userManager->get($uid);
$this->eventDispatcher->dispatchTyped(new UserDeletedEvent($user));

return $affected > 0;
}

Expand Down

0 comments on commit 04f182b

Please sign in to comment.