Browse Source

Modif des rôles

François 6 years ago
parent
commit
28eb1ddf03

+ 40 - 40
.idea/workspace.xml

@@ -53,16 +53,16 @@
       </usages-collector>
       <usages-collector id="statistics.file.extensions.edit">
         <counts>
-          <entry key="php" value="6180" />
+          <entry key="php" value="6296" />
           <entry key="twig" value="1889" />
-          <entry key="yml" value="832" />
+          <entry key="yml" value="837" />
         </counts>
       </usages-collector>
       <usages-collector id="statistics.file.types.edit">
         <counts>
-          <entry key="PHP" value="6180" />
+          <entry key="PHP" value="6296" />
           <entry key="Twig" value="1889" />
-          <entry key="YAML" value="832" />
+          <entry key="YAML" value="837" />
         </counts>
       </usages-collector>
       <usages-collector id="statistics.vcs.git.usages" />
@@ -91,17 +91,17 @@
       <file pinned="false" current-in-tab="false">
         <entry file="file://$PROJECT_DIR$/app/config/security.yml">
           <provider selected="true" editor-type-id="text-editor">
-            <state relative-caret-position="420">
-              <caret line="28" column="27" selection-start-line="28" selection-start-column="27" selection-end-line="28" selection-end-column="27" />
+            <state relative-caret-position="711">
+              <caret line="49" column="20" selection-start-line="49" selection-start-column="20" selection-end-line="49" selection-end-column="20" />
             </state>
           </provider>
         </entry>
       </file>
-      <file pinned="false" current-in-tab="false">
+      <file pinned="false" current-in-tab="true">
         <entry file="file://$PROJECT_DIR$/src/AppBundle/Controller/SecurityController.php">
           <provider selected="true" editor-type-id="text-editor">
-            <state relative-caret-position="459">
-              <caret line="62" column="47" selection-start-line="62" selection-start-column="47" selection-end-line="62" selection-end-column="47" />
+            <state relative-caret-position="189">
+              <caret line="71" column="68" selection-start-line="71" selection-start-column="68" selection-end-line="71" selection-end-column="68" />
               <folding>
                 <element signature="e#40#72#0#PHP" expanded="true" />
                 <element signature="e#708#739#0#PHP" expanded="true" />
@@ -113,11 +113,11 @@
           </provider>
         </entry>
       </file>
-      <file pinned="false" current-in-tab="true">
+      <file pinned="false" current-in-tab="false">
         <entry file="file://$PROJECT_DIR$/src/AppBundle/Form/UserEditType.php">
           <provider selected="true" editor-type-id="text-editor">
-            <state relative-caret-position="390">
-              <caret line="26" column="35" selection-start-line="26" selection-start-column="35" selection-end-line="26" selection-end-column="35" />
+            <state relative-caret-position="222">
+              <caret line="24" column="58" selection-start-line="24" selection-start-column="58" selection-end-line="24" selection-end-column="58" />
               <folding>
                 <element signature="e#34#74#0#PHP" expanded="true" />
               </folding>
@@ -128,7 +128,7 @@
       <file pinned="false" current-in-tab="false">
         <entry file="file://$PROJECT_DIR$/src/AppBundle/Form/UserType.php">
           <provider selected="true" editor-type-id="text-editor">
-            <state relative-caret-position="300">
+            <state relative-caret-position="210">
               <caret line="20" column="26" selection-start-line="20" selection-start-column="26" selection-end-line="20" selection-end-column="26" />
               <folding>
                 <element signature="e#34#74#0#PHP" expanded="true" />
@@ -224,10 +224,10 @@
         <option value="$PROJECT_DIR$/src/AppBundle/Resources/views/security/createuser.html.twig" />
         <option value="$PROJECT_DIR$/src/AppBundle/Form/UserType.php" />
         <option value="$PROJECT_DIR$/src/AppBundle/Entity/User.php" />
-        <option value="$PROJECT_DIR$/app/config/security.yml" />
         <option value="$PROJECT_DIR$/src/AppBundle/Controller/VideothequeController.php" />
-        <option value="$PROJECT_DIR$/src/AppBundle/Controller/SecurityController.php" />
+        <option value="$PROJECT_DIR$/app/config/security.yml" />
         <option value="$PROJECT_DIR$/src/AppBundle/Form/UserEditType.php" />
+        <option value="$PROJECT_DIR$/src/AppBundle/Controller/SecurityController.php" />
       </list>
     </option>
   </component>
@@ -466,12 +466,12 @@
       <workItem from="1539955933558" duration="3651000" />
       <workItem from="1540032947542" duration="34755000" />
       <workItem from="1540146560606" duration="449000" />
-      <workItem from="1540147049047" duration="6214000" />
+      <workItem from="1540147049047" duration="6586000" />
     </task>
     <servers />
   </component>
   <component name="TimeTrackingManager">
-    <option name="totallyTimeSpent" value="45408000" />
+    <option name="totallyTimeSpent" value="45780000" />
   </component>
   <component name="ToolWindowManager">
     <frame x="0" y="27" width="1366" height="741" extended-state="6" />
@@ -490,7 +490,7 @@
       <window_info anchor="bottom" id="Docker" order="7" show_stripe_button="false" />
       <window_info anchor="bottom" id="Database Changes" order="8" show_stripe_button="false" />
       <window_info anchor="bottom" id="Version Control" order="9" show_stripe_button="false" />
