advanced_configuration.rst 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. .. index::
  2. single: Advanced configuration
  3. single: Options
  4. Advanced Configuration
  5. ======================
  6. Full configuration options:
  7. .. code-block:: yaml
  8. fos_user:
  9. db_driver: orm # can be orm or mongodb (support is also available within FOSUser for couchdb, propel but none is given for SonataUserBundle)
  10. firewall_name: main
  11. user_class: Application\Sonata\UserBundle\Entity\User
  12. group:
  13. group_class: Application\Sonata\UserBundle\Entity\Group
  14. profile:
  15. # Authentication Form
  16. form:
  17. type: fos_user_profile
  18. handler: fos_user.profile.form.handler.default
  19. name: fos_user_profile_form
  20. validation_groups: [Authentication] # Please note : this is not the default value
  21. sonata_user:
  22. security_acl: false
  23. manager_type: orm # Can be orm or mongodb
  24. table:
  25. user_group: "my_custom_user_group_association_table_name"
  26. impersonating:
  27. route: page_slug
  28. parameters: { path: / }
  29. class: # Entity Classes
  30. user: Application\Sonata\UserBundle\Entity\User
  31. group: Application\Sonata\UserBundle\Entity\Group
  32. admin: # Admin Classes
  33. user:
  34. class: Sonata\UserBundle\Admin\Entity\UserAdmin
  35. controller: SonataAdminBundle:CRUD
  36. translation: SonataUserBundle
  37. group:
  38. class: Sonata\UserBundle\Admin\Entity\GroupAdmin
  39. controller: SonataAdminBundle:CRUD
  40. translation: SonataUserBundle
  41. profile:
  42. default_avatar: 'bundles/sonatauser/default_avatar.png' # Default avatar displayed if user doesn't have one
  43. # As in SonataAdminBundle's dashboard
  44. dashboard:
  45. groups:
  46. # Prototype
  47. id:
  48. label: ~
  49. label_catalogue: ~
  50. items: []
  51. item_adds: []
  52. roles: []
  53. blocks:
  54. type: ~
  55. settings:
  56. # Prototype
  57. id: []
  58. position: right
  59. register:
  60. # You may customize the registration forms over here
  61. form:
  62. type: sonata_user_registration
  63. handler: sonata.user.registration.form.handler.default
  64. name: sonata_user_registration_form
  65. validation_groups:
  66. # Defaults:
  67. - Registration
  68. - Default
  69. # This allows you to specify where you want your user redirected once he activated his account
  70. confirm:
  71. redirect:
  72. # Set it to false to disable redirection
  73. route: 'sonata_user_profile_show'
  74. route_parameters: ~
  75. # Customize user portal menu by setting links
  76. menu:
  77. -
  78. route: 'sonata_user_profile_edit'
  79. label: 'link_edit_profile'
  80. domain: 'SonataUserBundle'
  81. -
  82. route: 'sonata_user_profile_edit_authentication'
  83. label: 'link_edit_authentication'
  84. domain: 'SonataUserBundle'
  85. # Profile Form (firstname, lastname, etc ...)
  86. form:
  87. type: sonata_user_profile
  88. handler: sonata.user.profile.form.handler.default
  89. name: sonata_user_profile_form
  90. validation_groups: [Profile]
  91. # override FOSUser default serialization
  92. jms_serializer:
  93. metadata:
  94. directories:
  95. -
  96. path: "%kernel.root_dir%/../vendor/sonata-project/user-bundle/Sonata/UserBundle/Resources/config/serializer/FOSUserBundle"
  97. namespace_prefix: 'FOS\UserBundle'
  98. # Enable Doctrine to map the provided entities
  99. doctrine:
  100. orm:
  101. entity_managers:
  102. default:
  103. mappings:
  104. FOSUserBundle: ~
  105. ApplicationSonataUserBundle: ~
  106. SonataUserBundle: ~