Resend the activation email of an existing user.

@param int $id

@return \Illuminate\Http\Response
540826
public function resend($id)
    {
        $user = UserRepository::find($id);
        $this->checkUser($user);

        if ($user->activated) {
            return Redirect::route('account.resend')->withInput()
                ->with('error', 'That user is already activated.');
        }

        $code = $user->getActivationCode();

        $mail = [
            'url'     => URL::to(Config::get('credentials.home', '/')),
            'link'    => URL::route('account.activate', ['id' => $user->id, 'code' => $code]),
            'email'   => $user->getLogin(),
            'subject' => Config::get('app.name').' - Activation',
        ];

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

        return Redirect::route('users.show', ['users' => $id])
            ->with('success', 'The user\'s activation email has been sent successfully.');
    }
1364712
public function deleteAction($id)
    {
        $instance = $this->getManager()->find($id);
        if($instance) {
            $this->getManager()->delete($instance);
            $this->get('session')->getFlashBag()->add('success', 'Instance Redis has been deleted successfully');
        }else {
            $this->get('session')->getFlashBag()->add('error', 'This instance does not exist');
        }
        
        return new RedirectResponse($this->generateUrl('ringo_php_redmon'));
    }
203441
public function actionDelete($id)
    {
        $this->findModel($id)->delete();
        Helper::invalidate();

        return $this->redirect(['index']);
    }
1339360
public function updateAction($id)
    {
        $form = $this->getForm();
        // Get request
        $request = $this->get('request');
        if ('POST' == $request->getMethod()) {
            $form->submit($request);
            
            if ($form->isValid()) {
                // Save instance
                $this->getManager()->create($form->getData());
                $this->get('session')->getFlashBag()->add('success', 'Instance Redis updated successfully');

                return new RedirectResponse($this->generateUrl('ringo_php_redmon'));
            }else {
                $this->get('session')->getFlashBag()->add('error', 'Some errors found');
            }
        }
        
        return $this->render(
            $this->getTemplatePath().'edit.html.twig',
            array(
                'form' => $form->createView(),
                'errors' => $form->getErrors()
            )
        );
    }
557669
public function cancel($id)
    {
        $campagne = $this->campagne->find($id);
        $this->mailjet->deleteCampagne($campagne->api_campagne_id);

        // Update campagne status
        $this->campagne->update(['id' => $campagne->id, 'status' => 'brouillon', 'updated_at' => date('Y-m-d G:i:s'), 'send_at' => null]);

        alert()->success('Envoi de la campagne annulé');

        return redirect('build/newsletter');
    }
1040194
public function handleDelete(int $id = null)
    {
        if ($id === null) {
            if (isset($_GET['template']) === false) {
                return redirect($this->router->generate('users-list-page') . "?m=2");
            } else {
                return 'Redirect: ' . $this->router->generate('users-list-page') . "?m=2";
            }
        } elseif ($id === $this->core->auth()->details->id) {
            if (isset($_GET['template']) === false) {
                return redirect($this->router->generate('users-list-page') . "?m=3");
            } else {
                return 'Redirect: ' . $this->router->generate('users-list-page') . "?m=3";
            }
        }
        $user = $this->core->api('User/' . $id, 'DELETE')->run();
        if ($user['headers'][0][2] === 422) {
            if (isset($_GET['template']) === false) {
                return redirect($this->router->generate('users-list-page') . "?m=2");
            } else {
                return 'Redirect: ' . $this->router->generate('users-list-page') . "?m=2";
            }
        } elseif (($user["headers"][0][2] - 200) * ($user["headers"][0][2] - 299) > 0) {
            if (headers_sent() === false) {
                foreach ($response["headers"] as $header) {
                    header($header[0], $header[1], $header[2]);
                }
            }
            return $this->templates->render("500", [
                "error" => $user['response'],
                "result" => ''
            ]);
        }

        if (isset($_GET['template']) === false) {
            return redirect($this->router->generate('users-list-page') . "?m=1");
        } else {
            return 'Redirect: ' . $this->router->generate('users-list-page') . "?m=1";
        }
    }
159628
public function reviveMessage(int $id): PodiumResponse
    {
        return $this->getPodium()->message->revive($id, $this->ensureMembership());
    }
475671
public function update($id)
    {
        $block = $this->repository->getById($id);
        if (!empty($block)) {
            $this->authorize('update', $block);
            $input = $this->validator->validate('update');
            $block = $this->repository->update($block, $input, auth()->user());
            return $this->respondWithSuccess($block, new BlockTransformer);
        }
        return $this->respondNotFound();
    }
48329
public function actionRnr($id)
    {
        $notification = $this->actionRead($id);
        return $this->redirect(Url::to($notification->getRoute()));
    }
455670
public function destroy($id)
    {
        $this->emails->delete($id);

        alert()->success('Email supprimée de la liste');

        return redirect()->back();
    }
1059444
public function run($id)
    {
        $model = $this->getModel($id);
        
        if ($model->restore()) {
            $this->addSuccessFlash();
        }

        return $this->redirect($model);
    }
1077252
public function actionDelete($id)
    {
        $message = $this->repository->delete($id)
            ? TemplatesModule::t('Removed successfully')
            : TemplatesModule::t('Error: banner not removed');

        Yii::$app->getSession()->setFlash('yii2-email-templates', $message);

        return $this->redirect(['index']);
    }
606225
public function show($id)
    {
        $user = UserRepository::find($id);
        $this->checkUser($user);

        if ($user->activated_at) {
            $activated = html_ago($user->activated_at);
        } else {
            if (Credentials::hasAccess('admin') && Config::get('credentials.activation')) {
                $activated = 'No - <a href="#resend_user" data-toggle="modal" data-target="#resend_user">Resend Email</a>';
            } else {
                $activated = 'Not Activated';
            }
        }

        if (Credentials::getThrottleProvider()->findByUserId($id)->isSuspended()) {
            $suspended = 'Currently Suspended';
        } else {
            $suspended = 'Not Suspended';
        }

        $groups = $user->getGroups();
        if (count($groups) >= 1) {
            $data = [];
            foreach ($groups as $group) {
                $data[] = $group->name;
            }
            $groups = implode(', ', $data);
        } else {
            $groups = 'No Group Memberships';
        }

        return View::make('credentials::users.show', compact('user', 'groups', 'activated', 'suspended'));
    }
1302752
public function deleteAddonAction($id)
    {
        $this->getManager()->deleteById($id, true);

        $view = $this->view();

        return $this->handleView($view);
    }
199679
public function deactivate($id)
    {
        $user = $this->findById($id);
        $user->activated = 0;
        $user->activated_at = null;
        $user->save();
        $this->event->fire('users.deactivate',array($user));
        return true;
    }
1097721
public function activate($id)
    {
        $id = (int) $id;
        if ($id <= 0) {
            throw new Exception('Invalid param id');
        }
        $data = [];
        $data['id'] = $id;
        $data['status'] = 'active';
        return $this->update($data);
    }
568600
public function actionUpdate($id)
    {
        $emailTemplate = $this->loadModel($id);

        if (isset($_POST['EmailTemplate'])) {
            $emailTemplate->attributes = $_POST['EmailTemplate'];
            if ($emailTemplate->save()) {
                $this->redirect(array('template/view', 'id' => $emailTemplate->id));
            }
        }

        $this->render('update', array(
            'emailTemplate' => $emailTemplate,
        ));
    }