-      <window_info anchor="bottom" id="Terminal" order="10" sideWeight="0.4969697" weight="0.3283582" />
+      <window_info anchor="bottom" id="Terminal" order="10" sideWeight="0.4969697" visible="true" weight="0.3283582" />
       <window_info anchor="bottom" id="Event Log" order="11" sideWeight="0.5030303" side_tool="true" weight="0.3283582" />
       <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
       <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
@@ -689,30 +689,26 @@
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/app/config/security.yml">
+    <entry file="file://$PROJECT_DIR$/src/AppBundle/Controller/VideothequeController.php">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="420">
-          <caret line="28" column="27" selection-start-line="28" selection-start-column="27" selection-end-line="28" selection-end-column="27" />
+        <state relative-caret-position="315">
+          <caret line="88" selection-start-line="88" selection-end-line="88" />
+          <folding>
+            <element signature="e#2343#2359#1#PHP" expanded="true" />
+          </folding>
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/src/AppBundle/Controller/SecurityController.php">
+    <entry file="file://$PROJECT_DIR$/app/config/security.yml">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="459">
-          <caret line="62" column="47" selection-start-line="62" selection-start-column="47" selection-end-line="62" selection-end-column="47" />
-          <folding>
-            <element signature="e#40#72#0#PHP" expanded="true" />
-            <element signature="e#708#739#0#PHP" expanded="true" />
-            <element signature="e#1637#1673#0#PHP" expanded="true" />
-            <element signature="e#2108#2124#1#PHP" expanded="true" />
-            <element signature="e#2658#2694#0#PHP" expanded="true" />
-          </folding>
+        <state relative-caret-position="711">
+          <caret line="49" column="20" selection-start-line="49" selection-start-column="20" selection-end-line="49" selection-end-column="20" />
         </state>
       </provider>
     </entry>
     <entry file="file://$PROJECT_DIR$/src/AppBundle/Form/UserType.php">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="300">
+        <state relative-caret-position="210">
           <caret line="20" column="26" selection-start-line="20" selection-start-column="26" selection-end-line="20" selection-end-column="26" />
           <folding>
             <element signature="e#34#74#0#PHP" expanded="true" />
@@ -720,22 +716,26 @@
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/src/AppBundle/Controller/VideothequeController.php">
+    <entry file="file://$PROJECT_DIR$/src/AppBundle/Form/UserEditType.php">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="315">
-          <caret line="88" selection-start-line="88" selection-end-line="88" />
+        <state relative-caret-position="222">
+          <caret line="24" column="58" selection-start-line="24" selection-start-column="58" selection-end-line="24" selection-end-column="58" />
           <folding>
-            <element signature="e#2343#2359#1#PHP" expanded="true" />
+            <element signature="e#34#74#0#PHP" expanded="true" />
           </folding>
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/src/AppBundle/Form/UserEditType.php">
+    <entry file="file://$PROJECT_DIR$/src/AppBundle/Controller/SecurityController.php">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="390">
-          <caret line="26" column="35" selection-start-line="26" selection-start-column="35" selection-end-line="26" selection-end-column="35" />
+        <state relative-caret-position="189">
+          <caret line="71" column="68" selection-start-line="71" selection-start-column="68" selection-end-line="71" selection-end-column="68" />
           <folding>
-            <element signature="e#34#74#0#PHP" expanded="true" />
+            <element signature="e#40#72#0#PHP" expanded="true" />
+            <element signature="e#708#739#0#PHP" expanded="true" />
+            <element signature="e#1637#1673#0#PHP" expanded="true" />
+            <element signature="e#2108#2124#1#PHP" expanded="true" />
+            <element signature="e#2658#2694#0#PHP" expanded="true" />
           </folding>
         </state>
       </provider>

+ 2 - 2
app/config/security.yml

@@ -26,7 +26,7 @@ security:
             logout_on_user_change: true
 
         main:
-            anonymous: true
+            anonymous: false
             pattern: ^/
             logout_on_user_change: true
             provider: main
@@ -47,4 +47,4 @@ security:
             #form_login: ~
 
     access_control:
-        - { path: ^/aaadmin, roles: ROLE_ADMIN }
+        - { path: ^/admin, roles: ROLE_ADMIN }

+ 1 - 1
src/AppBundle/Controller/SecurityController.php

@@ -69,7 +69,7 @@ class SecurityController extends Controller
             //$encoded = $encoder->encodePassword($user, $user->getPassword());
             //$user->setPassword($encoded);
             $em->flush();
-            $this->addFlash('success', 'L\'utilisateur a été ajouté');
+            $this->addFlash('success', 'L\'utilisateur a été modifié');
             return $this->redirectToRoute('videotheque_liste');
         }
         return $this->render('@App/security/createuser.html.twig', array (

+ 4 - 4
src/AppBundle/Form/UserEditType.php

@@ -17,12 +17,12 @@ class UserEditType extends AbstractType
     {
         $builder
             ->add('username')
-            //->add('password')
-            //->add('salt')
             ->add('roles', ChoiceType::class, array(
                 'choices'   => array (
-                    'ROLE_ADMIN'    =>  'ROLE_ADMIN',
-                    'ROLE_USER'     =>  'ROLE_USER'
+                    'Administrateur'    =>  'ROLE_ADMIN',
+                    'User'     =>  'ROLE_USER',
+                    'Modérateur'   =>  'ROLE_MODERATEUR',
+                    'Super Admin'   =>  'ROLE_SUPER_ADMIN'
                 ),
                 'multiple'  => true
             ))