Skip to content

Commit 1e2ac41

Browse files
Minor fixes
1 parent 194554e commit 1e2ac41

File tree

1 file changed

+0
-33
lines changed

1 file changed

+0
-33
lines changed

src/ApiBundle/Controller/Admin/UserController.php

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -311,39 +311,6 @@ private function createDeleteForm(User $user)
311311
;
312312
}
313313

314-
/**
315-
* Fetch all Users.
316-
*
317-
* @Route("/all", name="admin_users_all")
318-
* @Method("GET")
319-
*/
320-
public function cgetAction()
321-
{
322-
//security.yml is configured to allow anonymous access to controllers
323-
//checking for authorization in each controller allows more flexibility
324-
//to change this remove anonymous: true in security.yml on firewall
325-
if (!$this->get('security.authorization_checker')->isGranted('IS_AUTHENTICATED_FULLY')) {
326-
throw $this->createAccessDeniedException();
327-
}
328-
329-
/*$em = $this->getDoctrine()->getEntityManager();
330-
$repository = $em->getRepository("ApiBundle:User");
331-
$users = $repository->findAll();
332-
*/
333-
334-
$repository = $this->getDoctrine()->getRepository("ApiBundle:User");
335-
336-
// createQueryBuilder() automatically selects FROM ApiBundle:User
337-
// and aliases it to "u"
338-
$query = $repository->createQueryBuilder('u')->select('u.username', 'u.email')->getQuery();
339-
340-
$users = $query->getResult();
341-
342-
$this->logMessage(200, 'success', 'Users fetched');
343-
344-
return $this->render('@ApiBundle/Resources/views/default/users.html.twig', ['users' => $users]);
345-
}
346-
347314
private function logMessageAndFlash($code = 200, $type = 'success', $logMsg = '', $flashMsg = '', $locale = 'en')
348315
{
349316
$this->logMessage($code, $type, $logMsg);

0 commit comments

Comments
 (0)