@Route("/note/item/{id}", name="icap_socialmedia_note_delete", requirements={"id" : "\d+"})
@Method({"DELETE"})
@ParamConverter("user", options={"authenticatedUser" = true})

@param $id
@param User $user

@return JsonResponse
505827
public function deleteWallItemAction($id, User $user)
    {
        $this->getNoteActionManager()->removeNote($id, $user);
        $response = new JsonResponse(true);

        return $response;
    }
843622
public function deleteAction(User $user)
    {
        if ($user === $this->currentUser) {
            $this->addFlashMessage('You can not delete the currently logged in user', 'Current user can\'t be deleted', Message::SEVERITY_WARNING, [], 1412374546);
            $this->redirect('index');
        }
        $this->userService->deleteUser($user);
        $this->addFlashMessage('The user "%s" has been deleted.', 'User deleted', Message::SEVERITY_NOTICE, [htmlspecialchars($user->getName()->getFullName())], 1412374546);
        $this->redirect('index');
    }
62392
public function getPostDeleteUser($id)
    {
        $loggedInUser = $this->userService->getCurrentLoggedInUser();

        if ($loggedInUser === null) {
            $this->response->redirect("user/login");
        }
        if ($loggedInUser !== null && !$loggedInUser->administrator) {
            $this->response->redirect("user/login");
        }

        $title      = "Radera en användare";
        $form       = new DeleteUserForm($this->di, $id);

        $form->check();

        $data = [
            "content" => $form->getHTML(),
        ];

        $this->view->add("default2/article", $data);

        $this->pageRender->renderPage(["title" => $title]);
    }
1252159
public function destroy($id)
    {
        $this->authorize('delete-user-invitations');
        UserInvitation::destroy($id);

        // NOTE : this method trigger method "created" in UserInvitationObserver. Fire also and event to enable hooking.
//        event(new UserInvited($invitation));

        return Response::json(['deleted' => true ]);
    }
582626
function remove($user = null) {
        if($user !== null) {
            $user = $this->client->users->resolve($user);
        }
        
        return (new \React\Promise\Promise(function (callable $resolve, callable $reject) use ($user) {
            $this->client->apimanager()->endpoints->channel
                ->deleteMessageUserReaction($this->message->channel->getId(), $this->message->id, $this->emoji->identifier, ($user !== null ? $user->id : '@me'))
                ->done(function () use ($resolve) {
                    $resolve($this);
                }, $reject);
        }));
    }
624485
public function deleteAction(Request $request, $id)
        {
            /** @var User $oUser */
            $oUser = UserQuery::create()->findOneById($id);

            if (count($oUser) === 0) {
                throw $this->createNotFoundException('Unable to find User entity.');

            }
            $oUser->delete();

            return $this->redirect($this->generateUrl('backend_system_user'));
        }
68792
public function noteAction(Request $request, $resourceId, User $user)
    {
        $text = $request->get('social_media_note_text');
        $jsonResponse = new JsonResponse(true);
        if ($text !== null) {
            $note = new NoteAction();
            $note->setUser($user);
            $note->setText($text);
            $this->getNoteActionManager()->createNote($resourceId, $note);
            $jsonResponse = new JsonResponse(true);
        } else {
            $jsonResponse->setStatusCode(Response::HTTP_BAD_REQUEST);
        }

        return $jsonResponse;
    }
1317854
public function deleteUser(Request $request, $user_id)
    {

        if ($request->user()->id == $user_id)
            return redirect()->back()
                ->with('warning', trans('web::seat.self_delete_warning'));

        $user = $this->getUser($user_id);
        $group = $user->group;

        // Delete the user.
        $user->delete();

        // Ensure the orphan group is cleaned up.
        if ($group->users->isEmpty()) $group->delete();

        return redirect()->back()
            ->with('success', trans('web::seat.user_deleted'));
    }
1287227
public function deleteAction(Request $request, User $loggedUser, Portfolio $portfolio, $type, $portfolioWidgetId)
    {
        $this->checkPortfolioToolAccess($loggedUser, $portfolio);

        /** @var \Icap\PortfolioBundle\Entity\PortfolioWidget $portfolioWidget */
        $portfolioWidget = $this->getDoctrine()->getRepository('IcapPortfolioBundle:PortfolioWidget')->findOneBy([
            'id' => $portfolioWidgetId,
            'widgetType' => $type,
            'portfolio' => $portfolio,
        ]);

        $response = new JsonResponse();

        try {
            $this->getWidgetsManager()->deletePortfolioWidget($portfolioWidget);
            $event = new PortfolioEditEvent($portfolio);
            $this->get('event_dispatcher')->dispatch('log', $event);
        } catch (\Exception $exception) {
            $response->setStatusCode(Response::HTTP_INTERNAL_SERVER_ERROR);
        }

        return $response;
    }
