Jelajahi Sumber

Ajout de la collone activé dans la liste des users

François 6 tahun lalu
induk
melakukan
e71d1a2e50

+ 8 - 0
src/AppBundle/Entity/User.php

@@ -190,6 +190,14 @@ class User implements AdvancedUserInterface
         $this->isActive = $activated;
     }
 
+    /**
+     * @return bool
+     */
+    public function getActivated()
+    {
+        return $this->isActive;
+    }
+
     /**
      * @return string
      */

+ 1 - 0
src/AppBundle/Form/UserType.php

@@ -11,6 +11,7 @@ use Symfony\Component\Form\Extension\Core\Type\SubmitType;
 use Symfony\Component\Form\FormBuilderInterface;
 use Symfony\Component\OptionsResolver\OptionsResolver;
 use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
+use Symfony\Component\Security\Core\User\UserInterface;
 
 class UserType extends AbstractType
 {

+ 5 - 1
src/AppBundle/Resources/views/security/liste.html.twig

@@ -16,6 +16,7 @@
             <th>Mail</th>
             <th>Test Mail</th>
             <th>Roles</th>
+            <th>Activé</th>
             <th>Actions</th>
         </tr>
         </thead>
@@ -35,8 +36,11 @@
                 <td>{{ user.mail }}</td>
                 <td><a href="{{ path('admin_sendmailtest', {"id": user.id}) }}">Envoyer un mail test</a></td>
                 <td>{% for role in user.roles %}<p>{{ role }}</p>{% endfor %}</td>
+                <td>{{ user.enabled }}</td>
                 <td>
-                    {%  if user != app.user %}<a href="{{ path('admin_deluser', {'id': user.id})  }}"><i class="fa fa-trash fa-lg" style="color:Tomato;"></i></a>{%  endif %}
+                    {%  if user != app.user %}
+                        <a href="{{ path('admin_deluser', {'id': user.id})  }}"><i class="fa fa-trash fa-lg" style="color:Tomato;"></i></a>
+                    {%  endif %}
                     <a href="{{ path('admin_edituser', {'id': user.id})  }}"><i class="fa fa-edit fa-lg" style="color:DodgerBlue;"></i></a>
                 </td>
             </tr>