aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/UserBundle/Controller/ManageController.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/UserBundle/Controller/ManageController.php')
-rw-r--r--src/Wallabag/UserBundle/Controller/ManageController.php48
1 files changed, 24 insertions, 24 deletions
diff --git a/src/Wallabag/UserBundle/Controller/ManageController.php b/src/Wallabag/UserBundle/Controller/ManageController.php
index 084f2c67..f3de656f 100644
--- a/src/Wallabag/UserBundle/Controller/ManageController.php
+++ b/src/Wallabag/UserBundle/Controller/ManageController.php
@@ -7,10 +7,10 @@ use FOS\UserBundle\FOSUserEvents;
7use Pagerfanta\Adapter\DoctrineORMAdapter; 7use Pagerfanta\Adapter\DoctrineORMAdapter;
8use Pagerfanta\Exception\OutOfRangeCurrentPageException; 8use Pagerfanta\Exception\OutOfRangeCurrentPageException;
9use Pagerfanta\Pagerfanta; 9use Pagerfanta\Pagerfanta;
10use Symfony\Component\HttpFoundation\Request;
11use Symfony\Bundle\FrameworkBundle\Controller\Controller;
12use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; 10use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
13use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; 11use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
12use Symfony\Bundle\FrameworkBundle\Controller\Controller;
13use Symfony\Component\HttpFoundation\Request;
14use Wallabag\UserBundle\Entity\User; 14use Wallabag\UserBundle\Entity\User;
15use Wallabag\UserBundle\Form\SearchUserType; 15use Wallabag\UserBundle\Form\SearchUserType;
16 16
@@ -48,13 +48,13 @@ class ManageController extends Controller
48 $this->get('translator')->trans('flashes.user.notice.added', ['%username%' => $user->getUsername()]) 48 $this->get('translator')->trans('flashes.user.notice.added', ['%username%' => $user->getUsername()])
49 ); 49 );
50 50
51 return $this->redirectToRoute('user_edit', array('id' => $user->getId())); 51 return $this->redirectToRoute('user_edit', ['id' => $user->getId()]);
52 } 52 }
53 53
54 return $this->render('WallabagUserBundle:Manage:new.html.twig', array( 54 return $this->render('WallabagUserBundle:Manage:new.html.twig', [
55 'user' => $user, 55 'user' => $user,
56 'form' => $form->createView(), 56 'form' => $form->createView(),
57 )); 57 ]);
58 } 58 }
59 59
60 /** 60 /**
@@ -79,15 +79,15 @@ class ManageController extends Controller
79 $this->get('translator')->trans('flashes.user.notice.updated', ['%username%' => $user->getUsername()]) 79 $this->get('translator')->trans('flashes.user.notice.updated', ['%username%' => $user->getUsername()])
80 ); 80 );
81 81
82 return $this->redirectToRoute('user_edit', array('id' => $user->getId())); 82 return $this->redirectToRoute('user_edit', ['id' => $user->getId()]);
83 } 83 }
84 84
85 return $this->render('WallabagUserBundle:Manage:edit.html.twig', array( 85 return $this->render('WallabagUserBundle:Manage:edit.html.twig', [
86 'user' => $user, 86 'user' => $user,
87 'edit_form' => $editForm->createView(), 87 'edit_form' => $editForm->createView(),
88 'delete_form' => $deleteForm->createView(), 88 'delete_form' => $deleteForm->createView(),
89 'twofactor_auth' => $this->getParameter('twofactor_auth'), 89 'twofactor_auth' => $this->getParameter('twofactor_auth'),
90 )); 90 ]);
91 } 91 }
92 92
93 /** 93 /**
@@ -116,22 +116,6 @@ class ManageController extends Controller
116 } 116 }
117 117
118 /** 118 /**
119 * Creates a form to delete a User entity.
120 *
121 * @param User $user The User entity
122 *
123 * @return \Symfony\Component\Form\Form The form
124 */
125 private function createDeleteForm(User $user)
126 {
127 return $this->createFormBuilder()
128 ->setAction($this->generateUrl('user_delete', array('id' => $user->getId())))
129 ->setMethod('DELETE')
130 ->getForm()
131 ;
132 }
133
134 /**
135 * @param Request $request 119 * @param Request $request
136 * @param int $page 120 * @param int $page
137 * 121 *
@@ -175,4 +159,20 @@ class ManageController extends Controller
175 'users' => $pagerFanta, 159 'users' => $pagerFanta,
176 ]); 160 ]);
177 } 161 }
162
163 /**
164 * Creates a form to delete a User entity.
165 *
166 * @param User $user The User entity
167 *
168 * @return \Symfony\Component\Form\Form The form
169 */
170 private function createDeleteForm(User $user)
171 {
172 return $this->createFormBuilder()
173 ->setAction($this->generateUrl('user_delete', ['id' => $user->getId()]))
174 ->setMethod('DELETE')
175 ->getForm()
176 ;
177 }
178} 178}