47394
public function delete($id)
    {
        $builder = ModuleRow::withoutGlobalScopes();
        if (auth()->user()->hasRoles('member')) {
            $builder->where(['user_id' => auth()->user()->id]);
        }
        $model = $builder->findOrFail($id);
        $name  = $model->name;
        if ($model->delete()) {
            event('notifications.item_has_been_deleted', ['variables' => ['user' => user(), 'item' => $model]]);
            return redirect_with_message(handles('antares::sample_module/index'), trans('antares/sample_module::messages.item_has_been_deleted', ['name' => $name]), 'success');
        }
        event('notifications.item_has_not_been_deleted', ['variables' => ['user' => user(), 'item' => $model]]);
        return redirect_with_message(handles('antares::sample_module/index'), trans('antares/sample_module::messages.item_has_not_been_deleted', ['name' => $name]), 'error');
    }
1338402
public function delete_user_option(string $id_option, string $id_user = null): ?int
  {
    if ( $id_option = $this->_get_id_option($id_option) ){
      return $this->db->delete($this->class_cfg['table'], [
        $this->fields['id_option'] => $id_option,
        $this->fields['id_user'] => $id_user ?: $this->id_user
      ]);
    }
    return null;
  }
838385
public function destroy(Request $request, $id)
    {
        // Fetch the user object
        //$id = $this->decode($hash);
        $user = $this->userRepository->findById($id);

        // Check to be sure user cannot delete himself
        if (Sentinel::getUser()->id == $user->id) {
            $message = "You cannot remove yourself!";

            if ($request->expectsJson()) {
                return response()->json($message, 422);
            }
            session()->flash('error', $message);
            return redirect()->route('users.index');
        }


        // Remove the user
        $user->delete();

        // All done
        $message = "{$user->email} has been removed.";
        if ($request->expectsJson()) {
            return response()->json([$message], 200);
        }

        session()->flash('success', $message);
        return redirect()->route('users.index');
    }
812947
public function destroy($id)
    {
        $user = UserRepository::find($id);
        $this->checkUser($user);

        $email = $user->getLogin();

        try {
            $user->delete();
        } catch (\Exception $e) {
            return Redirect::route('users.show', ['users' => $id])
                ->with('error', 'We were unable to delete the account.');
        }

        $mail = [
            'url'     => URL::to(Config::get('credentials.home', '/')),
            'email'   => $email,
            'subject' => Config::get('app.name').' - Account Deleted Notification',
        ];

        Mail::queue('credentials::emails.admindeleted', $mail, function ($message) use ($mail) {
            $message->to($mail['email'])->subject($mail['subject']);
        });

        return Redirect::route('users.index')
            ->with('success', 'The user has been deleted successfully.');
    }
646290
public function userDeleteAction(Request $request): Response
    {
        $form = $this->formFactory->deleteUser();

        $form->handleRequest($request);

        if ($form->isSubmitted()) {
            $result = $this->submitHandler->handle($form, function (UserDeleteData $data) {
                $contentInfo = $data->getContentInfo();

                $location = $this->locationService->loadLocation($contentInfo->mainLocationId);

                $user = $this->userService->loadUser($contentInfo->id);

                $this->userService->deleteUser($user);

                $this->notificationHandler->success(
                    $this->translator->trans(
                        /** @Desc("User with login '%login%' deleted.") */
                        'user.delete.success',
                        ['%login%' => $user->login],
                        'content'
                    )
                );

                return new RedirectResponse($this->generateUrl('_ezpublishLocation', [
                    'locationId' => $location->parentLocationId,
                ]));
            });

            if ($result instanceof Response) {
                return $result;
            }
        }

        return $this->redirect($this->generateUrl('ezplatform.dashboard'));
    }
442692
public function itemList($user_id)
    {
        $response = $this->getGuzzleClient()
            ->get('/users/' . $user_id . '/items/search', $this->setQuery());

        return $this->serializer->deserialize(
            $response->getBody()->getContents(),
            ItemList::class,
            'json'
        );
    }
515855
public function actionDelete($id)
    {
        // delete profile and userTokens first to handle foreign key constraint
        $user = $this->findModel($id);
        $profile = $user->profile;
        $userToken = $this->module->model("UserToken");
        $userAuth = $this->module->model("UserAuth");
        $userToken::deleteAll(['user_id' => $user->id]);
        $userAuth::deleteAll(['user_id' => $user->id]);
        $profile->delete();
        $user->delete();

        return $this->redirect(['index']);
    }
880467
public function deleteAction(Request $request, $userId)
    {
        $successorUserId = $request->request->get('successor');

        $userManager = $this->get('phlexible_user.user_manager');

        $successorUser = $userManager->find($successorUserId);
        $user = $userManager->find($userId);

        $userManager->deleteUserWithSuccessor($user, $successorUser);

        $this->get('phlexible_message.message_poster')
            ->post(UsersMessage::create('User "'.$user->getUsername().'" deleted.'));

        return new ResultResponse(true);
    }