mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
some finalisation for admin user
This commit is contained in:
@@ -4,6 +4,7 @@ namespace Chill\MainBundle\Controller;
|
||||
|
||||
use Chill\MainBundle\CRUD\Controller\AbstractCRUDController;
|
||||
use Chill\MainBundle\CRUD\Controller\CRUDController;
|
||||
use Chill\MainBundle\Pagination\PaginatorInterface;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Component\Form\FormInterface;
|
||||
@@ -84,26 +85,13 @@ class UserController extends CRUDController
|
||||
parent::onPrePersist($action, $entity, $form, $request);
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds and displays a User entity.
|
||||
*
|
||||
*/
|
||||
public function showAction($id)
|
||||
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$query->addOrderBy('e.usernameCanonical', 'ASC');
|
||||
|
||||
$user = $em->getRepository('ChillMainBundle:User')->find($id);
|
||||
|
||||
if (!$user) {
|
||||
throw $this->createNotFoundException('Unable to find User entity.');
|
||||
}
|
||||
|
||||
return $this->render('@ChillMain/User/show.html.twig', array(
|
||||
'entity' => $user,
|
||||
));
|
||||
return parent::orderQuery($action, $query, $request, $paginator);
|
||||
}
|
||||
|
||||
|
||||
protected function generateTemplateParameter(string $action, $entity, Request $request, array $defaultTemplateParameters = [])
|
||||
{
|
||||
// add mini-forms for edit action
|
||||
|
Reference in New Issue
Block a user