File tree 5 files changed +88
-0
lines changed
friendsofsymfony/user-bundle/2.1
5 files changed +88
-0
lines changed Original file line number Diff line number Diff line change
1
+ fos_user :
2
+ db_driver : no_driver # valid values are 'orm', 'mongodb' and 'couchdb'
3
+ user_class : App\Entity\User
4
+ firewall_name : main
5
+ service :
6
+ mailer : fos_user.mailer.noop
7
+ from_email :
8
+ address : " %env(MAILER_SENDER_ADDRESS)%"
9
+ sender_name : " %env(MAILER_SENDER_NAME)%"
10
+
Original file line number Diff line number Diff line change
1
+ fos_user_security :
2
+ resource : " @FOSUserBundle/Resources/config/routing/security.xml"
3
+
4
+ fos_user_profile :
5
+ resource : " @FOSUserBundle/Resources/config/routing/profile.xml"
6
+ prefix : /profile
7
+
8
+ fos_user_register :
9
+ resource : " @FOSUserBundle/Resources/config/routing/registration.xml"
10
+ prefix : /register
11
+
12
+ fos_user_resetting :
13
+ resource : " @FOSUserBundle/Resources/config/routing/resetting.xml"
14
+ prefix : /resetting
15
+
16
+ fos_user_change_password :
17
+ resource : " @FOSUserBundle/Resources/config/routing/change_password.xml"
18
+ prefix : /profile
Original file line number Diff line number Diff line change
1
+ {
2
+ "bundles" : {
3
+ "FOS\\ UserBundle\\ FOSUserBundle" : [" all" ]
4
+ },
5
+ "copy-from-recipe" : {
6
+ "config/" : " %CONFIG_DIR%/" ,
7
+ "src/" : " %SRC_DIR%/"
8
+ },
9
+ "env" : {
10
+ "MAILER_SENDER_ADDRESS" :
" [email protected] " ,
11
+ "MAILER_SENDER_NAME" : " John Doe"
12
+ }
13
+ }
Original file line number Diff line number Diff line change
1
+ <bg=blue;fg=white> </>
2
+ <bg=blue;fg=white> What's next? </>
3
+ <bg=blue;fg=white> </>
4
+
5
+ - If not, install a driver storage and change it in <fg=green>config/packages/fos_user.yaml</>
6
+
7
+ - Modify your email address config in <fg=green>.env</>
8
+
9
+ - Uncomment <fg=green>csrf_protection</> and make sure <fg=green>twig engine</> is turned on by adding in <fg=green>config/packages/framework.yaml</>:
10
+
11
+ framework:
12
+ # ...
13
+ csrf_protection: true
14
+ templating:
15
+ engines: ['twig']
16
+
17
+ - Create your User class
18
+ https://symfony.com/doc/master/bundles/FOSUserBundle/index.html#step-3-create-your-user-class
19
+
20
+ - Modify your security configuration in <fg=green>config/packages/security.yaml</>
21
+ https://symfony.com/doc/master/bundles/FOSUserBundle/index.html#step-4-configure-your-application-s-security-yml
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace App \Entity ;
4
+
5
+ use Doctrine \ORM \Mapping as ORM ;
6
+ use FOS \UserBundle \Model \User as BaseUser ;
7
+
8
+ /**
9
+ * @ORM\Entity
10
+ * @ORM\Table(name="fos_user")
11
+ */
12
+ class User extends BaseUser
13
+ {
14
+ /**
15
+ * @ORM\Column(type="integer")
16
+ * @ORM\Id
17
+ * @ORM\GeneratedValue(strategy="AUTO")
18
+ */
19
+ protected $ id ;
20
+
21
+ public function __construct ()
22
+ {
23
+ parent ::__construct ();
24
+ // your own logic
25
+ }
26
+ }
You can’t perform that action at this time.
0 commit comments